Skip to content

build-std: explicit dependencies#3875

Open
davidtwco wants to merge 30 commits intorust-lang:masterfrom
davidtwco:build-std-part-three-explicit-dependencies
Open

build-std: explicit dependencies#3875
davidtwco wants to merge 30 commits intorust-lang:masterfrom
davidtwco:build-std-part-three-explicit-dependencies

Conversation

@davidtwco
Copy link
Member

@davidtwco davidtwco commented Oct 31, 2025

Allow users to add explicit dependencies on standard library crates in the Cargo.toml. This enables Cargo to determine which standard library crates are required by the crate graph without build-std-crates being set and for different crates to require different standard library crates.

This RFC is is part of the build-std project goal and a series of build-std RFCs:

  1. build-std context (build-std: context #3873)
  2. build-std="always" (build-std: always #3874)
  3. Explicit standard library dependencies (this RFC)
  4. build-std="compatible" (RFC not opened yet)
  5. build-std="match-profile" (RFC not opened yet)

There is also a Zulip channel where you can ask questions about any of the build-std RFCs. This series of RFCs was drafted over many months with the help of stakeholders from many Rust project teams, we thank them for their help!

There are some details that have been noted as being worth mentioning in any eventual tracking issues:

FCP

Rendered

@davidtwco davidtwco added T-cargo Relevant to the Cargo team, which will review and decide on the RFC. T-crates-io Relevant to the crates.io team, which will review and decide on the RFC. labels Oct 31, 2025
@Turbo87 Turbo87 moved this to For next meeting in crates.io team meetings Oct 31, 2025
Comment on lines 934 to 938
### Why add standard library crates to Cargo's index?
[rationale-cargo-index]: #why-add-standard-library-crates-to-cargos-index

When Cargo builds the dependency graph, it is driven by the index (not
`Cargo.toml`), so builtin dependencies need to be included in the index.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this about adding them to the index (as top-level packages), which isn't needed, or adding dependencies on the standard library to the index format?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just the latter, clarified in 81298d9

Copy link
Contributor

Choose a reason for hiding this comment

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

Still not clear to me why they need to be in the index

Copy link
Member Author

Choose a reason for hiding this comment

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

This was my understanding from @ehuss's earlier feedback but maybe I've misunderstood it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if this resolved your concern but given it's been a few weeks, I'll resolve this conversation thread so it's easier to keep track of what I still need to address. Feel free to reopen or start another thread.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not resolved.

@ehuss ehuss moved this from RFC needs review to FCP merge in Cargo status tracker Jan 13, 2026
@epage
Copy link
Contributor

epage commented Jan 20, 2026

@rfcbot fcp concern redundant-no-std

See #3875 (comment)

@Turbo87 Turbo87 moved this from For next meeting to Backlog in crates.io team meetings Jan 23, 2026
@ehuss ehuss moved this from FCP merge to FCP blocked in Cargo status tracker Jan 27, 2026
@epage
Copy link
Contributor

epage commented Feb 6, 2026

@rfcbot fcp resolve redundant-no-std

@ehuss ehuss moved this from FCP blocked to FCP merge in Cargo status tracker Feb 17, 2026
@LawnGnome LawnGnome moved this from Backlog to For next meeting in crates.io team meetings Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition-merge This RFC is in PFCP or FCP with a disposition to merge it. proposed-final-comment-period Currently awaiting signoff of all team members in order to enter the final comment period. T-cargo Relevant to the Cargo team, which will review and decide on the RFC. T-crates-io Relevant to the crates.io team, which will review and decide on the RFC.

Projects

Status: FCP merge
Status: For next meeting

Development

Successfully merging this pull request may close these issues.