Failed to execute `rustup update` in the Rust `devcontainer`
I get the same problem calling
rustup updatein a devcontainer. The devcontainer just installs 1.84 and I need 1.85. I getvscode ➜ /workspaces/my_project $ rustup update info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' info: latest update on 2025-02-20, rust version 1.85.0 (4d91de4e4 2025-02-17) info: downloading component 'clippy' info: downloading component 'rustfmt' info: downloading component 'rust-src' info: downloading component 'rust-analysis' info: downloading component 'rls' info: downloading component 'cargo' info: downloading component 'rust-std' info: downloading component 'rustc' 69.5 MiB / 69.5 MiB (100 %) 27.2 MiB/s in 2s ETA: 0s info: removing previous version of component 'clippy' info: rolling back changes error: could not rename component file from '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy' to '/usr/local/rustup/tmp/58z480gzx9kr9vug_dir/bk' info: checking for self-update stable-x86_64-unknown-linux-gnu update failed - rustc 1.84.1 (e71f9a9a9 2025-01-27) info: cleaning up downloads & tmp directories
Originally posted by @Psy-Kai in #4181
@psy-kai I cannot seem to be able to reproduce this on my machine. Here's what I've tried:
> uname -moprsv
Darwin 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000 arm64 arm
> git clone https://github.com/microsoft/vscode-remote-try-rust && cd vscode-remote-try-rust
[..]
> devcontainer up --workspace-folder .
[..]
> devcontainer exec --workspace-folder . bash
Now we have entered the devcontainer.
$ rustup show active-toolchain
1.83.0-aarch64-unknown-linux-gnu (default)
Having noticed that the default toolchain is 1.83.0, let's pretend it's stable to trigger the update.
$ sudo mv /usr/local/rustup/toolchains/1.83.0-aarch64-unknown-linux-gnu/ /usr/local/rustup/toolchains/stable-aarch64-unknown-linux-gnu/
$ rustup update
[..]
info: downloading component 'clippy'
info: downloading component 'rustfmt'
info: downloading component 'rust-src'
info: downloading component 'rust-analysis'
info: downloading component 'rls'
info: downloading component 'cargo'
info: downloading component 'rust-std'
info: downloading component 'rustc'
83.9 MiB / 83.9 MiB (100 %) 16.8 MiB/s in 5s ETA: 0s
info: removing previous version of component 'clippy'
info: removing previous version of component 'rustfmt'
info: removing previous version of component 'rust-src'
info: removing previous version of component 'rust-analysis'
info: removing previous version of component 'rls'
info: removing previous version of component 'cargo'
info: removing previous version of component 'rust-std'
info: removing previous version of component 'rustc'
info: installing component 'clippy'
info: installing component 'rustfmt'
info: installing component 'rust-src'
info: installing component 'rust-analysis'
info: installing component 'rls'
info: installing component 'cargo'
info: installing component 'rust-std'
29.6 MiB / 29.6 MiB (100 %) 18.5 MiB/s in 1s ETA: 0s
info: installing component 'rustc'
83.9 MiB / 83.9 MiB (100 %) 19.8 MiB/s in 4s ETA: 0s
info: checking for self-update
stable-aarch64-unknown-linux-gnu updated - rustc 1.85.0 (4d91de4e4 2025-02-17) (from rustc 1.83.0 (90b35a623 2024-11-26))
Following your commands I get
vscode ➜ /workspaces/vscode-remote-try-rust (main) $ sudo mv /usr/local/rustup/toolchains/1.83.0-x86_64-unknown-linux-gnu/ /usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu
vscode ➜ /workspaces/vscode-remote-try-rust (main) $ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2025-02-20, rust version 1.85.0 (4d91de4e4 2025-02-17)
info: downloading component 'clippy'
info: downloading component 'rustfmt'
info: downloading component 'rust-src'
info: downloading component 'rust-analysis'
info: downloading component 'rls'
info: downloading component 'cargo'
info: downloading component 'rust-std'
26.7 MiB / 26.7 MiB (100 %) 11.9 MiB/s in 2s ETA: 0s
info: downloading component 'rustc'
69.5 MiB / 69.5 MiB (100 %) 13.5 MiB/s in 5s ETA: 0s
info: removing previous version of component 'clippy'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
info: retrying renaming '/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/clippy/README.md' to '/usr/local/rustup/tmp/ji2b2lqwqdvxg6z5_file'
Sorry I did not specify my whole setup:
- wsl2 - debian
- podman instead of docker (which should not be a problem)
OT: thanks for the very fast and friendly response :)
@Psy-Kai From my personal experience, podman is known to have subtle bugs compared to docker, and that's why I have both on my workstation. [^1] Would you mind giving docker another try for the sake of science?
[^1]: One subtle difference, for example, is that https://github.com/grafana/docker-otel-lgtm never actually boots up on podman, but works perfectly with docker.
So I setup two fresh debian bookworm 12.9 vms, one with podman and one with docker. With both I get the "retrying renaming" bug in the devcontainer.