rust-lang / rust-lang/cargo

Enable build-std on a per target basis

Open
#8,733 13 comments 48 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-feature-request S-triage Z-build-std
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

Some of my custom targets require me to enable build-std, which currently I can enable through .cargo/config.toml

[unstable]
build-std = ["core"]

but this means it is enabled for every target. However I don't necessarily want it for build in targets, it would be nice if in my .cargo/config.toml I could specify something like

[target.custom-target.unstable]
build-std = ["core"] 

If this is already possible but with a different syntax consider this issue closed

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining Cargo's handling of .cargo/config.toml, especially the global [unstable] build-std setting and target-specific configuration. Define how a target-specific build-std value should interact with the global setting, then verify that custom targets can opt in without enabling it for every target.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.