Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"directory does not exist" errors when rustup update #3230

Closed
liigo opened this issue Feb 22, 2023 · 5 comments
Closed

"directory does not exist" errors when rustup update #3230

liigo opened this issue Feb 22, 2023 · 5 comments

Comments

@liigo
Copy link

liigo commented Feb 22, 2023

Problem

when rustup update, the following errors occur:

error: failure removing component 'rust-docs-x86_64-unknown-linux-gnu', directory does not exist: 'share/doc/rust/html'

after I mkdir these directories, another error occurs:

error: failure removing component 'rustc-x86_64-unknown-linux-gnu', directory does not exist: 'share/doc/rust/LICENSE-MIT'

after I creating an empty file (note: not directory) LICENSE-MIT, other errors occur:

error: failure removing component 'rustc-x86_64-unknown-linux-gnu', directory does not exist: 'share/doc/rust/README.md'
error: failure removing component 'rustc-x86_64-unknown-linux-gnu', directory does not exist: 'share/doc/rust/COPYRIGHT'
error: failure removing component 'rustc-x86_64-unknown-linux-gnu', directory does not exist: 'share/doc/rust/LICENSE-APACHE'

then I must create empty README.md, COPYRIGHT and LICENSE-APACHE files (note: they're not directory as the error says).

In the end, rustup update works OK.

Steps

  1. manually delete "rust" directory inside ~\.rustup\toolchains\stable-x86_64-unknown-linux-gnu\share\doc
  2. run rustup update

Note: I‘m really not realized in the first time that deleting this directory will stop rustup from runing. Contents in the directory (share/doc/rust) are all API documents (.html) and license & readme files, and I just want to save space of my SSD.

Possible Solution(s)

Ignore "file/directory not exist" errors when removing (old) components, only print a warning, and go on running.

Notes

No response

Rustup version

rustup 1.25.2 (17db695f1 2023-02-01)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.67.1 (d5a82bbd2 2023-02-07)`


### Installed toolchains

```console
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/liigo/.rustup

stable-x86_64-unknown-linux-gnu (default)
rustc 1.67.1 (d5a82bbd2 2023-02-07)
@liigo liigo added the bug label Feb 22, 2023
@rbtcollins
Copy link
Contributor

rbtcollins commented Feb 23, 2023

Did you manually delete items from the toolchain directory? If so, consider using rustup component remove instead. Rustup is a package manager, and it keeps track of what files are expected.

That said, we should be more robust about dealing with corrupt content on disk. (Edited - I see the steps now)

@rbtcollins
Copy link
Contributor

I"m going to close this. The work for dealing with concurrent use and with corrupt contents (#2417) is sufficient I think

@rustdesk
Copy link

rustdesk commented Apr 1, 2024

rm -rf ~/.rustup # this is a must
rm -rf ~/.cargo
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

works for me.

@liigo
Copy link
Author

liigo commented Apr 16, 2024

still have this issue when update rust 1.77.2:

C:\Users\liigo>rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
714.8 KiB / 714.8 KiB (100 %) 495.4 KiB/s in  1s ETA:  0s
info: latest update on 2024-04-09, rust version 1.77.2 (25ef9e3d8 2024-04-09)
info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
 18.0 MiB /  18.0 MiB (100 %)   3.1 MiB/s in  6s ETA:  0s
info: downloading component 'rust-src'
info: downloading component 'cargo'
  6.3 MiB /   6.3 MiB (100 %)   3.0 MiB/s in  2s ETA:  0s
info: downloading component 'clippy'
  2.2 MiB /   2.2 MiB (100 %)   1.8 MiB/s in  1s ETA:  0s
info: downloading component 'rust-docs'
 14.9 MiB /  14.9 MiB (100 %)   3.6 MiB/s in  4s ETA:  0s
info: downloading component 'rust-std'
 18.2 MiB /  18.2 MiB (100 %)   3.8 MiB/s in  5s ETA:  0s
info: downloading component 'rustc'
 58.1 MiB /  58.1 MiB (100 %)   5.6 MiB/s in 13s ETA:  0s
info: downloading component 'rustfmt'
info: removing previous version of component 'rust-std' for 'wasm32-unknown-unknown'
info: removing previous version of component 'rust-src'
info: removing previous version of component 'cargo'
info: removing previous version of component 'clippy'
info: removing previous version of component 'rust-docs'
info: rolling back changes
error: failure removing component 'rust-docs-x86_64-pc-windows-msvc', directory does not exist: 'share/doc/rust/html'
info: checking for self-update

  stable-x86_64-pc-windows-msvc update failed - rustc 1.75.0 (82e1608df 2023-12-21)

info: cleaning up downloads & tmp directories

@rami3l
Copy link
Member

rami3l commented Apr 16, 2024

To clarify: this issue was not closed on resolution, but on duplication.

@rami3l rami3l closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants