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

switching from stable to nightly causes compiler version mismatch #663

Closed
drahnr opened this issue Feb 12, 2020 · 4 comments
Closed

switching from stable to nightly causes compiler version mismatch #663

drahnr opened this issue Feb 12, 2020 · 4 comments

Comments

@drahnr
Copy link
Collaborator

drahnr commented Feb 12, 2020

Compiling https://github.com/wisespace-io/u2f-rs
accidentally with cargo +stable build followed by cargo +nightly build consistently gives:

error[E0514]: found crate `autocfg` compiled by an incompatible version of rustc
 --> /home/bernhard/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/num-traits-0.2.11/build.rs:1:1
  |
1 | extern crate autocfg;
  | ^^^^^^^^^^^^^^^^^^^^^
  |
  = help: please recompile that crate using this compiler (rustc 1.43.0-nightly (58b834344 2020-02-05))
  = note: the following crate versions were found:
          crate `autocfg` compiled by rustc 1.41.0 (5e1a79984 2020-01-27): /home/bernhard/Projects/u2f-rs/example/target/debug/deps/libautocfg-65a01c47eff2b1b4.rlib

error[E0514]: found crate `version_check` compiled by an incompatible version of rustc
 --> /home/bernhard/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/unicase-1.4.2/build.rs:1:1
  |
1 | extern crate version_check as rustc;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: please recompile that crate using this compiler (rustc 1.43.0-nightly (58b834344 2020-02-05))
  = note: the following crate versions were found:
          crate `version_check` compiled by rustc 1.41.0 (5e1a79984 2020-01-27): /home/bernhard/Projects/u2f-rs/example/target/debug/deps/libversion_check-c40121d46ce38ebb.rlib

error: aborting due to previous error

error[E0514]: found crate `yansi` compiled by an incompatible version of rustc
 --> /home/bernhard/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rocket_codegen-0.4.2/build.rs:3:1
  |
3 | extern crate yansi;
  | ^^^^^^^^^^^^^^^^^^^
  |
  = help: please recompile that crate using this compiler (rustc 1.43.0-nightly (58b834344 2020-02-05))
  = note: the following crate versions were found:
          crate `yansi` compiled by rustc 1.41.0 (5e1a79984 2020-01-27): /home/bernhard/Projects/u2f-rs/example/target/debug/deps/libyansi-94170d1d29303cf0.rlib

error[E0514]: found crate `autocfg` compiled by an incompatible version of rustc
 --> /home/bernhard/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/openssl-sys-0.9.54/build/main.rs:1:1
  |
1 | extern crate autocfg;
  | ^^^^^^^^^^^^^^^^^^^^^
  |
  = help: please recompile that crate using this compiler (rustc 1.43.0-nightly (58b834344 2020-02-05))
  = note: the following crate versions were found:
          crate `autocfg` compiled by rustc 1.41.0 (5e1a79984 2020-01-27): /home/bernhard/Projects/u2f-rs/example/target/debug/deps/libautocfg-65a01c47eff2b1b4.rlib

error: aborting due to previous error

error: aborting due to previous error

error[E0514]: found crate `cc` compiled by an incompatible version of rustc
  --> /home/bernhard/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/ring-0.13.5/build.rs:36:1
   |
36 | extern crate cc;
   | ^^^^^^^^^^^^^^^^
   |
   = help: please recompile that crate using this compiler (rustc 1.43.0-nightly (58b834344 2020-02-05))
   = note: the following crate versions were found:
           crate `cc` compiled by rustc 1.41.0 (5e1a79984 2020-01-27): /home/bernhard/Projects/u2f-rs/example/target/debug/deps/libcc-a44f11a1bf26316e.rlib

error: aborting due to previous error

error: aborting due to previous error

error[E0514]: found crate `yansi` compiled by an incompatible version of rustc
 --> /home/bernhard/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/pear_codegen-0.1.2/build.rs:1:1
  |
1 | extern crate yansi;
  | ^^^^^^^^^^^^^^^^^^^
  |
  = help: please recompile that crate using this compiler (rustc 1.43.0-nightly (58b834344 2020-02-05))
  = note: the following crate versions were found:
          crate `yansi` compiled by rustc 1.41.0 (5e1a79984 2020-01-27): /home/bernhard/Projects/u2f-rs/example/target/debug/deps/libyansi-c82656b56c0bde2d.rlib

error: aborting due to previous error

error: could not compile `rocket_codegen`.
warning: build failed, waiting for other jobs to finish...
error[E0514]: found crate `autocfg` compiled by an incompatible version of rustc
 --> /home/bernhard/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/indexmap-1.3.2/build.rs:1:1
  |
1 | extern crate autocfg;
  | ^^^^^^^^^^^^^^^^^^^^^
  |
  = help: please recompile that crate using this compiler (rustc 1.43.0-nightly (58b834344 2020-02-05))
  = note: the following crate versions were found:
          crate `autocfg` compiled by rustc 1.41.0 (5e1a79984 2020-01-27): /home/bernhard/Projects/u2f-rs/example/target/debug/deps/libautocfg-65a01c47eff2b1b4.rlib

error: could not compile `num-traits`.
warning: build failed, waiting for other jobs to finish...
error: could not compile `unicase`.
warning: build failed, waiting for other jobs to finish...
error: aborting due to previous error

error[E0514]: found crate `autocfg` compiled by an incompatible version of rustc
 --> /home/bernhard/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/num-integer-0.1.42/build.rs:1:1
  |
1 | extern crate autocfg;
  | ^^^^^^^^^^^^^^^^^^^^^
  |
  = help: please recompile that crate using this compiler (rustc 1.43.0-nightly (58b834344 2020-02-05))
  = note: the following crate versions were found:
          crate `autocfg` compiled by rustc 1.41.0 (5e1a79984 2020-01-27): /home/bernhard/Projects/u2f-rs/example/target/debug/deps/libautocfg-65a01c47eff2b1b4.rlib

error: could not compile `openssl-sys`.
warning: build failed, waiting for other jobs to finish...
error: aborting due to previous error

error[E0514]: found crate `yansi` compiled by an incompatible version of rustc
 --> /home/bernhard/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rocket-0.4.2/build.rs:3:1
  |
3 | extern crate yansi;
  | ^^^^^^^^^^^^^^^^^^^
  |
  = help: please recompile that crate using this compiler (rustc 1.43.0-nightly (58b834344 2020-02-05))
  = note: the following crate versions were found:
          crate `yansi` compiled by rustc 1.41.0 (5e1a79984 2020-01-27): /home/bernhard/Projects/u2f-rs/example/target/debug/deps/libyansi-94170d1d29303cf0.rlib

error: aborting due to previous error

error: could not compile `pear_codegen`.
warning: build failed, waiting for other jobs to finish...
error: could not compile `ring`.
warning: build failed, waiting for other jobs to finish...
error: could not compile `num-integer`.
warning: build failed, waiting for other jobs to finish...
error: could not compile `indexmap`.
warning: build failed, waiting for other jobs to finish...
error: could not compile `rocket`.
warning: build failed, waiting for other jobs to finish...
error[E0514]: found crate `cfg_if` compiled by an incompatible version of rustc
   --> /home/bernhard/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/log-0.4.8/src/lib.rs:284:1
    |
284 | extern crate cfg_if;
    | ^^^^^^^^^^^^^^^^^^^^
    |
    = help: please recompile that crate using this compiler (rustc 1.43.0-nightly (58b834344 2020-02-05))
    = note: the following crate versions were found:
            crate `cfg_if` compiled by rustc 1.41.0 (5e1a79984 2020-01-27): /home/bernhard/Projects/u2f-rs/example/target/debug/deps/libcfg_if-3870ce3f32a9348c.rmeta

error: aborting due to previous error

error: could not compile `log`.
warning: build failed, waiting for other jobs to finish...
error[E0514]: found crate `unicode_xid` compiled by an incompatible version of rustc
  --> /home/bernhard/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/proc-macro2-0.4.30/src/lib.rs:88:1
   |
88 | extern crate unicode_xid;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: please recompile that crate using this compiler (rustc 1.43.0-nightly (58b834344 2020-02-05))
   = note: the following crate versions were found:
           crate `unicode_xid` compiled by rustc 1.41.0 (5e1a79984 2020-01-27): /home/bernhard/Projects/u2f-rs/example/target/debug/deps/libunicode_xid-fd70fbf6e9195813.rmeta

error: aborting due to previous error

error: could not compile `proc-macro2`.
warning: build failed, waiting for other jobs to finish...
error[E0514]: found crate `foreign_types_shared` compiled by an incompatible version of rustc
   --> /home/bernhard/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/foreign-types-0.3.2/src/lib.rs:181:1
    |
181 | extern crate foreign_types_shared;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: please recompile that crate using this compiler (rustc 1.43.0-nightly (58b834344 2020-02-05))
    = note: the following crate versions were found:
            crate `foreign_types_shared` compiled by rustc 1.41.0 (5e1a79984 2020-01-27): /home/bernhard/Projects/u2f-rs/example/target/debug/deps/libforeign_types_shared-59a8d0e5c1b75bb4.rmeta

error: aborting due to previous error

error: could not compile `foreign-types`.
warning: build failed, waiting for other jobs to finish...
error[E0514]: found crate `matches` compiled by an incompatible version of rustc
  --> /home/bernhard/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/unicode-bidi-0.3.4/src/lib.rs:65:1
   |
65 | extern crate matches;
   | ^^^^^^^^^^^^^^^^^^^^^
   |
   = help: please recompile that crate using this compiler (rustc 1.43.0-nightly (58b834344 2020-02-05))
   = note: the following crate versions were found:
           crate `matches` compiled by rustc 1.41.0 (5e1a79984 2020-01-27): /home/bernhard/Projects/u2f-rs/example/target/debug/deps/libmatches-67ead5aec7e2754f.rmeta

error: aborting due to previous error

error: could not compile `unicode-bidi`.
warning: build failed, waiting for other jobs to finish...
error[E0514]: found crate `same_file` compiled by an incompatible version of rustc
   --> /home/bernhard/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/walkdir-2.3.1/src/lib.rs:120:5
    |
120 | use same_file::Handle;
    |     ^^^^^^^^^
    |
    = help: please recompile that crate using this compiler (rustc 1.43.0-nightly (58b834344 2020-02-05))
    = note: the following crate versions were found:
            crate `same_file` compiled by rustc 1.41.0 (5e1a79984 2020-01-27): /home/bernhard/Projects/u2f-rs/example/target/debug/deps/libsame_file-e3096f16f9f7f776.rmeta

error: aborting due to previous error

error: could not compile `walkdir`.
warning: build failed, waiting for other jobs to finish...
error[E0514]: found crate `smallvec` compiled by an incompatible version of rustc
  --> /home/bernhard/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/unicode-normalization-0.1.12/src/lib.rs:44:1
   |
44 | extern crate smallvec;
   | ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: please recompile that crate using this compiler (rustc 1.43.0-nightly (58b834344 2020-02-05))
   = note: the following crate versions were found:
           crate `smallvec` compiled by rustc 1.41.0 (5e1a79984 2020-01-27): /home/bernhard/Projects/u2f-rs/example/target/debug/deps/libsmallvec-8787173a1221911e.rmeta

error: aborting due to previous error

error: could not compile `unicode-normalization`.
warning: build failed, waiting for other jobs to finish...
error: build failed

Expected:

Graceful expunging cache entries OR being able to distinguish between compiler versions as part of the key.

Backend:
redis
dist-client/dist-server

@drahnr
Copy link
Collaborator Author

drahnr commented Feb 12, 2020

The missversioned files afterwards exist in the target/debug dir and unset RUSTC_WRAPPER does not solve the compilation, but makes a manual rm -rf target/debug necessary.

@luser
Copy link
Contributor

luser commented Feb 12, 2020

I believe this is a dupe of #87. Unfortunately sccache currently caches compiler information in memory in the server process using the compiler path and mtime as the key. When using rustup the rustc binary is a shim that selects the real compiler version to use and this shim very rarely changes so updating the underlying Rust toolchain will go unnoticed by sccache.

@drahnr
Copy link
Collaborator Author

drahnr commented Feb 12, 2020

But that means, if i.e. redis is running in RLU mode and artefacts from compiler version A can indefinitely make the system corrupted / unusable while everybody already updated to version B.
I think it is rather common to have a set of developers with a non homogeneous set of compiler versions, all accessing the same cache.
Could be duplicate of #87 indeed.

@froydnj
Copy link
Contributor

froydnj commented Feb 12, 2020

I'm going to close this as a dup of #87. I agree that the underlying issue makes a shared compilation cache very difficult, but given that determining the actual underlying binary is hard, and the underlying binary isn't fixed because of toolchain overrides that crates can specify, I'm not sure how to fix it. Firefox has fixed it by resolving the "real" rustc prior to invoking cargo and ignoring toolchain overrides, but I understand that's not feasible for everybody.

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

3 participants