-
-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elixir package support does not work on Windows #1773
Comments
Thank you. fyi @tynanbe |
@Smaehtin could you share what you have so far for fixing it? The .bat bit sounds very useful 🙏 |
This stackoverflow post suggests that you use double double-quotes, i.e.
|
A Windows alternative for the line in question might look like this, since the single "File.write!(\"\"{}\"\", [{}] |> Stream.map(fn(lib) -> lib |> :code.lib_dir |> Path.expand end) |> Enum.join(\"\"\\n\"\"))" To end up as "File.write!(""gleam_elixir_paths"", [:eex, :elixir, :logger, :mix] |> Stream.map(fn(lib) -> lib |> :code.lib_dir |> Path.expand end) |> Enum.join(""\n""))" |
Thanks for the suggestions! Unfortunately, it seems like a combination of the I have boiled the problem down to the following batch script (
It can be boiled down even further by I can't seem to find a way to correctly escape Unfortunately, I have basically zero experience with batch scripts, so I'm a bit clueless here. |
That is super useful, thank you @Smaehtin ! |
Yes! Great workaround. That fixed the
The quotes get stripped from the input. Seems like rust-lang/rust#29494 is related and it requires using Will do some more digging tomorrow if I have time |
Another hack, but we could use an :ok = File.write(~s(gleam_elixir_paths), ...
Does anyone have a WIP branch for this? A PR would be fab! |
Perfect! That avoids a lot of headache. I'll have a PR ready soon. |
So arguably this seems like a bug in elixir.bat, except that it seems like batch scripts just cannot correctly handle arbitrary characters in their arguments: https://stackoverflow.com/q/4200316 – so that seems unlikely to be properly fixed. Perhaps a more reliable fix that doesn't rely on rewriting the code would be to use a temp file instead of --eval. |
The recent addition of support for Elixir packages in Gleam 0.23 does not work on Windows.
Attempting to compile a project that depends on
tzdata
gives the following:The issue, I believe, is that the invoking Elixir is currently hardcoded to invoking
elixir
, while on Windows it should be done viaelixir.bat
.However, fixing this in the compiler gives the following error:
My guess is it has something to do with the way command-line arguments are passed to
elixir.bat
that has to be done differently on Windows than on Unix-like operating systems.The text was updated successfully, but these errors were encountered: