Skip to content

Centralize where paths are discovered v2 - #1556

Open
ghyatzo wants to merge 1 commit into
JuliaLang:mainfrom
ghyatzo:centralize-paths-v2
Open

Centralize where paths are discovered v2#1556
ghyatzo wants to merge 1 commit into
JuliaLang:mainfrom
ghyatzo:centralize-paths-v2

Conversation

@ghyatzo

@ghyatzo ghyatzo commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Thanks to @fingolfin that reminded me that I had licked the cookied but hadn't eaten it yet.

Replace the scattered get_juliaup_path() / current_exe() calls with two new GlobalPaths fields — juliaupselfexecfolder and juliaupselfexec — computed once via dunce::canonicalize in get_paths() and reused everywhere.

Supersedes: #915, #886

some additional small changes on top of #915 regarding JULIAUP_BIN_DIR. I renamed the function get_bin_dir to get_channel_link_dir to clarify it's real purpose.

There is a bit of a mismatch with having the ability to specify JULIAUP_DEPOT_PATH through env var, but not the binary location (other than sourcing .bashrc) but that can be a separate discussion, along with keep relying or not on current_exe semantics instead of more external authorities (would help with the whole julialauncher calling juliaup trick).

Discussions on whether the undocumented JULIAUP_BIN_DIR still has its place or not are also out of scope, although it ties pretty close with the above since the name is pretty confusing. should it be a thing on its own? all binaries and symlinks in the same folder?

@fingolfin

Copy link
Copy Markdown
Member

@ghyatzo CI fails, already the rustfmt check, but there is also

error[E0063]: missing fields `juliaupselfexec` and `juliaupselfexecfolder` in initializer of `global_paths::GlobalPaths`
Error:    --> src/config_file.rs:750:9
    |
750 |         GlobalPaths {
    |         ^^^^^^^^^^^ missing `juliaupselfexec` and `juliaupselfexecfolder`

@ghyatzo

ghyatzo commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Yeah, I had a misconfigured IDE without the proper features enabled.
Hadn't had the time to revisit yet.
Will do within the week. Apologies.

Replace the scattered get_juliaup_path() / current_exe() calls with
two new GlobalPaths fields — juliaupselfexecfolder and juliaupselfexec —
computed once via dunce::canonicalize in get_paths() and reused
everywhere.

Changes:
- global_paths.rs: add juliaupselfexecfolder + juliaupselfexec,
  unconditional; soft fallback if canonicalize fails; use canonicalized
  path for juliaupselfhome too
- julialauncher.rs: delete get_juliaup_path() helper, thread &GlobalPaths
  through do_initial_setup / run_versiondb_update / run_selfupdate /
  spawn_juliaup_add, fix all call sites
- command_selfupdate.rs: download to paths.juliaupselfexecfolder;
  preserve the _post-update spawn from JuliaLang#1513 (critical: previous
  attempt in JuliaLang#915 dropped this, regressing the julia symlink restore)
- operations.rs: BundledJulia path via paths.juliaupselfexecfolder;
  remove_symlink and install_background_selfupdate take &GlobalPaths
- juliainstaller.rs + command_config_modifypath.rs: rename
  juliaupselfbin → juliaupselfexecfolder
- utils.rs: get_bin_dir(paths) drops undocumented JULIAUP_BIN_DIR env
  var; sources from paths.juliaupselfexecfolder; keeps ~/.local/bin
  fallback for system-wide installs
- Update all remove_symlink / install_background_selfupdate call sites

Fixes from the JuliaLang#915 rebase:
- _post-update hook no longer dropped (the JuliaLang#1513 regression)
- path vs paths typo and juliupselfexecfolder typo corrected
- run_selfupdate call sites pass &paths to new signature

Supersedes: JuliaLang#915, JuliaLang#886
@ghyatzo
ghyatzo force-pushed the centralize-paths-v2 branch from 117e3d0 to 1aed748 Compare August 9, 2026 12:21
@ghyatzo

ghyatzo commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants