Skip to content

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
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