JuliaLang / juliaup

Julia installer and version multiplexer
MIT License
982 stars 83 forks source link

Centralize where paths are discovered #915

Open davidanthoff opened 5 months ago

davidanthoff commented 5 months ago

Alterantive to #886.

@ghyatzo I started to look into it, and then got carried away ;) I think this should be correct, but I'm also a bit nervous as any error in any of this would really be bad... If you could take a careful look if this all looks right to you that would be amazing.

The general idea now is that juliaupselfexecfolder is the folder where the juliaup binary is located and juliaupselfexec is the path to the juliaup binary itself. And all paths should be canonical.

There is one thing I don't fully understand, I'll leave a comment at that location.

ghyatzo commented 5 months ago

Nice to have this alternative! I took a look, it all seems good, and actually clears up a lot of the code, which is nice. I didn't want to touch the various features flags, or signatures, but happy that you did it, it feels better to have a single storage.

first a minor comment: probably still having the logic to get the exec path in a separate function can be beneficial for maintainability.

On another note, I am really uneasy about the get_bin_dir() function and the JULIAUP_BIN_DIR environmental variable. I commented about it exensively in my PR. That function get_bin_dir really feels out of place, and the JULIAUP_BIN_DIR is only used there as far as I can tell.

I would also really know what you think about the proposal of just instead using JULIAUP_DEPOT_PATH as the real "authority" and everything else can follow from that. (check the comment in #886)!

ghyatzo commented 3 months ago

Any news regarding this? or comments in #886?