Mix cmd regression
Closed this issue · 2 comments
Elixir and Erlang/OTP versions
Erlang/OTP 28 [erts-16.1] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns]
Elixir 1.19.0-rc.0 (compiled with Erlang/OTP 28)
Operating system
Ubuntu 22.04
Current behavior
According to Mix documentation, it should be possible run a relative script with mix cmd, for example mix cmd priv/world.sh in an alias. See:
Lines 273 to 291 in f089571
We use this in some of our repositories in aliases, and the fix is simple enough for that use case
"cmd #{Path.absname("./priv/world.sh")}"
Expected behavior
I would expect mix cmd to be able to run relative scripts in line with the documentation.
If this is not to be fixed, I would expect the documentation to be updated and for this to be logged as a deprecation in the 1.19 release changelog.
I am quite certain this was introduced by #13751 even though I have not confirmed it, but I can see in the System.cmd code that relative paths are not allowed which throws the enoent error that I am seeing.
The PR you linked changes only Rebar, But I have identified the root cause and submitted a PR. Thanks for the report.
Thanks for the quick triage!
I don't think the PR I linked only changes Rebar. It makes changes to Mix.Shell.cmd, swapping System.shell for System.cmd, which behave differently and potentially affecting everything that calls Mix.shell().cmd(). Or am I misunderstanding?
Edit: Ok nevermind, I see what you mean. Accepting the tuple form was added in that PR, and another one then uses that one for the mix cmd.