erlang.mk
erlang.mk copied to clipboard
Add Elixir.mk - Allows for use of Elixir deps within an Erlang project.
This change introduces a new core plugin called elixir.mk
.
This change accomplishes the following:
- Converts
mix.exs
projects to useerlang.mk
- Compiles
.ex
files, allowing for a project to use either Erlang, Elixir or a combination of both - Properly configures paths so that Elixir dependencies are added to the
$(PROJECT).app
- Treats Elixir as a dependency & fetches it as such, rather than relying on a system installation
This change makes use of hex.mk
Currently rebasing the change :)
@essen I've added a test under test/core_elixir.mk
though I've been testing locally with a sample project.
Hello! I've not had a good look yet but I doubt this works with some Elixir NIFs since they often have a Makefile and thus wouldn't enter the elixir autopatch.
Hello! I've not had a good look yet but I doubt this works with some Elixir NIFs since they often have a Makefile and thus wouldn't enter the elixir autopatch.
Damn, that's a good shout - any idea of an elixir lib which uses NIFs?
There's a few in this search but gotta filter. Oftentimes if the page says mix + make as a build tool, that's an Elixir NIF. But not always.
https://hex.pm/packages?search=nif&sort=total_downloads
There's a few in this search but gotta filter. Oftentimes if the page says mix + make as a build tool, that's an Elixir NIF. But not always.
https://hex.pm/packages?search=nif&sort=total_downloads
I've just commited a change which should now make it support Elixir Nifs (assuming they use elixir_make - I'm not 100% familiar with the Elixir NIF ecosystem so not quite sure if I've accounted for the right things there).
I've added an additional test which will attempt to compile libsalty2
, though this depends on libsodium.
If you've any more suggestions @essen, I'm more than happy to add them 👍
Any chance I could poke you to look this over @essen? 😄
Does this work even if using local system installed Elixir?
Does this work even if using local system installed Elixir?
In what sense @essen?
I'm expecting elixir to always be loaded as a dep of the project rather than as an installed version on the system - I can try and account for this though if you'd prefer that functionality to be in there.
I'll edit this for confirmation but the only thing I think that could be problematic with an installed version of elixir is if code:get_path()
returned paths to the installed elixir version, though I wouldn't ever expect that to be the case with a standard install.
I think we should take the dep Elixir if one is available as a dep, and the system Elixir otherwise. Basically the dep can be used as an override.
Most projects don't require a specific version of Elixir, and for example in RabbitMQ we explicitly use the system Elixir (we even build packages for it).
@essen could you have a look over when you have chance?
Based on your feedback, I've updated the MR to default to using the System Install of Elixir if available. This can be manually overriden by a user-set var though (ELIXIR_USE_SYSTEM
)
Let me know what you think :)
@essen could you have a look over when you have chance?
Based on your feedback, I've updated the MR to default to using the System Install of Elixir if available. This can be manually overriden by a user-set var though (
ELIXIR_USE_SYSTEM
)Let me know what you think :)
just poking you 😄
I'll get to it no need to remind so often.
@essen sorry to poke on this one again, any idea when you'll be able to get round to it? :)
Is the thing that transforms paths like Elixir/MyApp/MyMod.ex into module name Elixir.MyApp.MyMod
something the compiler does, or am I just blind and I missed it?