elixir
elixir copied to clipboard
Missing debug on calling external commands
Elixir and Erlang/OTP versions
N/A - Latest stable release, see:
$ elixir --version
Erlang/OTP 27 [erts-15.1.1] [source] [64-bit] [smp:32:32] [ds:32:32:10] [async-threads:1] [jit:ns]
Elixir 1.17.3 (compiled with Erlang/OTP 27)
Operating system
N/A - It's related to issue on Windows, but may happen on every distro/OS
Current behavior
The following line silences possible error messages coming from external commands (in related topic it's escript.exe):
https://github.com/elixir-lang/elixir/blob/78f63d08313677a680868685701ae79a2459dcc1/lib/mix/lib/mix/shell.ex#L132
Here is a link to mentioned related issue posted on forum with more details from me: 26th post in Not being able to compile telemetry dependency # Phoenix Forum |> Questions / Help
Expected behavior
When status != 0 and env MIX_DEBUG is set to 1 the error message should be printed in order to further investigate issue with external commands.
We do print the message as it arrives, based on the callback given. So the default shell should print those.
In other words, the pass a struct to :into which calls the callback on every iteration.
Weird … for others interested here is an image from related topic:
As we can see it runs hooks and then raises Mix.Error with escript.exe command printed, but without the output …
@josevalim So you think that escript.exe have failed with exit_status > 0 and did not print any message (which was supposed to be caught and printed by default shell)?
Something like:
{"", 1} = System.shell(command, options)
Yes, any message should be printed by the default callback. Perhaps there could be a bug in the System.shell command making us discard things or on escript.exe, but I think the linked code is not the one doing it. :)
I will close this for now. If you have more information, please let us know and we will gladly reopen it!