Open LilithHafner opened 1 year ago
The question is how we would do this :) The installation logic is all in juliainstaller
binary and I don't think one can "inject" or modify env variables in the parent process, right?
Would changing the primary invocation to . <(curl -fsSL https://install.julialang.org | sh)
work? juliainstaller
would need to produce PATH=...
as its output.
It should also be possible to make the primary invocation . <(curl -fsSL https://install.julialang.org)
, but that may take more work.
Demo
x@X ~ % . <(echo PTHH=$PATH)
x@X ~ % echo $PTHH
/Users/x/.julia/juliaup/bin:/Library/Framewo...
I'm not sure. The current version of the shell script is simply copied from rustup. As far as I can tell there are quite a few quirks in there to make sure it works on as many systems as possible, so I'd be a bit hesitant to make larger changes at this point, it would really require that we then test that thoroughly on all sorts of systems...
Do we have CI for this or would it need to be manually tested?
It would all be manual tests. This is the kind of thing where it is very easy to get it right for 90% of systems/users (and that includes the systems we have on CI), and then there is this very, very long tail of weirdly configured systems where things also need to work. I'm sure rustup just accumulated bug fixes over many years to arrive at the current version of the script, and in many ways we are just benefitting from their experience, probably without even being aware of all the quirks they are dealing with :)
A major issue with . <(curl -fsSL https://install.julialang.org | sh)
is that it wouldn't work in every shell, unless one took great care to detect say zsh vs. bash vs fish vs tcsh vs ... -- I actually don't see a way to do that at all, but of course that just shows my fantasy is limited :-)
The extra step of reloading the shell or re-executing a startup file seems unnecessary to me.
This is especially important for scripts using juliaup via expect. It would be nice to not have to do shell detection and pick which startup file to execute.
Additionally, some folks' startup files may not behave well when run repeatedly as julaup currently recommends.