rustup: Fails on update toolchain

Disclaimer

Running rustup self update after manually updating the toolchaing fixed everything

Rustup version

rustup 0.4.0 (3171903 2016-07-22)

Toolchains

Default host: x86_64-unknown-linux-gnu

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)

active toolchain
----------------

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.12.0-nightly (936bfea94 2016-07-20)

Expected

Runing rustup update updates both the toolchains

Actual

info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: downloading component 'rustc'
 43.3 MiB /  43.3 MiB (100 %) 259.2 KiB/s ETA:   0 s                
info: downloading component 'rust-std'
 55.8 MiB /  55.8 MiB (100 %) 188.8 KiB/s ETA:   0 s                
info: downloading component 'rust-docs'
  7.2 MiB /   7.2 MiB (100 %) 172.8 KiB/s ETA:   0 s                
info: downloading component 'cargo'
  4.1 MiB /   4.1 MiB (100 %) 288.0 KiB/s ETA:   0 s                
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'rust-docs'
info: installing component 'cargo'
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: downloading component 'rustc'
 49.0 MiB /  49.0 MiB (100 %) 188.8 KiB/s ETA:   0 s                
info: downloading component 'rust-std'
 61.9 MiB /  61.9 MiB (100 %) 140.8 KiB/s ETA:   0 s                       
info: downloading component 'rust-docs'
  8.4 MiB /   8.4 MiB (100 %) 259.2 KiB/s ETA:   0 s                 
info: downloading component 'cargo'
  4.2 MiB /   4.2 MiB (100 %) 224.0 KiB/s ETA:   0 s                
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'rust-docs'
info: installing component 'cargo'
info: checking for self-updates
info: downloading self-update
error: failed to set permissions for '/home/edoput/.cargo/bin/rustup-init'
info: caused by: No such file or directory (os error 2)

In ~/.cargo/bin/rustup the executable files are not updated

ls -al  ~/.cargo/bin/
totale 52280
drwxr-xr-x 2 edoput sudo    4096 ago 21 12:49 .
drwxr-xr-x 5 edoput sudo    4096 lug 22 16:45 ..
-rwxr-xr-x 6 edoput sudo 8918368 lug 23 13:51 cargo
-rwxr-xr-x 6 edoput sudo 8918368 lug 23 13:51 rustc
-rwxr-xr-x 6 edoput sudo 8918368 lug 23 13:51 rustdoc
-rwxr-xr-x 6 edoput sudo 8918368 lug 23 13:51 rust-gdb
-rwxr-xr-x 6 edoput sudo 8918368 lug 23 13:51 rust-lldb
-rwxr-xr-x 6 edoput sudo 8918368 lug 23 13:51 rustup

Running rustup show

Default host: x86_64-unknown-linux-gnu

thread '<main>' panicked at 'extension should have target toolchain', ../src/libcore/option.rs:699

running rustup show with backtrace

stack backtrace:
   1:     0x557072873f70 - std::sys::backtrace::tracing::imp::write::h9fb600083204ae7f
   2:     0x55707287c20b - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::hca543c34f11229ac
   3:     0x55707287be93 - std::panicking::default_hook::hc2c969e7453d080c
   4:     0x55707286026f - std::sys_common::unwind::begin_unwind_inner::h30e12d15ce2b2e25
   5:     0x557072861bf8 - std::sys_common::unwind::begin_unwind_fmt::hb2de8a9968d38523
   6:     0x557072873331 - rust_begin_unwind
   7:     0x5570728b26af - core::panicking::panic_fmt::h257ceb0aa351d801
   8:     0x5570728b9964 - core::option::expect_failed::h2d57a5644f345e0b
   9:     0x557072515497 - rustup::toolchain::Toolchain::list_components::h6f5e5af7ff496961
  10:     0x557072454644 - rustup_init::rustup_mode::show::hd748b4cc3a400485
  11:     0x55707242c66f - rustup_init::rustup_mode::main::h904c4ed7acbad99d
  12:     0x55707242837e - rustup_init::run_multirust::h70cbf6663515e18b
  13:     0x5570724274e1 - rustup_init::main::h81d74e5ca7cf36c2
  14:     0x55707287bad4 - std::sys_common::unwind::try::try_fn::h04c0c89e4add6cc4
  15:     0x5570728732bb - __rust_try
  16:     0x55707287b51b - std::rt::lang_start::h61f4934e780b4dfc
  17:     0x7f99a09ca72f - __libc_start_main
  18:     0x5570724273d4 - <unknown>

More

Running rustup update stable or rustup update nightly works without panic.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

I hit this going to 1.5.0. I immediately ran rustup self update and that succeeded.

$ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'beta-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2017-06-28, rust version 1.20.0-nightly (f590a44ce 2017-06-27)
info: downloading component 'rustc'
 38.7 MiB /  38.7 MiB (100 %)   3.1 MiB/s ETA:   0 s                
info: downloading component 'rust-std'
 57.6 MiB /  57.6 MiB (100 %)   3.2 MiB/s ETA:   0 s                
info: downloading component 'cargo'
  3.7 MiB /   3.7 MiB (100 %)   3.2 MiB/s ETA:   0 s                
info: downloading component 'rust-docs'
  3.6 MiB /   3.6 MiB (100 %)   3.0 MiB/s ETA:   0 s                
info: downloading component 'rust-std' for 'x86_64-unknown-linux-musl'
 11.6 MiB /  11.6 MiB (100 %)   3.1 MiB/s ETA:   0 s                
info: downloading component 'rust-src'
info: removing component 'rustc'
info: removing component 'rust-std'
info: removing component 'cargo'
info: removing component 'rust-docs'
info: removing component 'rust-std' for 'x86_64-unknown-linux-musl'
info: removing component 'rust-src'
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'
info: installing component 'rust-std' for 'x86_64-unknown-linux-musl'
info: installing component 'rust-src'
info: checking for self-updates
info: downloading self-update
error: failed to set permissions for '/home/david/.cargo/bin/rustup-init'
info: caused by: No such file or directory (os error 2)

$ rustup self update
info: checking for self-updates
info: downloading self-update
info: rustup updated successfully to 1.5.0

Running into this again with the latest update.

The workarounds mentioned in my post above (touch .cargo/bin/rustup-init; chmod +x .cargo/bin/rustup-init) no longer work.

rustup show and other rustup commands work correctly. It’s only rustup update self (and rustup update’ self portion) which error.


Update: running rustup self update once did not work. Running it a second time did work…

$ rustup self update
info: checking for self-updates
info: downloading self-update
error: failed to set permissions for '/home/daboross/.cargo/bin/rustup-init'
info: caused by: No such file or directory (os error 2)
$ RUST_LOG=debug rustup self update
info: checking for self-updates
info: downloading self-update
info: rustup updated successfully to 1.13.0

strace would be a good tool to find out what is going on…

This is occurring again on my system - not sure if it’s related to the original failure. Running rustup self update afterwards or repeatedly doesn’t seem to help it. It keeps failing with:

$ rustup self update       
info: checking for self-updates
info: downloading self-update
error: failed to set permissions for '/home/daboross/.cargo/bin/rustup-init'
info: caused by: No such file or directory (os error 2)

As it says, there is no .cargo/bin/rustup-init file. If I create it with touch, rustup will delete it, then error with the same message.

It was fixed by doing both touch .cargo/bin/rustup-init; and chmod +x .cargo/bin/rustup-init. I’m… not sure why, maybe then it didn’t try to change permissions?

Exactly the same here (upgrading to 1.4.0). Also same error in log as above.