test: Don't make assumptions about the build-dir layout#6737
Conversation
| bin_dir.pop(); | ||
| } | ||
| let cmd = bin_dir.join(format!("rustfmt{}", env::consts::EXE_SUFFIX)); | ||
| let cmd = env!("CARGO_BIN_EXE_rustfmt"); |
There was a problem hiding this comment.
Who sets CARGO_BIN_EXE_rustfmt?
There was a problem hiding this comment.
There was a problem hiding this comment.
How long has cargo set CARGO_BIN_EXE_rustfmt? Would we need to updated the docs to let users know that they'll need a minimum cargo version in order to run the test suite?
There was a problem hiding this comment.
That has been there before 1.60. No idea on when (I did backfill some MSRVs in the docs but didn't go back far enough for this).
There was a problem hiding this comment.
Ah that's fine, I just wasn't aware of CARGO_BIN_EXE_rustfmt and thought maybe it was something newer that we needed to make sure people knew about, but if it's been around for a while and we can rely on cargo to set it when running cargo test then I think we should be good to go
Cargo is experimenting with a new build-dir layout which will break the assumptions that rustfmt makes on cargo's internals.
See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-dir-new-layout