Skip to content

Simplify library dependencies on compiler-builtins - #144683

Merged
bors merged 3 commits into
rust-lang:masterfrom
tgross35:builtins-via-std-workspace
Aug 1, 2025
Merged

Simplify library dependencies on compiler-builtins#144683
bors merged 3 commits into
rust-lang:masterfrom
tgross35:builtins-via-std-workspace

Conversation

@tgross35

@tgross35tgross35 commented Jul 30, 2025

Copy link
Copy Markdown
Member

The three panic-related library crates need to have access to core, and compiler-builtins needs to be in the crate graph. Rather than specifying both dependencies, switch these crates to use rustc-std-workspace-core which already does this.

This means there is now a single place that the compiler-builtins dependency needs to get configured, for everything other than alloc and std.

The second commit removes compiler-builtins from std (more details in the message).

r? @ghost

@rustbotrustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 30, 2025
@tgross35tgross35 changed the title Use core via rustc-std-workspace-core in library/panic*Simplify library dependencies on compiler-builtinsJul 30, 2025
@tgross35
tgross35 marked this pull request as ready for review July 30, 2025 14:26
@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 30, 2025
@rustbot

Copy link
Copy Markdown
Collaborator

These commits modify the library/Cargo.lock file. Unintentional changes to library/Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@tgross35

Copy link
Copy Markdown
MemberAuthor

Things pass locally, assuming similar luck in CI
r? @bjorn3

@rust-log-analyzer

This comment has been minimized.

@tgross35
tgross35force-pushed the builtins-via-std-workspace branch from 38dea0f to d7654b9CompareJuly 30, 2025 14:38
@rustbotrustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jul 30, 2025
@bjorn3

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Jul 30, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit d7654b9 has been approved by bjorn3

It is now in the queue for this repository.

@borsbors 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 Jul 30, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Jul 31, 2025
…e, r=bjorn3
Simplify library dependencies on `compiler-builtins`
The three panic-related library crates need to have access to `core`, and `compiler-builtins` needs to be in the crate graph. Rather than specifying both dependencies, switch these crates to use `rustc-std-workspace-core` which already does this.
This means there is now a single place that the `compiler-builtins` dependency needs to get configured, for everything other than `alloc` and `std`.
The second commit removes `compiler-builtins` from `std` (more details in the message).
@ZalatharZalathar mentioned this pull request Jul 31, 2025
bors added a commit that referenced this pull request Jul 31, 2025
Rollup of 6 pull requests
Successful merges:
- #135975 (Implement `push_mut`)
- #143672 (Fix Box allocator drop elaboration)
- #144232 (Implement support for `become` and explicit tail call codegen for the LLVM backend)
- #144663 (coverage: Re-land "Enlarge empty spans during MIR instrumentation")
- #144683 (Simplify library dependencies on `compiler-builtins`)
- #144685 (Only extract lang items once in codegen_fn_attrs)
r? `@ghost`
`@rustbot` modify labels: rollup
@Noratrieb

Copy link
Copy Markdown
Member

@bors r-
failed in rollup because UEFI does funny things with compiler-builtins that I imagine one is not supposed to do: #144709 (comment)

@borsbors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 31, 2025
@tgross35

Copy link
Copy Markdown
MemberAuthor

...okay what?

Added in 61e550a, @Ayush1325 why doesn't that create slices and do == rather than calling into compiler_builtins?

@tgross35

Copy link
Copy Markdown
MemberAuthor

@bors2 try jobs=dist-various-2

@rust-bors

rust-borsBot commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

⌛ Trying commit 4f7f450 with merge 282345f

To cancel the try build, run the command @bors try cancel.

rust-borsBot added a commit that referenced this pull request Jul 31, 2025
Simplify library dependencies on `compiler-builtins`
try-job: dist-various-2

@NoratriebNoratrieb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

on the uefi change

@rust-bors

rust-borsBot commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 282345f (282345f2d55ac3d928eedb1cbfa2f6fc285f8969, parent: adcb3d3b4cd3b7c4cde642f3ed537037f293738e)

`compiler_builtins` shouldn't be called directly. Change the `PartialEq`
implementation for `DevicePathNode` to use slice equality instead, which
will call `memcmp`/`bcmp` via the intrinsic.
The three panic-related library crates need to have access to `core`,
and `compiler-builtins` needs to be in the crate graph. Rather than
specifying both dependencies, switch these crates to use
`rustc-std-workspace-core` which already does this.
This means there is now a single place that the `compiler-builtins`
dependency needs to get configured, for everything other than `alloc`
and `std`.
`compiler-builtins` is already in the crate graph via `alloc`, and all
features related to `compiler-builtins` goes through `alloc`. There
isn't any reason that `std` needs this direct dependency, so remove it.
@tgross35
tgross35force-pushed the builtins-via-std-workspace branch from 4f7f450 to 42bf044CompareJuly 31, 2025 22:47
@tgross35

Copy link
Copy Markdown
MemberAuthor

Thanks Nora!

@bors r=bjorn3,Noratrieb

@bors

bors commented Jul 31, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 42bf044 has been approved by bjorn3,Noratrieb

It is now in the queue for this repository.

@borsbors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 31, 2025
@jhprattjhpratt mentioned this pull request Aug 1, 2025
bors added a commit that referenced this pull request Aug 1, 2025
Rollup of 7 pull requests
Successful merges:
- #143849 (rustdoc: never link to unnamable items)
- #144683 (Simplify library dependencies on `compiler-builtins`)
- #144691 (Extend `is_case_difference` to handle digit-letter confusables)
- #144700 (rustdoc-json: Move `#[macro_export]` from `Other` to it's own variant)
- #144751 (Add correct dynamic_lib_extension for aix)
- #144757 (Ping Muscraft when emitter change)
- #144759 (triagebot: Label `compiler-builtins` T-libs)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 3f5f045 into rust-lang:masterAug 1, 2025
10 checks passed
@rustbotrustbot added this to the 1.90.0 milestone Aug 1, 2025
rust-timer added a commit that referenced this pull request Aug 1, 2025
Rollup merge of #144683 - tgross35:builtins-via-std-workspace, r=bjorn3,Noratrieb
Simplify library dependencies on `compiler-builtins`
The three panic-related library crates need to have access to `core`, and `compiler-builtins` needs to be in the crate graph. Rather than specifying both dependencies, switch these crates to use `rustc-std-workspace-core` which already does this.
This means there is now a single place that the `compiler-builtins` dependency needs to get configured, for everything other than `alloc` and `std`.
The second commit removes `compiler-builtins` from `std` (more details in the message).
@tgross35
tgross35 deleted the builtins-via-std-workspace branch August 1, 2025 10:29
github-actionsBot pushed a commit to model-checking/verify-rust-std that referenced this pull request Aug 4, 2025
…e, r=bjorn3,Noratrieb
Simplify library dependencies on `compiler-builtins`
The three panic-related library crates need to have access to `core`, and `compiler-builtins` needs to be in the crate graph. Rather than specifying both dependencies, switch these crates to use `rustc-std-workspace-core` which already does this.
This means there is now a single place that the `compiler-builtins` dependency needs to get configured, for everything other than `alloc` and `std`.
The second commit removes `compiler-builtins` from `std` (more details in the message).
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-libsRelevant 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.

6 participants

@tgross35@rustbot@rust-log-analyzer@bjorn3@bors@Noratrieb