Skip to content

Commit 320a1b6

Browse files
KristofferCKristofferC
authored andcommitted
match against environment manifest version before using the default channel
alternative to #1095
1 parent b2f6592 commit 320a1b6

File tree

5 files changed

+2023
-77
lines changed

5 files changed

+2023
-77
lines changed

Cargo.lock

Lines changed: 106 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ is-terminal = "0.4"
6161
path-absolutize = "3.1.0"
6262
numeric-sort = "0.1.5"
6363
regex = "1.10"
64+
toml = "0.8"
65+
expand-tilde = "0.6.1"
6466

6567
[target.'cfg(windows)'.dependencies]
6668
windows = { version = "0.61.1", features = ["Win32_Foundation", "Win32_UI_Shell", "Win32_Security", "Win32_System_JobObjects", "Win32_System_Console", "Win32_System_Threading", "Services_Store", "Foundation", "Foundation_Collections", "Web_Http", "Web_Http_Headers", "Storage_Streams", "Management_Deployment"] }

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,25 @@ The Julia launcher `julia` automatically determines which specific version of Ju
156156
1. A command line Julia version specifier, such as `julia +release`.
157157
2. The `JULIAUP_CHANNEL` environment variable.
158158
3. A directory override, set with the `juliaup override set` command.
159-
3. The default Juliaup channel.
159+
4. Automatic version selection based on the active project.
160+
5. The default Juliaup channel.
160161

161162
The channel is used in the order listed above, using the first available option.
162163

164+
### Project-based Version Selection
165+
166+
When no explicit channel is specified via command line, environment variable, or directory override, Juliaup will automatically attempt to select an appropriate Julia version based on the active project's requirements.
167+
168+
If a project is specified (via `--project`, `JULIA_PROJECT`, or `JULIA_LOAD_PATH`), Juliaup reads the project's `Manifest.toml` and uses the `julia_version` field to determine which Julia version to use:
169+
170+
1. **Exact match**: If the exact version exists as a channel (e.g., `1.10.5`, `1.12.0-rc1`), it uses that version.
171+
2. **Prerelease versions**: If the version has a prerelease suffix (e.g., `1.12.1-DEV`, `1.13.0-rc1`) and no exact channel exists, it uses the corresponding nightly channel:
172+
- Uses `X.Y-nightly` if available (e.g., `1.12-nightly` for `1.12.1-DEV`)
173+
- Falls back to `nightly` otherwise
174+
3. **Future patch versions**: If the patch version is higher than any known release in that minor series (e.g., `1.10.99` when only `1.10.5` exists), it uses `X.Y-nightly`.
175+
4. **Future minor/major versions**: If the version is higher than any known release (e.g., `1.13.0` when only `1.12.x` exists), it uses `X.Y-nightly` if available, or `nightly` otherwise.
176+
5. **Default fallback**: If no project or manifest is found, it falls back to the default channel.
177+
163178
## Path used by Juliaup
164179

165180
Juliaup will by default use the Julia depot at `~/.julia` to store Julia versions and configuration files. This can be changed by setting

0 commit comments

Comments
 (0)