Add elixir_make workaround#22
Conversation
|
Thanks for the PR. Part of the reason I moved the logic into Elixir was to make exceptional cases easier to test. Could you please add some tests that would fail if this feature wasn't implemented, or regressed? I don't mind figuring out the tests if you prefer. |
|
I hear you on the ease-of-contribution issue: I think a restructuring to make it more obvious how to add a package that's expected to work could help here. I'll think about it. |
|
It turns out that elixir_make's been building for a while, as have some packages that use it (vix, cc_precompiler). I guess this is an issue with certain dependencies that use elixir_make? Would you mind sharing which packages have problems? |
Here's a self contained repo showing the failure by depending on exqlite, which uses elixir_make internally: https://github.com/codyps/deps_nix_elixir_make Here's the
Edit: on second thought, I'm not sure why vix works. I'd expect to see it still have issues because it still needs to build some c code, just not libvips itself. (yes, for |
|
Thanks for going to the trouble of making a reproduction repo! In future, you can add packages to the deps_nix suite like this: I did this on main for exqlite and it does reproduce the error. Would you mind including exqlite in |
If we don't set ELIXIR_MAKE_CACHE_DIR, the elixir_make package attempts to write to a cache directory under $HOME, which fails. Get many of the elixir_make items working by adding this and adding gnumake as a build input. For some elixir_make packages, they'll still need additional depenencies, which can be added on a package name basis. Note: It feels like this and rustlerPrecompiled, which both examine dependencies to decide on workarounds could potentially be done purely in nix instead of examining the dependencies in the deps_nix code. Doing that would also make it more clear to others how to add local workarounds for all crates that depend on a particular crate. I've kept this in deps_nix's elixir code for now for consistency with rustlerPrecompiled.
|
Thanks for pointing me in the right direction here. I've added the changes to ensure exqlite builds, and fixed the breakage to the vix test due to adding this (we may want to consider if we might want to tweak the override generation so it doesn't apply to the vix special case) |
|
It looks like this is breaking the vix build. Would you mind taking a look? |
|
Having a look at this, I think I see what happened. When we apply the I think I see a few ways to handle this, I'll take a pass at it. |
If we don't set ELIXIR_MAKE_CACHE_DIR, the elixir_make package attempts to write to a cache directory under $HOME, which fails.
Get many of the elixir_make items working by adding this and adding gnumake as a build input.
For some elixir_make packages, they'll still need additional depenencies, which can be added on a package name basis.
Note: It feels like this and rustlerPrecompiled, which both examine dependencies to decide on workarounds could potentially be done purely in nix instead of examining the dependencies in the deps_nix code. Doing that would also make it more clear to others how to add local workarounds for all crates that depend on a particular crate. I've kept this in deps_nix's elixir code for now for consistency with rustlerPrecompiled.
Note also: this doesn't apply both workarounds if a package depends on both rustler_precompiled and elixir_make, it prefers applying the rustlerPrecompiled workaround if rustler_precompiled is depended on. We could apply the workarounds in series, but I'm not sure that would make sense, and in practice packages tend to either depend on rustler_precompiled or elixir_make and not on both.