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

Possible race condition when adding target while updating with rustup #1348

Closed
spease opened this issue Jan 28, 2018 · 1 comment
Closed

Comments

@spease
Copy link

spease commented Jan 28, 2018

The armv7-unknown-linux-gnueabihf target didn't initially exist, and I wanted to cross-compile a crate.

In one terminal window, I did
rustup update

In another terminal window, I did
rustup target add armv7-unknown-linux-gnueabihf

When both had completed, I attempted
cargo build --target=armv7-unknown-linux-gnueabihf

Resulting in

   Compiling trigger v0.1.0 (file:///home/spease/projects/carlos/trigger)
error[E0514]: found crate `std` compiled by an incompatible version of rustc
  |
  = help: please recompile that crate using this compiler (rustc 1.23.0 (766bd11c8 2018-01-01))
  = note: crate `std` path #1: /home/spease/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libstd-827ddea93328ae2d.rlib compiled by "rustc 1.22.1 (05e2e1c41 2017-11-22)"
  = note: crate `std` path #2: /home/spease/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libstd-827ddea93328ae2d.so compiled by "rustc 1.22.1 (05e2e1c41 2017-11-22)"
  = note: crate `std` path #3: /home/spease/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libstd_unicode-0e1b544c94586415.rlib compiled by "rustc 1.22.1 (05e2e1c41 2017-11-22)"

error: aborting due to previous error

error: Could not compile `trigger`.

Interestingly enough, it wasn't included in the list of available targets or components either even though it seemed to install successfully.

Trying to re-add it gave the following output:

info: downloading component 'rust-std' for 'armv7-unknown-linux-gnueabihf'
info: installing component 'rust-std' for 'armv7-unknown-linux-gnueabihf'
info: rolling back changes
error: failed to install component: 'rust-std-armv7-unknown-linux-gnueabihf', detected conflict: '"lib/rustlib/manifest-rust-std-armv7-unknown-linux-gnueabihf"'

Eventually I was able to reinstall after renaming
~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rust-std-armv7-unknown-linux-gnueabihf

At this point everything seems to work correctly. However my understanding was that rustup / cargo are generally supposed to be safe via a locking mechanism? Or is this just cargo?

@Diggsey
Copy link
Contributor

Diggsey commented May 28, 2018

Dup of #988

@Diggsey Diggsey closed this as completed May 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants