zachdaniel

zachdaniel

Creator of Ash

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.

https://github.com/ash-project/igniter/blob/main/lib/igniter/deps_compile.ex

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.

Most Liked

zachdaniel

zachdaniel

Creator of Ash

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:

https://github.com/ash-project/igniter/blob/231ebf7c35f9b260dd41017aa78aa1abf746ac76/lib/igniter/util/install.ex#L142

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement