Issue with igniter recompiling deps on the fly

Igniter needs to do some crazy stuff, but one of the craziest things it does is recompiles dependencies, using this bastardized version of mix deps.compile. Anyone familiar with the internals of mix who can help I would be eternally grateful, because this has stumped me so far.

I’ve honestly stumbled my way through making it work, but for some reason, sometimes (only when I’m using local dependencies in certain configurations) I just get an unceremonious exit that crashes the whole show. It seems to be related to having a dependency that is a path dependency, but I can’t say for sure.

like the entire vm goes down as far as I can tell

To reproduce:

mix archive.install hex phx_new --force
mix archive.install hex igniter_new --force
git clone git@github.com:ash-project/ash.git
git clone git@github.com:ash-project/igniter.git

ash mix igniter.new helpdesk \
  --install ash@path:../ash,ash_authentication_phoenix \
  --with phx.new --verbose --local igniter

and accept y all of the questions

I have beat my head against the wall on this problem for so long that I think I may be literally going a bit crazy about it

Is there anyone here who may be able to help me diagnose this? Or help me find a better way to recompile a dependency “live”?

I know recompiling a dependency comes with some strange behavior regardless (like if the new version of the dependency redefines a module, or no longer defines a module, etc). but honestly I think its “fine” because what we’re doing this for is access to relatively simple scripts, nothing with a runtime, no application tree etc.

9 Likes

Thanks to some prodding from José I was able to clean up a vast majority of the “jank” in this process and resolve the issue in the meantime :partying_face:

9 Likes