Skip to content

"git commit" or just waiting a night results in bad stage2: "std compiled by an incompatible version of rustc" #43231

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
RalfJung opened this issue Jul 14, 2017 · 4 comments
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@RalfJung
Copy link
Member

RalfJung commented Jul 14, 2017

Steps to reproduce

  • Get a clean full build directory: ./x.py clean && ./x.py build
  • Do some edits src/librustc_mir
  • Do either git commit -a or wait until it is the next day
  • ./x.py build

Expected behavior

I should get a working compiler both in stage1 and stage2.

Actual behavior

The stage1 compiler is fine, but using the stage2 compiler results in

error[E0514]: found crate `std` compiled by an incompatible version of rustc
  |
  = help: please recompile that crate using this compiler (rustc 1.20.0-dev (2ea782c9b 2017-07-13))
  = note: crate `std` path #1: /home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_unicode-4a6846d7d8ce6979.rlib compiled by "rustc 1.20.0-dev (8a60e8605 2017-07-13)"
  = note: crate `std` path #2: /home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-8bdeae220109d9a1.rlib compiled by "rustc 1.20.0-dev (8a60e8605 2017-07-13)"
  = note: crate `std` path #3: /home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-8bdeae220109d9a1.so compiled by "rustc 1.20.0-dev (8a60e8605 2017-07-13)"

The fact that this also happens when waiting until the next day makes this particularly annoying, it means I have to remember to always do a full build of all stages when I did some patching some day.

Also, "git commit" cannot be entirely avoided when doing compiler development, not everything you do is one huge commit that you can commit and push after testing everything.

@RalfJung
Copy link
Member Author

@arielb1 suggested to do touch src/librustc_metadata/lib.rs && ./x.py build; I am trying this right now. Of course, this means I have to wait again for 20min.

@est31
Copy link
Member

est31 commented Jul 14, 2017

Known (and sadly old) bug: #39751

@alexcrichton alexcrichton added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jul 17, 2017
@est31
Copy link
Member

est31 commented Jul 27, 2017

@Mark-Simulacrum can this be closed? #39751 (comment)

@Mark-Simulacrum
Copy link
Member

Yep. Unfortunately it doesn't fix the problem of waiting to recompile after just making a commit, but there's no clear fix there -- I have some ideas, but nothing concrete yet, and I don't think we need to track it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

4 participants