Skip to content

Commit 90029d3

Browse files
committed
Auto merge of #125886 - GuillaumeGomez:migrate-run-make-issue-15460, r=<try>
Migrate run make issue 15460 Part of #121876. r? `@jieyouxu` try-job: x86_64-msvc try-job: aarch64-apple try-job: x86_64-gnu-llvm-18
2 parents 20f23ab + 7ad48c7 commit 90029d3

File tree

8 files changed

+31
-9
lines changed

8 files changed

+31
-9
lines changed

src/tools/compiletest/src/runtest.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3382,6 +3382,7 @@ impl<'test> TestCx<'test> {
33823382
cmd.env("IS_MSVC", "1")
33833383
.env("IS_WINDOWS", "1")
33843384
.env("MSVC_LIB", format!("'{}' -nologo", lib.display()))
3385+
.env("MSVC_LIB_PATH", format!("{}", lib.display()))
33853386
.env("CC", format!("'{}' {}", self.config.cc, cflags))
33863387
.env("CXX", format!("'{}' {}", &self.config.cxx, cxxflags));
33873388
} else {
@@ -3752,6 +3753,7 @@ impl<'test> TestCx<'test> {
37523753
cmd.env("IS_MSVC", "1")
37533754
.env("IS_WINDOWS", "1")
37543755
.env("MSVC_LIB", format!("'{}' -nologo", lib.display()))
3756+
.env("MSVC_LIB_PATH", format!("{}", lib.display()))
37553757
// Note: we diverge from legacy run_make and don't lump `CC` the compiler and
37563758
// default flags together.
37573759
.env("CC_DEFAULT_FLAGS", &cflags)

src/tools/run-make-support/src/lib.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,21 @@ pub use python::python_command;
5555
pub use rustc::{aux_build, bare_rustc, rustc, Rustc};
5656
pub use rustdoc::{bare_rustdoc, rustdoc, Rustdoc};
5757

58-
/// [`diff`][mod@diff] is implemented in terms of the [similar] library.
58+
/// Implement common helpers for command wrappers. This assumes that the command wrapper is a struct
59+
/// containing a `cmd: Command` field and a `output` function. The provided helpers are:
60+
///
61+
/// 1. Generic argument acceptors: `arg` and `args` (delegated to [`Command`]). These are intended
62+
/// to be *fallback* argument acceptors, when specific helpers don't make sense. Prefer to add
63+
/// new specific helper methods over relying on these generic argument providers.
64+
/// 2. Environment manipulation methods: `env`, `env_remove` and `env_clear`: these delegate to
65+
/// methods of the same name on [`Command`].
66+
/// 3. Output and execution: `output`, `run` and `run_fail` are provided. `output` waits for the
67+
/// command to finish running and returns the process's [`Output`]. `run` and `run_fail` are
68+
/// higher-level convenience methods which waits for the command to finish running and assert
69+
/// that the command successfully ran or failed as expected. Prefer `run` and `run_fail` when
70+
/// possible.
71+
///
72+
/// Example usage:
5973
///
6074
/// [similar]: https://github.com/mitsuhiko/similar
6175
pub use diff::{diff, Diff};

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ run-make/incr-foreign-head-span/Makefile
2929
run-make/interdependent-c-libraries/Makefile
3030
run-make/issue-107094/Makefile
3131
run-make/issue-14698/Makefile
32-
run-make/issue-15460/Makefile
3332
run-make/issue-33329/Makefile
3433
run-make/issue-35164/Makefile
3534
run-make/issue-36710/Makefile

tests/run-make/issue-15460/Makefile

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Regression test for <https://github.com/rust-lang/rust/issues/15460>.
2+
3+
//@ ignore-cross-compile
4+
5+
use run_make_support::{build_native_static_lib, run, rustc};
6+
7+
fn main() {
8+
build_native_static_lib("foo");
9+
10+
rustc().input("foo.rs").extra_filename("-383hf8").arg("-Cprefer-dynamic").run();
11+
rustc().input("bar.rs").run();
12+
13+
run("bar");
14+
}

0 commit comments

Comments
 (0)