-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: preserve dep_name for build script metadata
#16494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+69
−18
Conversation
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
This regressed because we looked up the manifest dependency name by matching SourceId, which fails when `[patch]` changes the source. https://github.com/rust-lang/cargo/blob/dc03f44ec82c9d4947997b36165d0e2502623506/src/cargo/core/compiler/custom_build.rs?plain=1#L473-L475
This fix ensures the synthetic RunCustomBuild-RunCustomBuild edges carry the manifest dep name, so `CARGO_DEP_*` environment variable uses the correct prefix even with patched sources and renamed dependencies.
Collaborator
dep_name for build script metadata
epage
approved these changes
Jan 10, 2026
Contributor
|
Does this mean we can remove the |
Member
|
@weihanglo thanks a ton for fixing this! I had a feeling |
This was referenced Jan 10, 2026
Member
Author
rust-bors bot
added a commit
to rust-lang/rust
that referenced
this pull request
Jan 11, 2026
Update cargo submodule 5 commits in 8c133afcd5e0d69932fe11f5907683723f8d361d..6d1bd93c47f059ec1344cb31e68a2fb284cbc6b1 2026-01-09 03:50:15 +0000 to 2026-01-10 12:53:59 +0000 - fix: preserve `dep_name` for build script metadata (rust-lang/cargo#16494) - refactor(toml): clarify `to_dependency` for config patch (rust-lang/cargo#16492) - Add `--id` flag to `cargo report timings` and `cargo report rebuilds` (rust-lang/cargo#16490) - Display lockfile path in very verbose mode when blocking (rust-lang/cargo#16491) - fix(info): resolve underscore vs hyphen mismatch in schema lookup (rust-lang/cargo#16455) --- An extra submodule update right after <#150739> due to a relatively impactful nightly regression <rust-lang/cargo#16493>
rust-bors bot
added a commit
to rust-lang/rust
that referenced
this pull request
Jan 11, 2026
Update cargo submodule 5 commits in 8c133afcd5e0d69932fe11f5907683723f8d361d..6d1bd93c47f059ec1344cb31e68a2fb284cbc6b1 2026-01-09 03:50:15 +0000 to 2026-01-10 12:53:59 +0000 - fix: preserve `dep_name` for build script metadata (rust-lang/cargo#16494) - refactor(toml): clarify `to_dependency` for config patch (rust-lang/cargo#16492) - Add `--id` flag to `cargo report timings` and `cargo report rebuilds` (rust-lang/cargo#16490) - Display lockfile path in very verbose mode when blocking (rust-lang/cargo#16491) - fix(info): resolve underscore vs hyphen mismatch in schema lookup (rust-lang/cargo#16455) --- An extra submodule update right after <#150739> due to a relatively impactful nightly regression <rust-lang/cargo#16493>
github-actions bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this pull request
Jan 12, 2026
Update cargo submodule 5 commits in 8c133afcd5e0d69932fe11f5907683723f8d361d..6d1bd93c47f059ec1344cb31e68a2fb284cbc6b1 2026-01-09 03:50:15 +0000 to 2026-01-10 12:53:59 +0000 - fix: preserve `dep_name` for build script metadata (rust-lang/cargo#16494) - refactor(toml): clarify `to_dependency` for config patch (rust-lang/cargo#16492) - Add `--id` flag to `cargo report timings` and `cargo report rebuilds` (rust-lang/cargo#16490) - Display lockfile path in very verbose mode when blocking (rust-lang/cargo#16491) - fix(info): resolve underscore vs hyphen mismatch in schema lookup (rust-lang/cargo#16455) --- An extra submodule update right after <rust-lang/rust#150739> due to a relatively impactful nightly regression <rust-lang/cargo#16493>
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Jan 12, 2026
Update cargo submodule 5 commits in 8c133afcd5e0d69932fe11f5907683723f8d361d..6d1bd93c47f059ec1344cb31e68a2fb284cbc6b1 2026-01-09 03:50:15 +0000 to 2026-01-10 12:53:59 +0000 - fix: preserve `dep_name` for build script metadata (rust-lang/cargo#16494) - refactor(toml): clarify `to_dependency` for config patch (rust-lang/cargo#16492) - Add `--id` flag to `cargo report timings` and `cargo report rebuilds` (rust-lang/cargo#16490) - Display lockfile path in very verbose mode when blocking (rust-lang/cargo#16491) - fix(info): resolve underscore vs hyphen mismatch in schema lookup (rust-lang/cargo#16455) --- An extra submodule update right after <rust-lang/rust#150739> due to a relatively impactful nightly regression <rust-lang/cargo#16493>
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?
#16493 regressed because we looked up the manifest dependency name by matching SourceId, which fails when
[patch]changes the source.This fix ensures the synthetic RunCustomBuild-RunCustomBuild edges carry the manifest dep name, so
CARGO_DEP_*environment variable uses the correct prefix even with patched sources and renamed dependencies.How to test and review this PR?
Run repro in #16493.
Fixes #16493