elixir_make
elixir_make copied to clipboard
On Windows provide environment variables containing paths with backslashes instead of forward slashes
It would be beneficial for windows build tools (alright, I mean just nmake
) to get Windows-compatible environment variables.
For example ERTS_INCLUDE_DIR
in nmake resolves to c:/Program Files/erl10.3/erts-10.3/include
instead of c:\Program Files\erl10.3\erts-10.3\include
.
While the compiler and nmake itself can deal with that, other tools like copy
can't and throw an error. This is especially important on Windows and nmake
as useful tools like tr
are not available by default and nmake
itself is quite limited in features.
Since by now probably some number of projects have worked around that in some way or other, it may also be an option to define additional variables with backslashes, so maintainers have the option to use back- or forward slashes depending on their requirements.
@E14 I'm not quite sure what you're suggesting to do in this library. Can you clarify that?
The library suggests nmake
as a default build tool, set here:
- https://github.com/elixir-lang/elixir_make/blob/master/lib/mix/tasks/compile.make.ex#L246
The library defines environment variables (I think) here:
- https://github.com/elixir-lang/elixir_make/blob/master/lib/mix/tasks/compile.make.ex#L287
Within the beam, using forward slashes is fine, since Elixir itself is cross-platform. But build tools are platform-specific, so it would be the responsibility of this library and not Elixir itself to translate the environment appropriately as it "leaves" the beam.
Okay, I see. @josevalim I thought Path.join/2
would use backslashes if needed, that's not the case Iām guessing? #lazyweb
Path.join always uses Unix separator, even on Windows. They are converted to \\
at the OS integration level inside the VM. We should probably define some _WINDOWS
variables if the OS is Windows with those paths converted.
Awesome! @E14 would you be willing to send a PR? š
Awesome! @E14 would you be willing to send a PR? š
I haven't patched this yet as I used a workaround to make the build work with Unix paths. I can create one, but I'm very busy at work currently and Elixir is still personal time for me, so if you have a release coming up, I can't promise you I can make it
No release coming up and I'm also swamped at work, so take your time š If I get to this at some point, I'll make sure to bring that up here
Closing this for now. If this is tripping someone, a PR is welcome!