-
Notifications
You must be signed in to change notification settings - Fork 2.7k
refactor: Define cargo script's target-dir using build-dir templating #16073
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
+106
−69
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
weihanglo
reviewed
Oct 8, 2025
2d592c2
to
fa09d1b
Compare
I dropped the last couple of commits because they were causing problems and I'll have to rethink them but the rest should be good |
fa09d1b
to
2c7f329
Compare
weihanglo
reviewed
Oct 10, 2025
f93daba
to
a7e5e6d
Compare
This comment has been minimized.
This comment has been minimized.
a7e5e6d
to
5b5455c
Compare
weihanglo
approved these changes
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
bors
added a commit
to rust-lang/rust
that referenced
this pull request
Oct 10, 2025
Update cargo submodule 22 commits in 801d9b4981dd07e3aecdca1ab86834c13615737e..81c3f77a467359c8be6bc747dc93ec66a6e4ce11 2025-10-04 13:30:15 +0000 to 2025-10-10 18:41:02 +0000 - docs(changelog): literal host-tuple support (rust-lang/cargo#16033) - refactor: Define cargo script's target-dir using build-dir templating (rust-lang/cargo#16073) - feat(build-dir): Reorganize build-dir layout (rust-lang/cargo#15947) - refactor: unflatten `(String, Def)` to `ConfigValue` (rust-lang/cargo#16084) - fix(tree): Switch from `--depth public` to `--edges public` (rust-lang/cargo#16081) - docs(guide): Point out tools for reducing dependencies (rust-lang/cargo#16078) - Allow to rustfix unused_variables lint. (rust-lang/cargo#16082) - Fix test that assumes `CARGO_CFG_TARGET_FAMILY` is a single value (rust-lang/cargo#16079) - Fix regression that swallowed json diagnostic explanations (rust-lang/cargo#16075) - docs(ref): fix link to clippy incompatible_msrv lint (rust-lang/cargo#16077) - Convert a few more diagnostics to reports (rust-lang/cargo#16066) - fix(support): Add track_caller to know the actual failure (rust-lang/cargo#16069) - fix(add): Report a missing source error for workspace dependencies (rust-lang/cargo#16063) - fix(script): Default bin.name to package.name (rust-lang/cargo#16064) - refactor(gctx): ConfigValue getter cleanup (rust-lang/cargo#16067) - Fix unsafe_op_in_unsafe_fn for Windows (rust-lang/cargo#16058) - Consider public dependencies when choosing a version in cargo add (rust-lang/cargo#1… (rust-lang/cargo#15966) - docs: clarify panic-immediate-abort can be used in config (rust-lang/cargo#16054) - fix(timings): compute codegen start time to draw dep lines (rust-lang/cargo#16055) - chore: Added tracing span for build script execution (rust-lang/cargo#16053) - test: null-terminated path for reserved windows name detection (rust-lang/cargo#16052) - feat (publish): deprecate `--token` option (rust-lang/cargo#16046) r? ghost
bors
added a commit
to rust-lang/rust
that referenced
this pull request
Oct 11, 2025
Update cargo submodule 22 commits in 801d9b4981dd07e3aecdca1ab86834c13615737e..81c3f77a467359c8be6bc747dc93ec66a6e4ce11 2025-10-04 13:30:15 +0000 to 2025-10-10 18:41:02 +0000 - docs(changelog): literal host-tuple support (rust-lang/cargo#16033) - refactor: Define cargo script's target-dir using build-dir templating (rust-lang/cargo#16073) - feat(build-dir): Reorganize build-dir layout (rust-lang/cargo#15947) - refactor: unflatten `(String, Def)` to `ConfigValue` (rust-lang/cargo#16084) - fix(tree): Switch from `--depth public` to `--edges public` (rust-lang/cargo#16081) - docs(guide): Point out tools for reducing dependencies (rust-lang/cargo#16078) - Allow to rustfix unused_variables lint. (rust-lang/cargo#16082) - Fix test that assumes `CARGO_CFG_TARGET_FAMILY` is a single value (rust-lang/cargo#16079) - Fix regression that swallowed json diagnostic explanations (rust-lang/cargo#16075) - docs(ref): fix link to clippy incompatible_msrv lint (rust-lang/cargo#16077) - Convert a few more diagnostics to reports (rust-lang/cargo#16066) - fix(support): Add track_caller to know the actual failure (rust-lang/cargo#16069) - fix(add): Report a missing source error for workspace dependencies (rust-lang/cargo#16063) - fix(script): Default bin.name to package.name (rust-lang/cargo#16064) - refactor(gctx): ConfigValue getter cleanup (rust-lang/cargo#16067) - Fix unsafe_op_in_unsafe_fn for Windows (rust-lang/cargo#16058) - Consider public dependencies when choosing a version in cargo add (rust-lang/cargo#1… (rust-lang/cargo#15966) - docs: clarify panic-immediate-abort can be used in config (rust-lang/cargo#16054) - fix(timings): compute codegen start time to draw dep lines (rust-lang/cargo#16055) - chore: Added tracing span for build script execution (rust-lang/cargo#16053) - test: null-terminated path for reserved windows name detection (rust-lang/cargo#16052) - feat (publish): deprecate `--token` option (rust-lang/cargo#16046) r? ghost
bors
added a commit
to rust-lang/rust
that referenced
this pull request
Oct 11, 2025
Update cargo submodule 22 commits in 801d9b4981dd07e3aecdca1ab86834c13615737e..81c3f77a467359c8be6bc747dc93ec66a6e4ce11 2025-10-04 13:30:15 +0000 to 2025-10-10 18:41:02 +0000 - docs(changelog): literal host-tuple support (rust-lang/cargo#16033) - refactor: Define cargo script's target-dir using build-dir templating (rust-lang/cargo#16073) - feat(build-dir): Reorganize build-dir layout (rust-lang/cargo#15947) - refactor: unflatten `(String, Def)` to `ConfigValue` (rust-lang/cargo#16084) - fix(tree): Switch from `--depth public` to `--edges public` (rust-lang/cargo#16081) - docs(guide): Point out tools for reducing dependencies (rust-lang/cargo#16078) - Allow to rustfix unused_variables lint. (rust-lang/cargo#16082) - Fix test that assumes `CARGO_CFG_TARGET_FAMILY` is a single value (rust-lang/cargo#16079) - Fix regression that swallowed json diagnostic explanations (rust-lang/cargo#16075) - docs(ref): fix link to clippy incompatible_msrv lint (rust-lang/cargo#16077) - Convert a few more diagnostics to reports (rust-lang/cargo#16066) - fix(support): Add track_caller to know the actual failure (rust-lang/cargo#16069) - fix(add): Report a missing source error for workspace dependencies (rust-lang/cargo#16063) - fix(script): Default bin.name to package.name (rust-lang/cargo#16064) - refactor(gctx): ConfigValue getter cleanup (rust-lang/cargo#16067) - Fix unsafe_op_in_unsafe_fn for Windows (rust-lang/cargo#16058) - Consider public dependencies when choosing a version in cargo add (rust-lang/cargo#1… (rust-lang/cargo#15966) - docs: clarify panic-immediate-abort can be used in config (rust-lang/cargo#16054) - fix(timings): compute codegen start time to draw dep lines (rust-lang/cargo#16055) - chore: Added tracing span for build script execution (rust-lang/cargo#16053) - test: null-terminated path for reserved windows name detection (rust-lang/cargo#16052) - feat (publish): deprecate `--token` option (rust-lang/cargo#16046) r? ghost
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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?
build-dir
s templating was modeled off of thetarget-dir
for cargo scripts but the root dir and hashing are currently duplicated. This consolidates the logic by defining the cargo scripttarget-dir
as{cargo-cache-home}/target/{workspace-path-hash}
.This also serves as preparation for splitting cargo scripts
build-dir
andtarget-dir
.How to test and review this PR?