JuliaLang / juliaup

Julia installer and version multiplexer
MIT License
931 stars 81 forks source link

Allow users to manually modify `PATH` #935

Closed adrhill closed 3 weeks ago

adrhill commented 1 month 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 1 month 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 1 month 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 3 weeks 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 3 weeks ago

Closed by #943.