-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Consistently unset RUSTC_BOOTSTRAP when compiling bootstrap #120001
Conversation
r? @clubby789 (rustbot has picked a reviewer for you, use r? to override) |
5f0245c
to
ee370a1
Compare
@bors r+ |
@bors rollup |
…-ozkan Consistently unset RUSTC_BOOTSTRAP when compiling bootstrap Since rust-lang#113906, all x.py invocations performed by rust-analyzer have RUSTC_BOOTSTRAP=1 set. This was to fix rust-lang#112391 (comment) — rust-analyzer uses some default cargo from the system when fetching workspace layout, and the standard library uses some unstable cargo feature, so x.py would previously fail if the system toolchain wasn't nightly. https://github.com/rust-lang/rust/blob/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/Cargo.toml#L1 This PR changes x.py to cancel out this RUSTC_BOOTSTRAP=1 when compiling bootstrap. It will only remain set when running the compiled bootstrap executable. This fixes spurious bootstrap rebuilds in the event that a rust-analyzer x.py invocation is alternated with someone running x.py themself on the command line, if any dependency of bootstrap looks at `option_env!("RUSTC_BOOTSTRAP")`, which is the case since rust-lang#119654. **Before:** ```console $ RUSTC_BOOTSTRAP=1 ./x.py check library/core Building bootstrap Compiling proc-macro2 v1.0.76 Compiling quote v1.0.35 Compiling syn v2.0.48 Compiling clap_derive v4.4.7 Compiling serde_derive v1.0.195 Compiling clap v4.4.13 Compiling clap_complete v4.4.6 Compiling build_helper v0.1.0 Compiling bootstrap v0.0.0 Finished dev [unoptimized] target(s) in 6.31s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.23s Build completed successfully in 0:00:07 $ ./x.py check library/core Building bootstrap Compiling proc-macro2 v1.0.76 Compiling quote v1.0.35 Compiling syn v2.0.48 Compiling clap_derive v4.4.7 Compiling serde_derive v1.0.195 Compiling clap v4.4.13 Compiling clap_complete v4.4.6 Compiling build_helper v0.1.0 Compiling bootstrap v0.0.0 Finished dev [unoptimized] target(s) in 5.30s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.25s Build completed successfully in 0:00:06 ``` **After:** ```console $ RUSTC_BOOTSTRAP=1 ./x.py check library/core Building bootstrap Finished dev [unoptimized] target(s) in 0.06s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.14s Build completed successfully in 0:00:01 $ ./x.py check library/core Building bootstrap Finished dev [unoptimized] target(s) in 0.04s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.13s Build completed successfully in 0:00:01 ```
…mpiler-errors Rollup of 9 pull requests Successful merges: - rust-lang#115291 (Save liveness results for DestinationPropagation) - rust-lang#119651 (proc_macro: Add Literal::c_string constructor) - rust-lang#119855 (Enable Static Builds for FreeBSD) - rust-lang#119955 (Modify GenericArg and Term structs to use strict provenance rules) - rust-lang#119975 (Don't ICE if TAIT-defining fn contains a closure with `_` in return type) - rust-lang#119984 (Change return type of unstable `Waker::noop()` from `Waker` to `&Waker`.) - rust-lang#120001 (Consistently unset RUSTC_BOOTSTRAP when compiling bootstrap) - rust-lang#120020 (Gracefully handle missing typeck information if typeck errored) - rust-lang#120032 (Fix `rustc_abi` build on stable) r? `@ghost` `@rustbot` modify labels: rollup
…-ozkan Consistently unset RUSTC_BOOTSTRAP when compiling bootstrap Since rust-lang#113906, all x.py invocations performed by rust-analyzer have RUSTC_BOOTSTRAP=1 set. This was to fix rust-lang#112391 (comment) — rust-analyzer uses some default cargo from the system when fetching workspace layout, and the standard library uses some unstable cargo feature, so x.py would previously fail if the system toolchain wasn't nightly. https://github.com/rust-lang/rust/blob/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/Cargo.toml#L1 This PR changes x.py to cancel out this RUSTC_BOOTSTRAP=1 when compiling bootstrap. It will only remain set when running the compiled bootstrap executable. This fixes spurious bootstrap rebuilds in the event that a rust-analyzer x.py invocation is alternated with someone running x.py themself on the command line, if any dependency of bootstrap looks at `option_env!("RUSTC_BOOTSTRAP")`, which is the case since rust-lang#119654. **Before:** ```console $ RUSTC_BOOTSTRAP=1 ./x.py check library/core Building bootstrap Compiling proc-macro2 v1.0.76 Compiling quote v1.0.35 Compiling syn v2.0.48 Compiling clap_derive v4.4.7 Compiling serde_derive v1.0.195 Compiling clap v4.4.13 Compiling clap_complete v4.4.6 Compiling build_helper v0.1.0 Compiling bootstrap v0.0.0 Finished dev [unoptimized] target(s) in 6.31s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.23s Build completed successfully in 0:00:07 $ ./x.py check library/core Building bootstrap Compiling proc-macro2 v1.0.76 Compiling quote v1.0.35 Compiling syn v2.0.48 Compiling clap_derive v4.4.7 Compiling serde_derive v1.0.195 Compiling clap v4.4.13 Compiling clap_complete v4.4.6 Compiling build_helper v0.1.0 Compiling bootstrap v0.0.0 Finished dev [unoptimized] target(s) in 5.30s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.25s Build completed successfully in 0:00:06 ``` **After:** ```console $ RUSTC_BOOTSTRAP=1 ./x.py check library/core Building bootstrap Finished dev [unoptimized] target(s) in 0.06s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.14s Build completed successfully in 0:00:01 $ ./x.py check library/core Building bootstrap Finished dev [unoptimized] target(s) in 0.04s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.13s Build completed successfully in 0:00:01 ```
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#115291 (Save liveness results for DestinationPropagation) - rust-lang#119855 (Enable Static Builds for FreeBSD) - rust-lang#119975 (Don't ICE if TAIT-defining fn contains a closure with `_` in return type) - rust-lang#119984 (Change return type of unstable `Waker::noop()` from `Waker` to `&Waker`.) - rust-lang#120001 (Consistently unset RUSTC_BOOTSTRAP when compiling bootstrap) - rust-lang#120020 (Gracefully handle missing typeck information if typeck errored) - rust-lang#120031 (Construct closure type eagerly) - rust-lang#120032 (Fix `rustc_abi` build on stable) - rust-lang#120039 (pat_analysis: Don't rely on contiguous `VariantId`s outside of rustc) - rust-lang#120044 (Fix typo in comments (in_place_collect)) - rust-lang#120056 (Use FnOnceOutput instead of FnOnce where expected) r? `@ghost` `@rustbot` modify labels: rollup
…-ozkan Consistently unset RUSTC_BOOTSTRAP when compiling bootstrap Since rust-lang#113906, all x.py invocations performed by rust-analyzer have RUSTC_BOOTSTRAP=1 set. This was to fix rust-lang#112391 (comment) — rust-analyzer uses some default cargo from the system when fetching workspace layout, and the standard library uses some unstable cargo feature, so x.py would previously fail if the system toolchain wasn't nightly. https://github.com/rust-lang/rust/blob/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/Cargo.toml#L1 This PR changes x.py to cancel out this RUSTC_BOOTSTRAP=1 when compiling bootstrap. It will only remain set when running the compiled bootstrap executable. This fixes spurious bootstrap rebuilds in the event that a rust-analyzer x.py invocation is alternated with someone running x.py themself on the command line, if any dependency of bootstrap looks at `option_env!("RUSTC_BOOTSTRAP")`, which is the case since rust-lang#119654. **Before:** ```console $ RUSTC_BOOTSTRAP=1 ./x.py check library/core Building bootstrap Compiling proc-macro2 v1.0.76 Compiling quote v1.0.35 Compiling syn v2.0.48 Compiling clap_derive v4.4.7 Compiling serde_derive v1.0.195 Compiling clap v4.4.13 Compiling clap_complete v4.4.6 Compiling build_helper v0.1.0 Compiling bootstrap v0.0.0 Finished dev [unoptimized] target(s) in 6.31s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.23s Build completed successfully in 0:00:07 $ ./x.py check library/core Building bootstrap Compiling proc-macro2 v1.0.76 Compiling quote v1.0.35 Compiling syn v2.0.48 Compiling clap_derive v4.4.7 Compiling serde_derive v1.0.195 Compiling clap v4.4.13 Compiling clap_complete v4.4.6 Compiling build_helper v0.1.0 Compiling bootstrap v0.0.0 Finished dev [unoptimized] target(s) in 5.30s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.25s Build completed successfully in 0:00:06 ``` **After:** ```console $ RUSTC_BOOTSTRAP=1 ./x.py check library/core Building bootstrap Finished dev [unoptimized] target(s) in 0.06s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.14s Build completed successfully in 0:00:01 $ ./x.py check library/core Building bootstrap Finished dev [unoptimized] target(s) in 0.04s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.13s Build completed successfully in 0:00:01 ```
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#115291 (Save liveness results for DestinationPropagation) - rust-lang#119855 (Enable Static Builds for FreeBSD) - rust-lang#119975 (Don't ICE if TAIT-defining fn contains a closure with `_` in return type) - rust-lang#120001 (Consistently unset RUSTC_BOOTSTRAP when compiling bootstrap) - rust-lang#120020 (Gracefully handle missing typeck information if typeck errored) - rust-lang#120031 (Construct closure type eagerly) - rust-lang#120032 (Fix `rustc_abi` build on stable) - rust-lang#120039 (pat_analysis: Don't rely on contiguous `VariantId`s outside of rustc) - rust-lang#120044 (Fix typo in comments (in_place_collect)) - rust-lang#120056 (Use FnOnceOutput instead of FnOnce where expected) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#115291 (Save liveness results for DestinationPropagation) - rust-lang#119855 (Enable Static Builds for FreeBSD) - rust-lang#119975 (Don't ICE if TAIT-defining fn contains a closure with `_` in return type) - rust-lang#120001 (Consistently unset RUSTC_BOOTSTRAP when compiling bootstrap) - rust-lang#120020 (Gracefully handle missing typeck information if typeck errored) - rust-lang#120031 (Construct closure type eagerly) - rust-lang#120032 (Fix `rustc_abi` build on stable) - rust-lang#120039 (pat_analysis: Don't rely on contiguous `VariantId`s outside of rustc) - rust-lang#120044 (Fix typo in comments (in_place_collect)) - rust-lang#120056 (Use FnOnceOutput instead of FnOnce where expected) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#120001 - dtolnay:bootstrapbootstrap, r=onur-ozkan Consistently unset RUSTC_BOOTSTRAP when compiling bootstrap Since rust-lang#113906, all x.py invocations performed by rust-analyzer have RUSTC_BOOTSTRAP=1 set. This was to fix rust-lang#112391 (comment) — rust-analyzer uses some default cargo from the system when fetching workspace layout, and the standard library uses some unstable cargo feature, so x.py would previously fail if the system toolchain wasn't nightly. https://github.com/rust-lang/rust/blob/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/Cargo.toml#L1 This PR changes x.py to cancel out this RUSTC_BOOTSTRAP=1 when compiling bootstrap. It will only remain set when running the compiled bootstrap executable. This fixes spurious bootstrap rebuilds in the event that a rust-analyzer x.py invocation is alternated with someone running x.py themself on the command line, if any dependency of bootstrap looks at `option_env!("RUSTC_BOOTSTRAP")`, which is the case since rust-lang#119654. **Before:** ```console $ RUSTC_BOOTSTRAP=1 ./x.py check library/core Building bootstrap Compiling proc-macro2 v1.0.76 Compiling quote v1.0.35 Compiling syn v2.0.48 Compiling clap_derive v4.4.7 Compiling serde_derive v1.0.195 Compiling clap v4.4.13 Compiling clap_complete v4.4.6 Compiling build_helper v0.1.0 Compiling bootstrap v0.0.0 Finished dev [unoptimized] target(s) in 6.31s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.23s Build completed successfully in 0:00:07 $ ./x.py check library/core Building bootstrap Compiling proc-macro2 v1.0.76 Compiling quote v1.0.35 Compiling syn v2.0.48 Compiling clap_derive v4.4.7 Compiling serde_derive v1.0.195 Compiling clap v4.4.13 Compiling clap_complete v4.4.6 Compiling build_helper v0.1.0 Compiling bootstrap v0.0.0 Finished dev [unoptimized] target(s) in 5.30s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.25s Build completed successfully in 0:00:06 ``` **After:** ```console $ RUSTC_BOOTSTRAP=1 ./x.py check library/core Building bootstrap Finished dev [unoptimized] target(s) in 0.06s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.14s Build completed successfully in 0:00:01 $ ./x.py check library/core Building bootstrap Finished dev [unoptimized] target(s) in 0.04s Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.13s Build completed successfully in 0:00:01 ```
I think this just broke building everything with |
Correct.
I think setting it consistently is much better approach (or if it wasn't manually set from user). What do you think ? @dtolnay |
I agree with this, but responded in #120096 (review) with one modification I would suggest. |
Set RUSTC_BOOTSTRAP=1 consistently Fixes https://internals.rust-lang.org/t/rust-compiler-with-parallel-build/20099 which is a regression from rust-lang#120001 cc `@dtolnay` `@petrochenkov`
Rollup merge of rust-lang#120096 - onur-ozkan:rustc_bootstrap, r=dtolnay Set RUSTC_BOOTSTRAP=1 consistently Fixes https://internals.rust-lang.org/t/rust-compiler-with-parallel-build/20099 which is a regression from rust-lang#120001 cc `@dtolnay` `@petrochenkov`
Since #113906, all x.py invocations performed by rust-analyzer have RUSTC_BOOTSTRAP=1 set. This was to fix #112391 (comment) — rust-analyzer uses some default cargo from the system when fetching workspace layout, and the standard library uses some unstable cargo feature, so x.py would previously fail if the system toolchain wasn't nightly.
rust/library/std/Cargo.toml
Line 1 in 82e1608
This PR changes x.py to cancel out this RUSTC_BOOTSTRAP=1 when compiling bootstrap. It will only remain set when running the compiled bootstrap executable. This fixes spurious bootstrap rebuilds in the event that a rust-analyzer x.py invocation is alternated with someone running x.py themself on the command line, if any dependency of bootstrap looks at
option_env!("RUSTC_BOOTSTRAP")
, which is the case since #119654.Before:
After: