Skip to content

Remove bootstrap cfgs from library/ #141925

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

Merged
merged 2 commits into from
Jun 4, 2025
Merged

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Jun 2, 2025

These cfg(bootstrap) are always false now that #119899 has landed, and likewise cfg(not(bootstrap)) is always true. Therefore, we don't need to wait for the usual stage0 bump to clean these up.

@rustbot
Copy link
Collaborator

rustbot commented Jun 2, 2025

r? @workingjubilee

rustbot has assigned @workingjubilee.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 2, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 2, 2025

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

@bjorn3
Copy link
Member

bjorn3 commented Jun 2, 2025

Can we stop allowing cfg(bootstrap) for check-cfg in the standard library?

@cuviper
Copy link
Member Author

cuviper commented Jun 2, 2025

Good idea -- I've removed a few more places, including those explicit check-cfg, although I suspect src/bootstrap is still setting the flag too, e.g. here.

@rust-log-analyzer

This comment has been minimized.

@cuviper cuviper force-pushed the vestigial-bootstrap branch from 8e99f2b to c87b072 Compare June 2, 2025 21:46
@workingjubilee
Copy link
Member

allowing cfg(bootstrap) in the compiler itself might be good for obvious reasons, so probably the bootstrap allowance should stay. if we find it gets applied to std too then that can be fixed separately.

@workingjubilee
Copy link
Member

Thanks!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 2, 2025

📌 Commit c87b072 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 2, 2025
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jun 3, 2025
…kingjubilee

Remove bootstrap cfgs from library/

These `cfg(bootstrap)` are always false now that rust-lang#119899 has landed, and likewise `cfg(not(bootstrap))` is always true. Therefore, we don't need to wait for the usual stage0 bump to clean these up.
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jun 3, 2025
…kingjubilee

Remove bootstrap cfgs from library/

These `cfg(bootstrap)` are always false now that rust-lang#119899 has landed, and likewise `cfg(not(bootstrap))` is always true. Therefore, we don't need to wait for the usual stage0 bump to clean these up.
bors added a commit that referenced this pull request Jun 3, 2025
Rollup of 8 pull requests

Successful merges:

 - #137725 (Add `iter` macro)
 - #141455 (std: abort the process on failure to allocate a TLS key)
 - #141569 (Replace ad-hoc ABI "adjustments" with an `AbiMap` to `CanonAbi`)
 - #141698 (Use the informative error as the main const eval error message)
 - #141925 (Remove bootstrap cfgs from library/)
 - #141943 (Remove pre-expansion AST stats.)
 - #141945 (Remove `Path::is_ident`.)
 - #141957 (Add missing `dyn` keywords to tests that do not test for them Part 2)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c8a0f69 into rust-lang:master Jun 4, 2025
10 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 4, 2025
rust-timer added a commit that referenced this pull request Jun 4, 2025
Rollup merge of #141925 - cuviper:vestigial-bootstrap, r=workingjubilee

Remove bootstrap cfgs from library/

These `cfg(bootstrap)` are always false now that #119899 has landed, and likewise `cfg(not(bootstrap))` is always true. Therefore, we don't need to wait for the usual stage0 bump to clean these up.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jun 4, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#137725 (Add `iter` macro)
 - rust-lang/rust#141455 (std: abort the process on failure to allocate a TLS key)
 - rust-lang/rust#141569 (Replace ad-hoc ABI "adjustments" with an `AbiMap` to `CanonAbi`)
 - rust-lang/rust#141698 (Use the informative error as the main const eval error message)
 - rust-lang/rust#141925 (Remove bootstrap cfgs from library/)
 - rust-lang/rust#141943 (Remove pre-expansion AST stats.)
 - rust-lang/rust#141945 (Remove `Path::is_ident`.)
 - rust-lang/rust#141957 (Add missing `dyn` keywords to tests that do not test for them Part 2)

r? `@ghost`
`@rustbot` modify labels: rollup
bjorn3 pushed a commit to rust-lang/rustc_codegen_cranelift that referenced this pull request Jun 5, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#137725 (Add `iter` macro)
 - rust-lang/rust#141455 (std: abort the process on failure to allocate a TLS key)
 - rust-lang/rust#141569 (Replace ad-hoc ABI "adjustments" with an `AbiMap` to `CanonAbi`)
 - rust-lang/rust#141698 (Use the informative error as the main const eval error message)
 - rust-lang/rust#141925 (Remove bootstrap cfgs from library/)
 - rust-lang/rust#141943 (Remove pre-expansion AST stats.)
 - rust-lang/rust#141945 (Remove `Path::is_ident`.)
 - rust-lang/rust#141957 (Add missing `dyn` keywords to tests that do not test for them Part 2)

r? `@ghost`
`@rustbot` modify labels: rollup
@@ -29,7 +29,6 @@ debug_typeid = []
[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
'cfg(bootstrap)',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Despite this removal, cfg(bootstrap) gets accepted in libcore apparently. However, it now gets rejected for out-of-tree builds, such as https://github.com/rust-lang/miri-test-libstd/. That's bad since it means we'll land changes that then fail to build elsewhere.

I think either the cfg(bootstrap) here should be added back, or our CI needs to ensure that there truly isn't any cfg(bootstrap) in libcore.

Also see https://rust-lang.zulipchat.com/#narrow/channel/269128-miri/topic/Miri.20test-libstd.20Failure.20.282025-06.29/with/522715612

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's troublesome. Sorry, I didn't realize that would happen.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's probably because bootstrap is still adding the cfg manually to all crates.

/// Extra `--check-cfg` to add when building the compiler or tools
/// (Mode restriction, config name, config values (if any))
#[expect(clippy::type_complexity)] // It's fine for hard-coded list and type is explained above.
const EXTRA_CHECK_CFGS: &[(Option<Mode>, &str, Option<&[&'static str]>)] = &[
(None, "bootstrap", None),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants