JuliaLang / juliaup

Julia installer and version multiplexer
MIT License
1.01k stars 86 forks source link

Allow users to manually modify `PATH` #935

Closed adrhill closed 5 months ago

adrhill commented 5 months ago

Problem

On many systems, having programs like juliaup modify the PATH in a .bash_profile or .zshrc config file is not a viable option.

Immutable or unreadable configuration files are the source of many crash reports, e.g. the "Failed to open file" error (#826, #864, #874, #891, #918, ...).

In #796, @davidanthoff mentioned

So in both cases it looks like we don't have the permissions required to edit the shell scripts where add Juliaup to the PATH. We can (and should) obviously catch this and output something more helpful, but at the same time I'm not sure how we can recover from this error, putting things onto the PATH is really crucial for things to work, but if we can't do that, then that is kind of a problem...

If anyone has an idea, that would be great :)

Feature request

juliaup should provide an option for advanced users where it simply tells them what needs to be manually added to their PATH.

Such an option seemingly exists, but doesn't appear to work (#875), still running into the "Failed to open file" error:

✔ Do you want to add the Julia binaries to your PATH by manipulating various shell startup scripts? · no

This has also been observed in #920:

Strangely, the crash during the juliaup installation also occurs if I customize the installation to decline "Do you want to add the Julia binaries to your PATH by manipulating various shell startup scripts?".

Related discussions: #796, #920, #875

tecosaur commented 5 months ago

This should be helped/partially solved by #844, but I think that conversation got a bit side-tracked (talking about XDG compliance in Julia itself, again :facepalm:).

adrhill commented 5 months ago

Even with #844 addressed, I still find it surprising that the "manual installation option" tries to open any shell config files. Maybe this is a bug?

davidanthoff commented 5 months ago

Yes, that is a bug, fix is coming with https://github.com/JuliaLang/juliaup/pull/943.

That is only the first part to the broader problem, next I need to output better error messages when these files are not editable and give some instructions on what to do.

adrhill commented 5 months ago

Closed by #943.