-
Notifications
You must be signed in to change notification settings - Fork 44
Closed
Description
Since rustup
1.28 PR rust-lang/rustup#4023, cargo-home/bin/cargo
is symlinked to cargo-home/bin/rustup
. As part of running a command, the binary's path is utils::normalize_path
'd, which includes symlink resolution. As a result, cargo
commands end up being called as rustup
, for example, rustup install git-credential-null
which results in an error.
I'm not sure, but a hacky fix could be to store the filename before resolution (the canonicalize
call) and restore it afterwards?
Lines 111 to 112 in 744375a
pub(crate) fn normalize_path(path: &Path) -> PathBuf { | |
let mut p = std::fs::canonicalize(path).unwrap_or_else(|_| path.to_path_buf()); |
For the short term, is there a way to override the rustup
version being used short of changing the hardcoded URL?
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
syphar commentedon Mar 4, 2025
Currently docs.rs builds are broken because of this: https://rust-lang.zulipchat.com/#narrow/channel/356853-t-docs-rs/topic/Last.20successful.20build.20was.2015.20hours.20ago
in the docs.rs team we're currently trying to find a way to freeze an older rustup version, but weren't successful yet
Skgland commentedon Mar 4, 2025
Should this maybe also be reported to rustup?
It looks like they are planning a bugfix release 1.28.1, but I don't see a corresponding issue for the symlink/hardlink switch causing problems nor is it listen in rust-lang/rustup#4219
jstrong-lhava commentedon Mar 4, 2025
I tried this hacky fix, which solved the immediate problem (
rustup install git-credential-null
) but subsequent commands failed withExecutionFailed(ExitStatus(unix_wait_status(32512)))
. Seems likely to be related but I can't find any other place in the code where paths arecanonicalize
d or the code would otherwise fail due to symlinks vs. hardlinks. (in the same boat, trying to get docs to build at Shipyard.rs.)syphar commentedon Mar 5, 2025
I created a PR that will (for now) freeze the used rustup version to 1.27.1, and disable its self-update
syphar commentedon Mar 5, 2025
I released 0.19.1 which freezes rustup to 1.27.1
jstrong-lhava commentedon Mar 6, 2025
thanks @syphar! was able to get docs building at shipyard.rs last night with the help of your PR.
have you determined whether rustup 0.28.1 works with rustwide builds (i.e. reverts the switch from hardlinks to symlinks)? haven't had time to check yet.
syphar commentedon Mar 6, 2025
You're very welcome! Good to hear you're using rustwide in shipyard.rs too.
It doesn't switch to hardlinks again, but changed absolute symlinks to relative symlinks. But it still doesn't work.
I'll have to dig into how exactly the rustup/cargo folders are mapped into the docker container so figure out why the symlinks don't work.