Skip to content

Commit 8daf82f

Browse files
committed
rewrite and rename issue-37839 to rmake
1 parent 11dd90f commit 8daf82f

File tree

8 files changed

+37
-10
lines changed

8 files changed

+37
-10
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub use llvm::{
3535
LlvmProfdata, LlvmReadobj,
3636
};
3737
pub use run::{cmd, run, run_fail, run_with_args};
38-
pub use rustc::{aux_build, rustc, Rustc};
38+
pub use rustc::{aux_build, bare_rustc, rustc, Rustc};
3939
pub use rustdoc::{bare_rustdoc, rustdoc, Rustdoc};
4040

4141
#[track_caller]

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

+14-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ pub fn rustc() -> Rustc {
1010
Rustc::new()
1111
}
1212

13+
/// Construct a plain `rustc` invocation with no flags set.
14+
#[track_caller]
15+
pub fn bare_rustc() -> Rustc {
16+
Rustc::bare()
17+
}
18+
1319
/// Construct a new `rustc` aux-build invocation.
1420
#[track_caller]
1521
pub fn aux_build() -> Rustc {
@@ -30,7 +36,6 @@ fn setup_common() -> Command {
3036
let rustc = env_var("RUSTC");
3137
let mut cmd = Command::new(rustc);
3238
set_host_rpath(&mut cmd);
33-
cmd.arg("-L").arg(cwd());
3439
cmd
3540
}
3641

@@ -40,6 +45,14 @@ impl Rustc {
4045
/// Construct a new `rustc` invocation.
4146
#[track_caller]
4247
pub fn new() -> Self {
48+
let mut cmd = setup_common();
49+
cmd.arg("-L").arg(cwd());
50+
Self { cmd }
51+
}
52+
53+
/// Construct a bare `rustc` invocation with no flags set.
54+
#[track_caller]
55+
pub fn bare() -> Self {
4356
let cmd = setup_common();
4457
Self { cmd }
4558
}

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ run-make/issue-28595/Makefile
6262
run-make/issue-33329/Makefile
6363
run-make/issue-35164/Makefile
6464
run-make/issue-36710/Makefile
65-
run-make/issue-37839/Makefile
6665
run-make/issue-47551/Makefile
6766
run-make/issue-69368/Makefile
6867
run-make/issue-83045/Makefile

tests/run-make/issue-37839/Makefile

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// A compiler bug caused the following issue:
2+
// If a crate A depends on crate B, and crate B
3+
// depends on crate C, and crate C contains a procedural
4+
// macro, compiling crate A would fail.
5+
// This was fixed in #37846, and this test checks
6+
// that this bug does not make a resurgence.
7+
8+
//FIXME(Oneirical): ignore-cross-compile
9+
10+
use run_make_support::{bare_rustc, cwd, rust_lib_name, rustc};
11+
12+
fn main() {
13+
rustc().input("a.rs").run();
14+
rustc().input("b.rs").run();
15+
let curr_dir = cwd().display().to_string();
16+
bare_rustc()
17+
.input("c.rs")
18+
.arg(format!("-Ldependency={curr_dir}"))
19+
.extern_("b", cwd().join(rust_lib_name("b")))
20+
.out_dir(cwd())
21+
.run();
22+
}

0 commit comments

Comments
 (0)