Skip to content

cfg(bootstrap) should not be allowed in library/ #142150

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 7, 2025 · 2 comments · Fixed by #142160
Closed

cfg(bootstrap) should not be allowed in library/ #142150

RalfJung opened this issue Jun 7, 2025 · 2 comments · Fixed by #142160
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@RalfJung
Copy link
Member

RalfJung commented Jun 7, 2025

#141925 removed bootstrap from the allowed-cfg list for the library crates, but ./x still passes in extra flags that allow cfg(bootstrap). This has already led to new cfg(bootstrap) slipping in, and it has led to issue in tooling that builds library/ crates outside of ./x (such as https://github.com/rust-lang/miri-test-libstd/).

Cc @Urgau @cuviper @onur-ozkan @workingjubilee

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

Urgau commented Jun 7, 2025

Opened #142160, should fix the erroneous --check-cfg for bootstrap in library/, and by extension disallow it's usage.

@workingjubilee
Copy link
Member

Thanks!

@Noratrieb Noratrieb 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. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 8, 2025
@bors bors closed this as completed in ad378be Jun 9, 2025
rust-timer added a commit that referenced this issue Jun 9, 2025
Rollup merge of #142160 - Urgau:check-cfg-bootstrap-only-rustc, r=Kobzol

Only allow `bootstrap` cfg in rustc & related

Fixes #142150
r? bootstrap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. 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