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

Bootstrap does not set cfg(bootstrap) for build scripts #138032

Open
tgross35 opened this issue Mar 5, 2025 · 1 comment
Open

Bootstrap does not set cfg(bootstrap) for build scripts #138032

tgross35 opened this issue Mar 5, 2025 · 1 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)

Comments

@tgross35
Copy link
Contributor

tgross35 commented Mar 5, 2025

I was experimenting with some changes to compiler-builtins that were sensitive to bootstrap. --cfg=bootstrap does get passed to the crates but doesn't seem to pass to build scripts. E.g. for the build script:

Running `~/projects/rust/build/bootstrap/debug/rustc ~/projects/rust/build/bootstrap/debug/rustc --crate-name build_script_build --edition=2021 ~/.cargo/git/checkouts
/compiler-builtins-ef822f47a433bc09/4c7c9af/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C codegen-units=1
0000 -C debuginfo=line-tables-only -C overflow-checks=off --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="rustc-dep-of-std"' --check-cfg 'cfg(docsrs,test)
' --check-cfg 'cfg(feature, values("c", "cc", "compiler-builtins", "core", "default", "mangled-names", "mem", "no-asm", "no-f16-f128", "public-test-deps", "rustc-dep-of-std"))' -C metadata=63a45c0074c9ebec -
C extra-filename=-23c20e83882c80e9 --out-dir ~/projects/rust/build/x86_64-unknown-linux-gnu/stage0-std/release/build/compiler_builtins-23c20e83882c80e9 -L dependency=~/projects/rust/b
uild/x86_64-unknown-linux-gnu/stage0-std/release/deps --cap-lints allow -Z binary-dep-depinfo`

But for the crate itself:

~/projects/rust/build/bootstrap/debug/rustc ~/projects/rust/build/bootstrap/debug/rustc --crate-name compiler_builtins --edition=2021 ~/.cargo/git/checkouts/compiler-builtins-ef822f47a433bc09/4c7c9af/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=207 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C codegen-units=10000 -C debuginfo=line-tables-only -C debug-assertions=on -C overflow-checks=off --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="rustc-dep-of-std"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("c", "cc", "compiler-builtins", "core", "default", "mangled-names", "mem", "no-asm", "no-f16-f128", "public-test-deps", "rustc-dep-of-std"))' -C metadata=5a83d879a97eb522 -C extra-filename=-963761dda15d3919 --out-dir ~/projects/rust/build/x86_64-unknown-linux-gnu/stage0-std/s390x-unknown-linux-gnu/release/deps --target s390x-unknown-linux-gnu -C linker=s390x-linux-gnu-gcc -L dependency=~/projects/rust/build/x86_64-unknown-linux-gnu/stage0-std/s390x-unknown-linux-gnu/release/deps -L dependency=~/projects/rust/build/x86_64-unknown-linux-gnu/stage0-std/release/deps --extern core=~/projects/rust/build/x86_64-unknown-linux-gnu/stage0-std/s390x-unknown-linux-gnu/release/deps/librustc_std_workspace_core-5c763a693a66c7d8.rmeta --cap-lints allow --cfg=bootstrap ...

Is this behavior intentional?

@tgross35 tgross35 added C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Mar 5, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 5, 2025
@bjorn3
Copy link
Member

bjorn3 commented Mar 5, 2025

cc #138035

@onur-ozkan onur-ozkan removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 5, 2025
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