Closed nsidnev closed 1 year ago
I was reviewing my branch and the code that is responsible for building dependencies and realized that instead of determining if there is a mix
executable on the system, Gleam can determine in advance if the package depends on any pure Elixir package that requires a mix
to be built and in that case delegate rebar3
packages building to mix
.
I think that sounds better than my original suggestion.
I think we want to go with the original design as it'll give a better error message for the user, and also a non-Mix library could be making use of the Elixir modules.
Hey!
I found this issue and the commit that fixes it. I understand the reason for such a solution, but it seems to me that it is not perfect.
I am currently looking into the option of implementing a wrapper on Gleam for a client for EdgeDB on Elixir and have run into a problem.
The client uses jose and crc dependencies, which have
rebar3
andmix
configs. And in both cases the Elixir wrapper over Erlang code is in the same package.The current behavior of the Gleam compiler is such that it sees the option of compiling the package with
rebar3
and ignores the Elixir code completely. And if the next Elixir package (EdgeDB
) uses a wrapper (JOSE
/CRC
), then the compilation will fail because the required modules won't be found:I think that Gleam, in addition to package tools, should check for the existence of
mix
executable before deciding which utility to use for the compilation.I have a working branch ready for this change, but want to check if I'm thinking in the right direction before posting a new PR.