Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@ To launch the default Julia version simply run `julia` in your terminal.

To launch a specific Julia version, say in channel `release`, run `julia +release`.

On Unix-like platforms, `juliaup config channelsymlinks true` creates a
separate executable name for each installed channel. These entries are named
`julia-<CHANNEL>`, for example `julia-release`, and point to the Julia version
for that channel.

Juliaup creates these channel symlinks in the directory returned by
`JULIAUP_BIN_DIR` when that environment variable is set. If `JULIAUP_BIN_DIR`
contains multiple entries separated like `PATH`, Juliaup uses the first entry.
When `JULIAUP_BIN_DIR` is not set, Juliaup uses the directory containing the
running `juliaup` executable if that directory is inside the user's home
directory; otherwise it uses `~/.local/bin`.
Comment on lines +161 to +166

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In light of the discussion at #1556, it seems JULIAUP_BIN_DIR is a rather obscure feature and may intentionally be undocumented (and perhaps should be removed outright?)

It'd be good to hear from @davidanthoff and @ghyatzo ...?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I have the authority to say anything final in this matter. At the time I had just pointed out that it was still undocumented so it was unclear if it was intended to stay or to be deprecated. I think that it's been enough time that probably even if undocumented it would be too breaking removing this.

The name is pretty confusing imho, but maybe we can use the same location as an installation location also for juliaup and julialauncher binaries, but haven't explored this idea very thoroughly yet.


## Overrides

The Julia launcher `julia` automatically determines which specific version of Julia to launch. There are several ways to control and override which Juliaup channel should be used:
Expand Down
30 changes: 24 additions & 6 deletions src/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1423,8 +1423,9 @@ fn create_system_channel_symlink(
print_juliaup_style(
"Updating",
&format!(
"symlink {} ( {} -> {} )",
"symlink {} at {} ( {} -> {} )",
symlink_name,
symlink_path.display(),
prev_target.to_string_lossy(),
version
),
Expand All @@ -1433,7 +1434,12 @@ fn create_system_channel_symlink(
} else {
print_juliaup_style(
"Creating",
&format!("symlink {} for Julia {}", symlink_name, version),
&format!(
"symlink {} at {} for Julia {}",
symlink_name,
symlink_path.display(),
version
),
JuliaupMessageType::Progress,
);
}
Expand Down Expand Up @@ -1462,8 +1468,9 @@ fn create_direct_download_symlink(
print_juliaup_style(
"Updating",
&format!(
"symlink {} ( {} -> {} )",
"symlink {} at {} ( {} -> {} )",
symlink_name,
symlink_path.display(),
prev_target.to_string_lossy(),
version
),
Expand All @@ -1472,7 +1479,12 @@ fn create_direct_download_symlink(
} else {
print_juliaup_style(
"Creating",
&format!("symlink {} for Julia {}", symlink_name, version),
&format!(
"symlink {} at {} for Julia {}",
symlink_name,
symlink_path.display(),
version
),
JuliaupMessageType::Progress,
);
}
Expand Down Expand Up @@ -1503,8 +1515,9 @@ fn create_linked_channel_shim(
print_juliaup_style(
"Updating",
&format!(
"shim {} ( {} -> {} )",
"shim {} at {} ( {} -> {} )",
symlink_name,
symlink_path.display(),
prev_target.to_string_lossy(),
formatted_command
),
Expand All @@ -1513,7 +1526,12 @@ fn create_linked_channel_shim(
} else {
print_juliaup_style(
"Creating",
&format!("shim {} for {}", symlink_name, formatted_command),
&format!(
"shim {} at {} for {}",
symlink_name,
symlink_path.display(),
formatted_command
),
JuliaupMessageType::Progress,
);
}
Expand Down
42 changes: 42 additions & 0 deletions tests/command_config_symlinks.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#[cfg(not(windows))]
use predicates::prelude::*;

#[cfg(not(windows))]
mod utils;

#[cfg(not(windows))]
use utils::TestEnv;

#[cfg(not(windows))]
#[test]
fn channelsymlinks_reports_destination_path() {
let env = TestEnv::new();
let bin_dir = assert_fs::TempDir::new().unwrap();
let expected_symlink = bin_dir.path().join("julia-release");

env.juliaup()
.arg("add")
.arg("release")
.assert()
.success()
.stdout("");

env.juliaup()
.env("JULIAUP_BIN_DIR", bin_dir.path())
.arg("config")
.arg("channelsymlinks")
.arg("true")
.assert()
.success()
.stderr(
predicate::str::contains(format!(
"Creating symlink julia-release at {}",
expected_symlink.display()
))
.and(predicate::str::contains(
"Configure Property 'channelsymlinks' set to 'true'",
)),
);

assert!(expected_symlink.exists());
}
Loading