rust-lang / docker-rust-nightly

63 stars 30 forks source link

Error running "rustup update" #11

Closed LucasPickering closed 6 years ago

LucasPickering commented 6 years ago

I've been seeing this error appear when trying to run rustup update inside the image (this has been happening as long as I've been using the image - about a month now).

This is running on the latest version of the image (50ee35398401, from 2018-09-30 when I pulled).

root@0857abe10b0d:/# rustup -v update
verbose: read metadata version: '12'
verbose: updating existing install for 'nightly-x86_64-unknown-linux-gnu'
verbose: toolchain directory: '/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
verbose: creating temp file: /usr/local/rustup/tmp/ideb5e6zioxd0r2i_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256'
verbose: downloading with curl
verbose: deleted temp file: /usr/local/rustup/tmp/ideb5e6zioxd0r2i_file
verbose: creating temp file: /usr/local/rustup/tmp/zt3xqpfhqeh6r6v7_file.toml
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-nightly.toml'
verbose: downloading with curl
verbose: checksum passed
verbose: deleted temp file: /usr/local/rustup/tmp/zt3xqpfhqeh6r6v7_file.toml
info: latest update on 2018-10-01, rust version 1.31.0-nightly (fc403ad98 2018-09-30)
info: downloading component 'rustc'
verbose: downloading file from: 'https://static.rust-lang.org/dist/2018-10-01/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz'
verbose: downloading with curl
 76.3 MiB /  76.3 MiB (100 %)  15.2 MiB/s ETA:   0 s
verbose: checksum passed
info: downloading component 'rust-std'
verbose: downloading file from: 'https://static.rust-lang.org/dist/2018-10-01/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz'
verbose: downloading with curl
 52.6 MiB /  52.6 MiB (100 %)  15.7 MiB/s ETA:   0 s
verbose: checksum passed
info: downloading component 'cargo'
verbose: downloading file from: 'https://static.rust-lang.org/dist/2018-10-01/cargo-nightly-x86_64-unknown-linux-gnu.tar.xz'
verbose: downloading with curl
verbose: checksum passed
info: downloading component 'rust-docs'
verbose: downloading file from: 'https://static.rust-lang.org/dist/2018-10-01/rust-docs-nightly-x86_64-unknown-linux-gnu.tar.xz'
verbose: downloading with curl
verbose: checksum passed
info: removing component 'rustc'
verbose: creating temp file: /usr/local/rustup/tmp/16a798s3tm19ixfe_file
verbose: creating temp file: /usr/local/rustup/tmp/sbs5b4ors0ulhaf4_file
verbose: creating temp file: /usr/local/rustup/tmp/1daot2yjv3p7oc_c_file
verbose: creating temp file: /usr/local/rustup/tmp/9bz22gewd7zfn17z_file
verbose: creating temp file: /usr/local/rustup/tmp/od3x3bsm69n42n7z_file
verbose: creating temp file: /usr/local/rustup/tmp/edyk3ulkn58b715t_file
verbose: creating temp file: /usr/local/rustup/tmp/v3326kqat4i0ld0k_file
verbose: creating temp file: /usr/local/rustup/tmp/3arimcw74pcimd1c_file
verbose: creating temp file: /usr/local/rustup/tmp/5ptdgxrjr_h1ekol_file
verbose: creating temp file: /usr/local/rustup/tmp/tvi0n7_aop91b_j2_file
verbose: creating temp file: /usr/local/rustup/tmp/x1_3aqhhevxxete5_file
verbose: creating temp file: /usr/local/rustup/tmp/7wrsb2s7r4q486v0_file
verbose: creating temp file: /usr/local/rustup/tmp/4jxu451o2i2l4mqi_file
verbose: creating temp file: /usr/local/rustup/tmp/yb0ph2geha75jedd_file
verbose: creating temp file: /usr/local/rustup/tmp/v0yf9tifsvvn_7k5_file
verbose: creating temp file: /usr/local/rustup/tmp/_jf1a3rlj35a52ml_file
verbose: creating temp file: /usr/local/rustup/tmp/jcb4ynlar_1vean4_file
verbose: creating temp file: /usr/local/rustup/tmp/0yk8kpg7gi3tlom0_file
verbose: creating temp file: /usr/local/rustup/tmp/tx75pll71xke5ps8_file
verbose: creating temp file: /usr/local/rustup/tmp/cj43nvspz1mxaqmm_file
verbose: creating temp file: /usr/local/rustup/tmp/b3zztds2n23r7c3d_file
verbose: creating temp file: /usr/local/rustup/tmp/b6hbcfnhsmrqtzpd_file
verbose: creating temp file: /usr/local/rustup/tmp/v6frtr7bkw0q7vvq_file
verbose: creating temp file: /usr/local/rustup/tmp/biw706g1i2owqvfk_file
verbose: creating temp file: /usr/local/rustup/tmp/ydzblqkuh_saysr7_file
verbose: creating temp file: /usr/local/rustup/tmp/hpfn7a156uzqudzy_file
verbose: creating temp file: /usr/local/rustup/tmp/f8s9fl7q83cy6y3f_file
verbose: creating temp file: /usr/local/rustup/tmp/80nf8d1_j4disjb__file
verbose: creating temp file: /usr/local/rustup/tmp/bmk_jd9jubwc48ve_file
verbose: creating temp file: /usr/local/rustup/tmp/emvds2hfla1q69pm_file
verbose: creating temp file: /usr/local/rustup/tmp/6g7mznpapwzur3b0_file
verbose: creating temp file: /usr/local/rustup/tmp/6nofgteey6jtwqd0_file
verbose: creating temp file: /usr/local/rustup/tmp/eazzwf0yxv6adazs_file
verbose: creating temp file: /usr/local/rustup/tmp/nkyemij8bjb2kc_e_file
verbose: creating temp file: /usr/local/rustup/tmp/td9elbqmj3mzcqkr_file
verbose: creating temp file: /usr/local/rustup/tmp/x_fn5zz69988r7u7_file
verbose: creating temp file: /usr/local/rustup/tmp/b2d0m5s7twa9usaf_file
verbose: creating temp file: /usr/local/rustup/tmp/5x1xhyd7bwl6mqjz_file
verbose: creating temp file: /usr/local/rustup/tmp/xyuvmicnxhoq1ta__file
verbose: creating temp file: /usr/local/rustup/tmp/guph6c9nrdf4ahb4_file
verbose: creating temp file: /usr/local/rustup/tmp/l8bv5u84ems25_b1_file
verbose: creating temp file: /usr/local/rustup/tmp/ovzedn9p_9ziwkyr_file
verbose: creating temp file: /usr/local/rustup/tmp/k7us0txzghghsdjl_file
verbose: creating temp file: /usr/local/rustup/tmp/9v6kqkf0v308q0s2_file
verbose: creating temp file: /usr/local/rustup/tmp/p7r6zgcgpwh_mxbb_file
verbose: creating temp file: /usr/local/rustup/tmp/gpgn4m7qazm2a7nd_file
verbose: creating temp file: /usr/local/rustup/tmp/u8s7pubx404yrr3k_file
verbose: creating temp file: /usr/local/rustup/tmp/fy0g6_la7ommedra_file
verbose: creating temp file: /usr/local/rustup/tmp/bs2byook4dlwtcpl_file
verbose: creating temp file: /usr/local/rustup/tmp/rqm8d_9l3mjz9ucz_file
verbose: creating temp file: /usr/local/rustup/tmp/7srojuemjo7rov93_file
verbose: creating temp file: /usr/local/rustup/tmp/8z9ph64z3__6t48v_file
verbose: creating temp file: /usr/local/rustup/tmp/i3qvxh7zbou3d1ig_file
verbose: creating temp file: /usr/local/rustup/tmp/1kftgiqerhoqasmw_file
verbose: creating temp directory: /usr/local/rustup/tmp/kcosnjf7w9h7_i2r_dir
verbose: deleted temp directory: /usr/local/rustup/tmp/kcosnjf7w9h7_i2r_dir
info: rolling back changes
error: could not rename component file from '/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends' to '/usr/local/rustup/tmp/kcosnjf7w9h7_i2r_dir/bk'
info: checking for self-updates

  nightly-x86_64-unknown-linux-gnu update failed - rustc 1.30.0-nightly (bb0896af1 2018-09-29)

root@0857abe10b0d:/#
sfackler commented 6 years ago

This is the failing system call:

rename("/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/etc", "/usr/local/rustup/tmp/i6j4hyab3re29l9q_dir/bk") = -1 EXDEV (Invalid cross-device link)

It looks like rustup assumes that the rustup directory is the same filesystem which won't be the case in this image since parts of it are on a different layer. I'll file an issue upstream with rustup to fall back to copying if renaming fails.

sfackler commented 6 years ago

Ah, this has already been filed: https://github.com/rust-lang-nursery/rustup.rs/issues/1239.

I'm going go close this in favor of that issue!

LucasPickering commented 6 years ago

Great, thanks for finding that!

monkut commented 3 years ago

Had the same problem when calling rustup update on a separate row/RUN when building in docker. Including rustup update on the same row seemed to resolve the issue:

RUN curl --proto '=https' --tlsv1.2 -sSf curl https://sh.rustup.rs | sh -s -- -y && source $HOME/.cargo/env && rustup update