Skip to content

Comments

Revert "Fix the compile-test tests when setting Cargo's build.build-dir setting to a path that's distinct from target-dir."#16623

Merged
samueltardieu merged 1 commit intorust-lang:masterfrom
samueltardieu:revert/16568
Feb 23, 2026
Merged

Revert "Fix the compile-test tests when setting Cargo's build.build-dir setting to a path that's distinct from target-dir."#16623
samueltardieu merged 1 commit intorust-lang:masterfrom
samueltardieu:revert/16568

Conversation

@samueltardieu
Copy link
Member

This reverts commit 2737b26 as it prevents Clippy tests from passing when running inside the compiler repository.

changelog: none

r? @flip1995

…dir` setting to a path that's distinct from `target-dir`."

This reverts commit 2737b26 as it
prevents Clippy tests from passing when running inside the compiler
repository.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 23, 2026
@samueltardieu
Copy link
Member Author

I'll merge this as-is, as it "unaccepts" a PR I accepted which has not yet been propagated upstream.

@samueltardieu samueltardieu added this pull request to the merge queue Feb 23, 2026
Merged via the queue into rust-lang:master with commit b2a5ee9 Feb 23, 2026
8 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 23, 2026
@samueltardieu samueltardieu deleted the revert/16568 branch February 24, 2026 07:05
github-merge-queue bot pushed a commit that referenced this pull request Feb 24, 2026
… `target-dir` (#16626)

Second attempt after the previous revert in
#16623.
Fixes #16567.

This time I'm using an env var of the `CARGO_BIN_EXE_*` class, to
determine the correct path to the `clippy-driver` executable. This is a
simpler change that, conveniently enough, also fixes the build within
rust-lang/rust. I verified that it does.

Also, extend the fix to `CARGO_CLIPPY_PATH` in tests/test_utils, which
also fixes the dogfood tests in environments with a custom
`build.build-dir`.

Over all, this fixes the compile-test tests and dogfood tests, which
presently don't run when Cargo's `build.build-dir` is set to a path
that's distinct from `target-dir`. Right now, the uitest harness assumes
that `clippy-driver` (a final build artifact) is located in the parent
directory of `compile_test-…` (an intermediate artifact or, rather, a
dependency's final artifact), and that doesn't hold when `build-dir` is
configured independently from `target-dir`, like so (in
~/.cargo/config.toml):

```toml
[build]
build-dir = "{cargo-cache-home}/build-artifacts/{workspace-path-hash}"
```

changelog: none

r? @samueltardieu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants