Skip to content

Store artifact deps in build unit dir#16519

Merged
weihanglo merged 3 commits intorust-lang:masterfrom
ranger-ross:artifact-deps
Jan 17, 2026
Merged

Store artifact deps in build unit dir#16519
weihanglo merged 3 commits intorust-lang:masterfrom
ranger-ross:artifact-deps

Conversation

@ranger-ross
Copy link
Member

What does this PR try to resolve?

This spawned out of #16502 (comment) when I noticed artifact dependencies are not using the new build-dir layout.

This PR moves them from <build-dir>/<profile>/deps/artifact/$pkgname-$META (old layout) to <build-dir>/<profile>/build/$pkgname/$META/deps/artifact/<kind> when -Zbuild-dir-new-layout is enabled.

cc tracking issue: #15010

How to test and review this PR?

Added new test specifically for artifact deps

r? @epage

@rustbot rustbot added A-layout Area: target output directory layout, naming, and organization S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 16, 2026
}

#[cargo_test]
fn artifact_deps() {
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to also check those environment variables are pointing to the corret directory layout?

(the directory and bin path one maybe?)

https://doc.rust-lang.org/beta/cargo/reference/unstable.html#artifact-dependencies-environment-variables

Copy link
Member Author

Choose a reason for hiding this comment

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

ahh good call out, yeah let me include those in the test

@ranger-ross ranger-ross force-pushed the artifact-deps branch 2 times, most recently from b1b2aa0 to 5bf02be Compare January 16, 2026 14:35
Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

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

@weihanglo weihanglo enabled auto-merge January 16, 2026 14:49
auto-merge was automatically disabled January 16, 2026 14:53

Head branch was pushed to by a user without write access

@ranger-ross ranger-ross force-pushed the artifact-deps branch 2 times, most recently from fdc2b9b to 98bab12 Compare January 16, 2026 15:19
@ranger-ross
Copy link
Member Author

okay, I think I fixed the test failures in CI. but now there is an unrelated failure

#3 ERROR: failed to authorize: failed to fetch oauth token: unexpected status from POST request to https://auth.docker.io/token: 504 Gateway Timeout: <html><body><h1>504 Gateway Time-out</h1>
The server didn't respond in time.

would you mind re-running the CI jobs?

@weihanglo
Copy link
Member

Still failed

 thread 'build_dir_legacy::artifact_deps' (7536) panicked at tests\testsuite\build_dir_legacy.rs:1098:32:

---- expected: tests\testsuite\build_dir_legacy.rs:1098:56
++++ actual:   In-memory
   1    1 | [ROOT]/foo/build-dir/.rustc_info.json
   2    2 | [ROOT]/foo/build-dir/CACHEDIR.TAG
   3    3 | [ROOT]/foo/build-dir/debug/.cargo-lock
   4    4 | [ROOT]/foo/build-dir/debug/.fingerprint/bar-[HASH]/bin-bar
   5    5 | [ROOT]/foo/build-dir/debug/.fingerprint/bar-[HASH]/bin-bar.json
   6    6 | [ROOT]/foo/build-dir/debug/.fingerprint/bar-[HASH]/dep-bin-bar
   7    7 | [ROOT]/foo/build-dir/debug/.fingerprint/bar-[HASH]/invoked.timestamp
   8    8 | [ROOT]/foo/build-dir/debug/.fingerprint/foo-[HASH]/bin-foo
   9    9 | [ROOT]/foo/build-dir/debug/.fingerprint/foo-[HASH]/bin-foo.json
  10   10 | [ROOT]/foo/build-dir/debug/.fingerprint/foo-[HASH]/dep-bin-foo
  11   11 | [ROOT]/foo/build-dir/debug/.fingerprint/foo-[HASH]/invoked.timestamp
  12      - [ROOT]/foo/build-dir/debug/deps/artifact/bar-[HASH]/bin/bar-[HASH][EXE]
  13      - [ROOT]/foo/build-dir/debug/deps/artifact/bar-[HASH]/bin/bar-[HASH].d
  14      - [ROOT]/foo/build-dir/debug/deps/foo-[HASH][EXE]
  15      - [ROOT]/foo/build-dir/debug/deps/foo-[HASH].d
       12 + [ROOT]/foo/build-dir/debug/deps/artifact/bar-[HASH]/bin/bar.d
       13 + [ROOT]/foo/build-dir/debug/deps/artifact/bar-[HASH]/bin/bar[EXE]
       14 + [ROOT]/foo/build-dir/debug/deps/foo.d
       15 + [ROOT]/foo/build-dir/debug/deps/foo[EXE]

@ranger-ross
Copy link
Member Author

Okay CI is passing now (sorry about that, windows MSVC file paths always get me)

@weihanglo weihanglo added this pull request to the merge queue Jan 17, 2026
Merged via the queue into rust-lang:master with commit ce4df26 Jan 17, 2026
29 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 17, 2026
rust-bors bot pushed a commit to rust-lang/rust that referenced this pull request Jan 23, 2026
Update cargo submodule

14 commits in 85eff7c80277b57f78b11e28d14154ab12fcf643..efcd9f58636c1990393d495159045d9c35e43b8f
2026-01-15 16:18:08 +0000 to 2026-01-23 13:50:59 +0000
- chore(deps): update cargo-semver-checks to v0.46.0 (rust-lang/cargo#16548)
- Increase cache_lock test timeout (rust-lang/cargo#16545)
- iTerm now supports OSC 9;4 (terminal window progress bar) (rust-lang/cargo#16506)
- chore: Updated compiler errors for Rust 1.93 (rust-lang/cargo#16543)
- test(build-std): adjust snapshot (rust-lang/cargo#16539)
- chore: bump to 0.96.0 (rust-lang/cargo#16538)
- fix: update `resolve_all_features()` to filter pkg deps (rust-lang/cargo#16221)
- fix: show implicit_minimum_version_req emitted source once per package (rust-lang/cargo#16535)
- fix: `--remap-path-scope` stabilized in 1.95-nightly (rust-lang/cargo#16536)
- feat(lints): Add non_kebab_case_bin lint  (rust-lang/cargo#16524)
- fix(rm): Suggest table flags when none are specified (rust-lang/cargo#16533)
- fix(patch): clean up patch-related error messages (rust-lang/cargo#16498)
- Store artifact deps in build unit dir (rust-lang/cargo#16519)
- refactor(timings): reuse timing metric collection logic between `--timings` and `-Zbuild-analysis` (rust-lang/cargo#16497)
rust-bors bot pushed a commit to rust-lang/rust that referenced this pull request Jan 23, 2026
Update cargo submodule

14 commits in 85eff7c80277b57f78b11e28d14154ab12fcf643..efcd9f58636c1990393d495159045d9c35e43b8f
2026-01-15 16:18:08 +0000 to 2026-01-23 13:50:59 +0000
- chore(deps): update cargo-semver-checks to v0.46.0 (rust-lang/cargo#16548)
- Increase cache_lock test timeout (rust-lang/cargo#16545)
- iTerm now supports OSC 9;4 (terminal window progress bar) (rust-lang/cargo#16506)
- chore: Updated compiler errors for Rust 1.93 (rust-lang/cargo#16543)
- test(build-std): adjust snapshot (rust-lang/cargo#16539)
- chore: bump to 0.96.0 (rust-lang/cargo#16538)
- fix: update `resolve_all_features()` to filter pkg deps (rust-lang/cargo#16221)
- fix: show implicit_minimum_version_req emitted source once per package (rust-lang/cargo#16535)
- fix: `--remap-path-scope` stabilized in 1.95-nightly (rust-lang/cargo#16536)
- feat(lints): Add non_kebab_case_bin lint  (rust-lang/cargo#16524)
- fix(rm): Suggest table flags when none are specified (rust-lang/cargo#16533)
- fix(patch): clean up patch-related error messages (rust-lang/cargo#16498)
- Store artifact deps in build unit dir (rust-lang/cargo#16519)
- refactor(timings): reuse timing metric collection logic between `--timings` and `-Zbuild-analysis` (rust-lang/cargo#16497)
rust-bors bot pushed a commit to rust-lang/rust that referenced this pull request Jan 24, 2026
Update cargo submodule

14 commits in 85eff7c80277b57f78b11e28d14154ab12fcf643..efcd9f58636c1990393d495159045d9c35e43b8f
2026-01-15 16:18:08 +0000 to 2026-01-23 13:50:59 +0000
- chore(deps): update cargo-semver-checks to v0.46.0 (rust-lang/cargo#16548)
- Increase cache_lock test timeout (rust-lang/cargo#16545)
- iTerm now supports OSC 9;4 (terminal window progress bar) (rust-lang/cargo#16506)
- chore: Updated compiler errors for Rust 1.93 (rust-lang/cargo#16543)
- test(build-std): adjust snapshot (rust-lang/cargo#16539)
- chore: bump to 0.96.0 (rust-lang/cargo#16538)
- fix: update `resolve_all_features()` to filter pkg deps (rust-lang/cargo#16221)
- fix: show implicit_minimum_version_req emitted source once per package (rust-lang/cargo#16535)
- fix: `--remap-path-scope` stabilized in 1.95-nightly (rust-lang/cargo#16536)
- feat(lints): Add non_kebab_case_bin lint  (rust-lang/cargo#16524)
- fix(rm): Suggest table flags when none are specified (rust-lang/cargo#16533)
- fix(patch): clean up patch-related error messages (rust-lang/cargo#16498)
- Store artifact deps in build unit dir (rust-lang/cargo#16519)
- refactor(timings): reuse timing metric collection logic between `--timings` and `-Zbuild-analysis` (rust-lang/cargo#16497)
@rustbot rustbot added this to the 1.95.0 milestone Jan 24, 2026
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jan 25, 2026
Update cargo submodule

14 commits in 85eff7c80277b57f78b11e28d14154ab12fcf643..efcd9f58636c1990393d495159045d9c35e43b8f
2026-01-15 16:18:08 +0000 to 2026-01-23 13:50:59 +0000
- chore(deps): update cargo-semver-checks to v0.46.0 (rust-lang/cargo#16548)
- Increase cache_lock test timeout (rust-lang/cargo#16545)
- iTerm now supports OSC 9;4 (terminal window progress bar) (rust-lang/cargo#16506)
- chore: Updated compiler errors for Rust 1.93 (rust-lang/cargo#16543)
- test(build-std): adjust snapshot (rust-lang/cargo#16539)
- chore: bump to 0.96.0 (rust-lang/cargo#16538)
- fix: update `resolve_all_features()` to filter pkg deps (rust-lang/cargo#16221)
- fix: show implicit_minimum_version_req emitted source once per package (rust-lang/cargo#16535)
- fix: `--remap-path-scope` stabilized in 1.95-nightly (rust-lang/cargo#16536)
- feat(lints): Add non_kebab_case_bin lint  (rust-lang/cargo#16524)
- fix(rm): Suggest table flags when none are specified (rust-lang/cargo#16533)
- fix(patch): clean up patch-related error messages (rust-lang/cargo#16498)
- Store artifact deps in build unit dir (rust-lang/cargo#16519)
- refactor(timings): reuse timing metric collection logic between `--timings` and `-Zbuild-analysis` (rust-lang/cargo#16497)
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jan 26, 2026
Update cargo submodule

14 commits in 85eff7c80277b57f78b11e28d14154ab12fcf643..efcd9f58636c1990393d495159045d9c35e43b8f
2026-01-15 16:18:08 +0000 to 2026-01-23 13:50:59 +0000
- chore(deps): update cargo-semver-checks to v0.46.0 (rust-lang/cargo#16548)
- Increase cache_lock test timeout (rust-lang/cargo#16545)
- iTerm now supports OSC 9;4 (terminal window progress bar) (rust-lang/cargo#16506)
- chore: Updated compiler errors for Rust 1.93 (rust-lang/cargo#16543)
- test(build-std): adjust snapshot (rust-lang/cargo#16539)
- chore: bump to 0.96.0 (rust-lang/cargo#16538)
- fix: update `resolve_all_features()` to filter pkg deps (rust-lang/cargo#16221)
- fix: show implicit_minimum_version_req emitted source once per package (rust-lang/cargo#16535)
- fix: `--remap-path-scope` stabilized in 1.95-nightly (rust-lang/cargo#16536)
- feat(lints): Add non_kebab_case_bin lint  (rust-lang/cargo#16524)
- fix(rm): Suggest table flags when none are specified (rust-lang/cargo#16533)
- fix(patch): clean up patch-related error messages (rust-lang/cargo#16498)
- Store artifact deps in build unit dir (rust-lang/cargo#16519)
- refactor(timings): reuse timing metric collection logic between `--timings` and `-Zbuild-analysis` (rust-lang/cargo#16497)
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Jan 27, 2026
Update cargo submodule

14 commits in 85eff7c80277b57f78b11e28d14154ab12fcf643..efcd9f58636c1990393d495159045d9c35e43b8f
2026-01-15 16:18:08 +0000 to 2026-01-23 13:50:59 +0000
- chore(deps): update cargo-semver-checks to v0.46.0 (rust-lang/cargo#16548)
- Increase cache_lock test timeout (rust-lang/cargo#16545)
- iTerm now supports OSC 9;4 (terminal window progress bar) (rust-lang/cargo#16506)
- chore: Updated compiler errors for Rust 1.93 (rust-lang/cargo#16543)
- test(build-std): adjust snapshot (rust-lang/cargo#16539)
- chore: bump to 0.96.0 (rust-lang/cargo#16538)
- fix: update `resolve_all_features()` to filter pkg deps (rust-lang/cargo#16221)
- fix: show implicit_minimum_version_req emitted source once per package (rust-lang/cargo#16535)
- fix: `--remap-path-scope` stabilized in 1.95-nightly (rust-lang/cargo#16536)
- feat(lints): Add non_kebab_case_bin lint  (rust-lang/cargo#16524)
- fix(rm): Suggest table flags when none are specified (rust-lang/cargo#16533)
- fix(patch): clean up patch-related error messages (rust-lang/cargo#16498)
- Store artifact deps in build unit dir (rust-lang/cargo#16519)
- refactor(timings): reuse timing metric collection logic between `--timings` and `-Zbuild-analysis` (rust-lang/cargo#16497)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-layout Area: target output directory layout, naming, and organization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants