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

error[E0514]: found crate cfg_if compiled by an incompatible version of rustc #560

Closed
SimonSapin opened this issue Oct 24, 2019 · 5 comments

Comments

@SimonSapin
Copy link

After successfully trying distributed compilation of Firefox with the Mozilla Paris office’s scheduler, I tried it in Servo with: RUSTC_WRAPPER=sccache ./mach build. I got this error:

error[E0514]: found crate `cfg_if` compiled by an incompatible version of rustc
   --> /home/simon/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.6/src/lib.rs:287:1
    |
287 | extern crate cfg_if;
    | ^^^^^^^^^^^^^^^^^^^^
    |
    = help: please recompile that crate using this compiler (rustc 1.40.0-nightly (084beb83e 2019-09-27))
    = note: the following crate versions were found:
            crate `cfg_if` compiled by rustc 1.38.0 (625451e37 2019-09-23): /home/simon/servo/target/release/deps/libcfg_if-6004528ebb94eeba.rmeta

Unfortunately, I did not manage to find reliable steps to reproduce.

Are there known situations where sccache could re-use a cached output file that was built by a different version of rustc?

@SimonSapin
Copy link
Author

Maybe a duplicate of #454?

@chmanchester
Copy link
Contributor

@SimonSapin this is most likely #554, moving between projects using different rustc's would be particularly difficult due to that, unfortunately.

@SimonSapin
Copy link
Author

Thanks for the link! This may actually be #87 (linked from #554), since the rustc in $PATH is not the actual compiler but rustup’s proxy executable that can invoke different compiler versions based on various inputs.

@chmanchester
Copy link
Contributor

Closing in favor of #87

@mstange
Copy link
Contributor

mstange commented Sep 15, 2020

(For the benefit of people like me who end up here from a Google search:)

There's another way to hit errors like these with distributed sccache: When distributing compilations from a Windows or macOS client with an explicit toolchain archive that gets distributed to the Linux builders, the rust versions in the toolchain archive must match the rust version of the host compiler. If not, sccache does not detect the version mismatch and you run into errors like the one in this issue. See also bug 1664963.

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