Skip to content

bootstrap uses downloaded rustc despite lockfile changes #142338

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
RalfJung opened this issue Jun 11, 2025 · 5 comments · Fixed by #142344
Closed

bootstrap uses downloaded rustc despite lockfile changes #142338

RalfJung opened this issue Jun 11, 2025 · 5 comments · Fixed by #142344
Labels
A-download-rustc Area: The `rust.download-rustc` build option. C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@RalfJung
Copy link
Member

I have run cargo update -p rustc_apfloat to link a newer apfloat into Miri. download-rustc is set to "if-unchanged". However, it seems bootstrap doesn't consider this to "change" rustc: ./x test miri still uses the downloaded rustc, leading to test failures since I didn't get the newer apfloat I was hoping for.

Does bootstrap somehow have the lockfile on the list of files it can ignore for download-rustc? That would not make sense, would it?

Cc @onur-ozkan

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 11, 2025
@onur-ozkan
Copy link
Member

Cargo.lock was added to the allowlist to avoid invalidating download-rustc when making dependency changes in the library tree. Would doing this only on the library profile solve your problem?

@onur-ozkan onur-ozkan added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-download-rustc Area: The `rust.download-rustc` build option. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 11, 2025
@RalfJung
Copy link
Member Author

RalfJung commented Jun 11, 2025

I think it is a pretty severe bug for "if-unchanged" to ever be wrong, no matter the profile. Correctness is more important than performance. If I have to debug "if-unchanged" issues any time something odd happens, it doesn't actually save time. It is pure luck that it only took me ~10min to realize that it was using the wrong version of the crate that I just updated, this could have easily been an hour-long debugging session!

Please do not ever add anything to the allowlist that could possibly influence the compiler build. This is crucial. If we don't have reliable foundations for building rustc, how are we supposed to build a reliable compiler?

Also, the library anyway has its own lockfile these days.

@onur-ozkan
Copy link
Member

I thought that would be pretty rare case to update dependencies of compiler without touching on compiler tree but yeah, that was a mistake; we shouldn't add that to the allow list.

Also, the library anyway has its own lockfile these days.

My bad, it was src/librustdoc. Maybe they should have separate Cargo.lock files too. I will raise this on Zulip later today. Feel free to revert #142232.

@RalfJung
Copy link
Member Author

RalfJung commented Jun 11, 2025 via email

@Kobzol
Copy link
Contributor

Kobzol commented Jun 11, 2025

Posted a revert here: #142344

@jieyouxu jieyouxu added the C-bug Category: This is a bug. label Jun 11, 2025
@bors bors closed this as completed in f77bb1b Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-download-rustc Area: The `rust.download-rustc` build option. 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

Successfully merging a pull request may close this issue.

5 participants