Skip to content

Bootstrap fails to build in not completely clean environment #63964

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

Closed
jethrogb opened this issue Aug 27, 2019 · 8 comments
Closed

Bootstrap fails to build in not completely clean environment #63964

jethrogb opened this issue Aug 27, 2019 · 8 comments
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jethrogb
Copy link
Contributor

jethrogb commented Aug 27, 2019

  • git checkout 53df91a9b24ad999e7ca896447af6f5f74fe43bc (today's master)
  • make prepare
[...]
   Compiling bootstrap v0.0.0 (/home/jethro/projects/rust/src/bootstrap)
    Finished dev [unoptimized] target(s) in 7.16s

(success)

[...]
   Compiling bootstrap v0.0.0 (/home/jethro/projects/rust/src/bootstrap)
error: unnecessary `unsafe` block
   --> src/bootstrap/builder.rs:148:19
    |
148 |             name: unsafe { ::std::intrinsics::type_name::<S>() },
    |                   ^^^^^^ unnecessary `unsafe` block
    |
note: lint level defined here
   --> src/bootstrap/lib.rs:107:9
    |
107 | #![deny(warnings, rust_2018_idioms, unused_lifetimes)]
    |         ^^^^^^^^
    = note: `#[deny(unused_unsafe)]` implied by `#[deny(warnings)]`

[...]

(failure)

If I do rm -rf build/x86_64-unknown-linux-gnu/stage0, the second step works without issue.

Not sure what's going on, normally x.py is able to choose the stage0 compiler fine.

@jethrogb
Copy link
Contributor Author

If I build 72bfc37 first and then master, I get another error:

error: failed to parse lock file at: /home/jethro/projects/rust/Cargo.lock

Caused by:
  invalid serialized PackageId for key `package.dependencies`

@rustbot modify labels A-rustbuild C-bug

@jonas-schievink jonas-schievink added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-enhancement Category: An issue proposing an enhancement or a PR with one. C-bug Category: This is a bug. and removed C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Aug 27, 2019
@Mark-Simulacrum
Copy link
Member

The unsafe block warning looks purely like us not recompiling bootstrap after stage0 change (which is quite odd, since .. this hasn't been changed recently that I know of?)

I presume this is reproducible with a completely clean environment (rm -rf build) and x.py directly rather than via make prepare?

@jethrogb
Copy link
Contributor Author

@Mark-Simulacrum I think it is re-compiling bootstrap, but it's not using the right compiler to do so.

I presume this is reproducible with a completely clean environment (rm -rf build) and x.py directly rather than via make prepare?

Not sure what you mean by this. As mentioned, there is no build failure in a clean environment.

@Mark-Simulacrum
Copy link
Member

I meant prior to the first checkout, i.e., that this sequence fails. Could you post the full log in a gist as well? I'm particularly interested in the "downloading" lines.

git checkout 53df91a9b24ad999e7ca896447af6f5f74fe43bc
rm -rf build
x.py build nonexistent/path/to/trigger/cargo/metadata
git checkout 72bfc375356b56933955e07471f91ef97dceaa94
x.py build nonexistent/path/to/trigger/cargo/metadata # fails here w/ unsafe block error

@jethrogb
Copy link
Contributor Author

typescript.txt

@ehuss
Copy link
Contributor

ehuss commented Aug 27, 2019

I ran into this when preparing my beta PR.

I think the issue is that the beta branch has stage0.txt with date 2019-08-13 which is the same as master. The bootstrap.py seems to only check that the date is correct. beta's stage0 (1.37) has the same date as master's stage0 (1.38), it doesn't update stage0 (in program_out_of_date).

I think the check needs to include more than the date.

@Mark-Simulacrum
Copy link
Member

Ah, yeah! Thanks so much for tracking that down. We are indeed presumably not appropriately tracking that master/beta have the same date. An easy fix without changing the caching logic is to update to a non-dev stable release.

@Mark-Simulacrum
Copy link
Member

I'm going to go ahead and close this -- I think most of the underlying problems have been fixed now, and the issue itself is not tracking anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. 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