Repository navigation
Change build_rs::input::cargo_cfg_target_env to return Option - #17632
Merged
Merged
Conversation
Collaborator
|
r? @epage rustbot has assigned @epage. Use Why was this reviewer chosen?The reviewer was selected based on:
|
CAD97
force-pushed
the
build-rs-cargo-cfg-target-env
branch
from
October 23, 2026 19:11
a52f80b to
d3c6a53
Compare
This matches the semantics better as well as how the other "for historical reasons" fn cargo_cfg_target_abi which was exposed to return Option. It's my fault from during the 0.1 to 0.2 refactor that these two diverge. cargo_cfg_target_env was copied over from 0.1 with the original design of only mapping to Option for maybe-undefined environment variables and wasn't caught in the refactor that mapped empty-means-none environment variables to Option, whereas newly added cargo_cfg_target_abi post-refactor got the new convention.
CAD97
force-pushed
the
build-rs-cargo-cfg-target-env
branch
from
October 23, 2026 19:18
d3c6a53 to
645cb41
Compare
weihanglo
approved these changes
Oct 23, 2026
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-rust-lang__cargo
that referenced
this pull request
Oct 24, 2026
…ust-lang#17636) ### What does this PR try to resolve? This improves consistency in build-rs's naming. ### Notes to reviewers - See: rust-lang#17632 (review) r? @weihanglo --- 🤖 LLM involvement: None
rust-bors Bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Oct 24, 2026
Update cargo submodule 11 commits in 15be64aa0859b5c36f7a86d52f7aa0db44ba4d84..cad07cf8e597397fff5d0f6cb79c9f870c0b1dd2 2026-10-20 16:03:21 +0000 to 2026-10-23 22:04:58 +0000 - build-rs: rename `cargo_target_family` to `cargo_cfg_target_family` (rust-lang/cargo#17636) - chore: replace `cfg(any())` with `cfg(false)` (rust-lang/cargo#17633) - feat(timings): peak memory as a column in unit table (rust-lang/cargo#17631) - Change `build_rs::input::cargo_cfg_target_env` to return `Option` (rust-lang/cargo#17632) - Update gix to 0.90.0 and adapt Git error recovery (rust-lang/cargo#17578) - Fix unused dep annotation (rust-lang/cargo#17625) - fix!: stop uplifting rlibs on nightly (rust-lang/cargo#17621) - refactor(config): Pull out the ConfigStore into its own module (rust-lang/cargo#17614) - test: simplify file content assertions (rust-lang/cargo#17617) - perf(context): Don't initialize windows-specific code on all platforms (rust-lang/cargo#17615) - refactor(context): Remove RLS-specific function (rust-lang/cargo#17616)
mehmettoplu-rs
pushed a commit
to mehmettoplu-rs/miri
that referenced
this pull request
Oct 24, 2026
Update cargo submodule 11 commits in 15be64aa0859b5c36f7a86d52f7aa0db44ba4d84..cad07cf8e597397fff5d0f6cb79c9f870c0b1dd2 2026-10-20 16:03:21 +0000 to 2026-10-23 22:04:58 +0000 - build-rs: rename `cargo_target_family` to `cargo_cfg_target_family` (rust-lang/cargo#17636) - chore: replace `cfg(any())` with `cfg(false)` (rust-lang/cargo#17633) - feat(timings): peak memory as a column in unit table (rust-lang/cargo#17631) - Change `build_rs::input::cargo_cfg_target_env` to return `Option` (rust-lang/cargo#17632) - Update gix to 0.90.0 and adapt Git error recovery (rust-lang/cargo#17578) - Fix unused dep annotation (rust-lang/cargo#17625) - fix!: stop uplifting rlibs on nightly (rust-lang/cargo#17621) - refactor(config): Pull out the ConfigStore into its own module (rust-lang/cargo#17614) - test: simplify file content assertions (rust-lang/cargo#17617) - perf(context): Don't initialize windows-specific code on all platforms (rust-lang/cargo#17615) - refactor(context): Remove RLS-specific function (rust-lang/cargo#17616)
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 matches the semantics better as well as how the other "for historical reasons"
fn cargo_cfg_target_abiwhich was exposed to returnOption.It's my fault from during the 0.1 to 0.2 refactor that these two diverge.
cargo_cfg_target_envwas copied over from 0.1 with the original design of only mapping toOptionfor maybe-undefined environment variables and wasn't caught in the refactor that mapped empty-means-none environment variables toOption, whereas newly addedcargo_cfg_target_abipost-refactor got the new convention.Notes to reviewers
The build-rs crate is meant to be light such that having duplicated major versions of it in the build tree has a minimal compile-time impact even on a cold build. Even with that said, though, it's up to the maintainers if this change should merit bumping to a new semver-incompatible version.
If it doesn't, it probably merits a source comment noting why the convention differs from
cargo_cfg_target_abi.🤖 LLM involvement: None.