feat(build-std): Add implicit builtin dependencies - #17397
Open
adamgemmell wants to merge 8 commits into
Open
Conversation
Collaborator
|
r? @weihanglo rustbot has assigned @weihanglo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This was referenced Aug 27, 2026
Collaborator
|
☔ The latest upstream changes (possibly #17401) made this pull request unmergeable. Please resolve the merge conflicts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
This PR, part of a stack split off from #16675, allows Cargo to inject implicit builtin dependencies as mentioned in the explicit builtin dependencies. The code, though tested, is currently dead pending later a later PR which will gate them on
-Zbuild-std, and then eventually enabled by default regardless of the setting ofbuild-std.This PR has diverged slightly from the RFC, which writes that the set of builtin dependencies will be "that target’s default set of standard library crates". However, resolves are target-independent, so this PR defaults to introducing a dependency on the full set of std crates if no list is provided. A later PR which implements unit generation will discard any unnecessary builtin dependencies.
The scope of this PR is to not introduce any unexpected changes compared with the existing -Zbuild-std implementation. This PR is currently blocked on a resolution to the sysroot-lookup implementation in #17393.
How to test and review this PR?
The PR introduces unit tests for all new behaviour and I recommend reading the commits in order. This PR cannot be manually tested.
There is a very large amount of context behind build-std. Please feel free to spam me with questions and I can link to relevant bits of this context than reviewers needing to reread this context every time you need to review a build-std PR if you prefer.
This PR is part of a stack: