Skip to content

feat(build-std): Add implicit builtin dependencies - #17397

Open
adamgemmell wants to merge 8 commits into
rust-lang:masterfrom
adamgemmell:dev/adagem01/implicit-builtins
Open

feat(build-std): Add implicit builtin dependencies#17397
adamgemmell wants to merge 8 commits into
rust-lang:masterfrom
adamgemmell:dev/adagem01/implicit-builtins

Conversation

@adamgemmell

@adamgemmell adamgemmell commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

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 of build-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:

@rustbot rustbot added A-crate-dependencies Area: [dependencies] of any kind A-dependency-resolution Area: dependency resolution and the resolver A-lockfile Area: Cargo.lock issues S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 27, 2026
@rustbot

rustbot commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

r? @weihanglo

rustbot has assigned @weihanglo.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @epage, @weihanglo
  • @epage, @weihanglo expanded to epage, weihanglo
  • Random selection from epage, weihanglo

@rustbot

rustbot commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (possibly #17401) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-crate-dependencies Area: [dependencies] of any kind A-dependency-resolution Area: dependency resolution and the resolver A-lockfile Area: Cargo.lock issues S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants