Since upgrading from 1.17 -> 1.18 have noticed what might be a regression - or maybe I am doing something wrong, and a fix in 1.18 has surfaced this miss use.
When attempting the same in the most recent 1.18.8 release, the following is logged to the stderr out file,
Unknown command: `asdf exec node /home/doug/projects/exec_test/priv/test.js`
/home/doug/.asdf/bin/asdf: line 82: ASDF_DIR=/home/doug/.asdf/lib/commands/command-help.bash: No such file or directory
The above ASDF_DIR file does in fact exist...
and I get the following error in IEX ** (EXIT from #PID<0.225.0>) shell process exited with reason: {:exit_status, 32512} as can be gleaned the stderr log, the shell command did not execute properly
I have a hunch this has something to with environment variables. If I remove the the :env option, the following works in 1.18.8.
script = "#{File.cwd!}/priv/script.js" # path to a js script file
opts = [stdout: "/tmp/output", stderr: "/tmp/errout"]
:exec.run_link("node #{script}", opts)
I tried setting the SHELL environment variable, but it seems that has the same result - as the environment variables, even without the :clear option seem to be getting cleared?
Instead of the :env option, running the following works, and might suffice as a temporary workaround
Since upgrading from 1.17 -> 1.18 have noticed what might be a regression - or maybe I am doing something wrong, and a fix in 1.18 has surfaced this miss use.
EDIT:
So I just tested this:
The output looks like this:
My injected variable
TEST
looks OK - but the others have all been broken.I am trying to launch a nodejs script via
:exec:run_link/2
. I have nodejs installed via ASDF, runningnode
in bash works fine.In 1.17.6, the following works as expected, node is launched with the script, and environment variables are merged
When attempting the same in the most recent 1.18.8 release, the following is logged to the stderr out file,
The above
ASDF_DIR
file does in fact exist...and I get the following error in IEX
** (EXIT from #PID<0.225.0>) shell process exited with reason: {:exit_status, 32512}
as can be gleaned the stderr log, the shell command did not execute properlyI have a hunch this has something to with environment variables. If I remove the the :env option, the following works in 1.18.8.
I tried setting the
SHELL
environment variable, but it seems that has the same result - as the environment variables, even without the:clear
option seem to be getting cleared?Instead of the :env option, running the following works, and might suffice as a temporary workaround
I am running Ubuntu 20.04 in WSL2, Erlang 23.1.5 and Elixir 1.11.2-otp-23.
Let me know if you need any more information.
Thanks for the help!