Open ahjulstad opened 4 months ago
I believe this is due to the fact that the PATH updated by juliaup has been overwritten once again and julia is no longer on the PATH.
You might try using something like the following
"PATH": "${containerEnv:PATH}:/home/vscode/.juliaup/bin:/home/vscode/.julia/conda/3/x86_64/bin"
Indeed, that works. The resulting path, though, has all the same elements.
/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/vscode/.juliaup/bin:/home/vscode/.local/bin
Why this path is not present when the container tries to run the postcreate script in my first attempt, I have no idea.
Strange behaviour. Thanks for your help, though.
Perhaps the following is happening:
.bashrc
etc. for adding the julia bin path to the PATH env var.remoteEnv
setting and the life cycle scripts are executed.The workaround is probably to set something like the following in the Feature settings, but I am not sure if this will work.
"containerEnv": {
"PATH": "~/.juliaup/bin:${PATH}"
}
There are several Features that update the PATH env var like this, but I do not know how to specify the home directory. https://github.com/devcontainers/features/blob/6f4e59866169405c7b7a8ff65e3f2ac3ced6a26e/src/rust/devcontainer-feature.json#L62
Perhaps it would be worth changing the installation location of Juliaup to a location like /usr/local/juliaup
.
https://github.com/JuliaLang/juliaup?tab=readme-ov-file#command-line-arguments
Then we can set like
"containerEnv": {
"PATH": "/usr/local/juliaup/bin:${PATH}"
}
@davidanthoff Thoughts?
When specifying PATH environment variable in the devcontainer.json, for example like this:
the postcreate.jl script fails.
MWE here:
https://github.com/ahjulstad/julia-devcontainer-feature-errror-minimimworkingexample/commit/df768106758afa1752d1994ed69884f7cb49008e
After startup I can run Julia or the
postcreate.jl
script just fine, but the language server does not start.The resulting path if I delete the remoteEnv statement becomes:
/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/bin/remote-cli:/home/vscode/.juliaup/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/vscode/.local/bin
If I keep the remoteEnv statement
/home/vscode/.juliaup/bin:/vscode/vscode-server/bin/linux-x64/e170252f762678dec6ca2cc69aba1570769a5d39/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/vscode/.local/bin
Same elements, but slightly different sequence.
(The purpose of the original path setting was to make the Julia-installed python available at the command prompt, with the goal of sharing python environments across devcontainers. And if you ask, why use devcontainers at all; I am on Windows.)
Perhaps this is caused by some core devcontainer feature, I don't know...