Repository navigation
compiletest: Use an explicit argfile instead of ArgFileCommand - #166640
Conversation
With the newer cargo build directory layout, the list of transitive dependency paths is long enough that it risks exceeding the command-line length limit on Windows. That problem was already being handled by the ArgFileCommand wrapper, but that wrapper makes it harder to clean up compiletest's command handling in other ways. In this case, it's sufficient to just write the run-make-support dependencies to an argfile unconditionally.
Now that run-make tests unconditionally use argfiles to pass their run-make-support dependencies, ArgFileCommand isn't needed. Removing ArgFileCommand avoids the awkward split between code using Command and code using ArgFileCommand, enabling further cleanups to command handling. This commit also removes the shim_utils dependency from compiletest, since it was only being used for ArgFileCommand.
|
Some changes occurred in src/tools/compiletest cc @jieyouxu These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
|
r? @oli-obk rustbot has assigned @oli-obk. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
I have no context on ArgFileCommand r? @jieyouxu maybe? |
Yeah, that's a given... |
…uwer Rollup of 11 pull requests Successful merges: - #165836 (Use LLVM option `-disable-auto-upgrade-debug-info`) - #164783 (callconv: mips64: match gcc for "alignment" of 16-byte-aligned ZSTs) - #166634 (do not lint `drop_bounds`, `dyn_drop`, `trivial_bounds` and const param names on items from external macros) - #166649 (abby dsl: minor refactor/cleanup) - #164628 (callconv: mips64: handle repr(transparent)) - #166387 (Remove diagnostics import list) - #166564 (miri: support statx syscall) - #166583 (abby dsl tests: the passing test should check-pass) - #166595 (specify target CPUs in 'powerpc-types.rs' assembly test) - #166640 (compiletest: Use an explicit argfile instead of ArgFileCommand) - #166646 (Fix reversed argument counts in Fn trait mismatch note)
Rollup merge of #166640 - Zalathar:argfile, r=jieyouxu compiletest: Use an explicit argfile instead of ArgFileCommand While trying to clean up some command handling in compiletest, I was frustrated by the awkward split between code that uses stdlib Command, and code that uses the ArgFileCommand wrapper. On closer inspection, it seems that the only reason to use ArgFileCommand at all (d7a58fa in #155439) was that run-make tests need to pass a lot of absolute paths to the compiler, as a result of the newer cargo build dir layout. But in that particular case, it's reasonable to instead *always* write the dependency paths to an argfile. I think it's simpler overall to go back to using ordinary Command in compiletest, to avoid having two different command types for a relatively unimportant reason, and to avoid the extra hassle of ArgFileCommand needing to schedule deletion of a temporary file. In the future, I would like to make compiletest a bit more disciplined about how it creates commands for running compilers and running test executables, because currently it's all a bit of a crufty mess.
…uwer Rollup of 11 pull requests Successful merges: - rust-lang/rust#165836 (Use LLVM option `-disable-auto-upgrade-debug-info`) - rust-lang/rust#164783 (callconv: mips64: match gcc for "alignment" of 16-byte-aligned ZSTs) - rust-lang/rust#166634 (do not lint `drop_bounds`, `dyn_drop`, `trivial_bounds` and const param names on items from external macros) - rust-lang/rust#166649 (abby dsl: minor refactor/cleanup) - rust-lang/rust#164628 (callconv: mips64: handle repr(transparent)) - rust-lang/rust#166387 (Remove diagnostics import list) - rust-lang/rust#166564 (miri: support statx syscall) - rust-lang/rust#166583 (abby dsl tests: the passing test should check-pass) - rust-lang/rust#166595 (specify target CPUs in 'powerpc-types.rs' assembly test) - rust-lang/rust#166640 (compiletest: Use an explicit argfile instead of ArgFileCommand) - rust-lang/rust#166646 (Fix reversed argument counts in Fn trait mismatch note)
While trying to clean up some command handling in compiletest, I was frustrated by the awkward split between code that uses stdlib Command, and code that uses the ArgFileCommand wrapper.
On closer inspection, it seems that the only reason to use ArgFileCommand at all (d7a58fa in #155439) was that run-make tests need to pass a lot of absolute paths to the compiler, as a result of the newer cargo build dir layout. But in that particular case, it's reasonable to instead always write the dependency paths to an argfile.
I think it's simpler overall to go back to using ordinary Command in compiletest, to avoid having two different command types for a relatively unimportant reason, and to avoid the extra hassle of ArgFileCommand needing to schedule deletion of a temporary file.
In the future, I would like to make compiletest a bit more disciplined about how it creates commands for running compilers and running test executables, because currently it's all a bit of a crufty mess.