about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-07-05 13:20:32 -0400
committerOneirical <manchot@videotron.ca>2024-07-05 13:20:32 -0400
commit8daf82fece0d047b555e55e7511c9b3fdd29a53c (patch)
tree6710cc52f273e3dab1c2a59b926802e17e3bf485
parent11dd90f7613a4b160ed8398a3f1c7c129ad1a372 (diff)
downloadrust-8daf82fece0d047b555e55e7511c9b3fdd29a53c.tar.gz
rust-8daf82fece0d047b555e55e7511c9b3fdd29a53c.zip
rewrite and rename issue-37839 to rmake
-rw-r--r--src/tools/run-make-support/src/lib.rs2
-rw-r--r--src/tools/run-make-support/src/rustc.rs15
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/issue-37839/Makefile7
-rw-r--r--tests/run-make/proc-macro-three-crates/a.rs (renamed from tests/run-make/issue-37839/a.rs)0
-rw-r--r--tests/run-make/proc-macro-three-crates/b.rs (renamed from tests/run-make/issue-37839/b.rs)0
-rw-r--r--tests/run-make/proc-macro-three-crates/c.rs (renamed from tests/run-make/issue-37839/c.rs)0
-rw-r--r--tests/run-make/proc-macro-three-crates/rmake.rs22
8 files changed, 37 insertions, 10 deletions
diff --git a/src/tools/run-make-support/src/lib.rs b/src/tools/run-make-support/src/lib.rs
index af5ae6a8e60..cb58f08a0fc 100644
--- a/src/tools/run-make-support/src/lib.rs
+++ b/src/tools/run-make-support/src/lib.rs
@@ -35,7 +35,7 @@ pub use llvm::{
     LlvmProfdata, LlvmReadobj,
 };
 pub use run::{cmd, run, run_fail, run_with_args};
-pub use rustc::{aux_build, rustc, Rustc};
+pub use rustc::{aux_build, bare_rustc, rustc, Rustc};
 pub use rustdoc::{bare_rustdoc, rustdoc, Rustdoc};
 
 #[track_caller]
diff --git a/src/tools/run-make-support/src/rustc.rs b/src/tools/run-make-support/src/rustc.rs
index 885b361f72a..a2a7c8064dc 100644
--- a/src/tools/run-make-support/src/rustc.rs
+++ b/src/tools/run-make-support/src/rustc.rs
@@ -10,6 +10,12 @@ pub fn rustc() -> Rustc {
     Rustc::new()
 }
 
+/// Construct a plain `rustc` invocation with no flags set.
+#[track_caller]
+pub fn bare_rustc() -> Rustc {
+    Rustc::bare()
+}
+
 /// Construct a new `rustc` aux-build invocation.
 #[track_caller]
 pub fn aux_build() -> Rustc {
@@ -30,7 +36,6 @@ fn setup_common() -> Command {
     let rustc = env_var("RUSTC");
     let mut cmd = Command::new(rustc);
     set_host_rpath(&mut cmd);
-    cmd.arg("-L").arg(cwd());
     cmd
 }
 
@@ -40,6 +45,14 @@ impl Rustc {
     /// Construct a new `rustc` invocation.
     #[track_caller]
     pub fn new() -> Self {
+        let mut cmd = setup_common();
+        cmd.arg("-L").arg(cwd());
+        Self { cmd }
+    }
+
+    /// Construct a bare `rustc` invocation with no flags set.
+    #[track_caller]
+    pub fn bare() -> Self {
         let cmd = setup_common();
         Self { cmd }
     }
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 70c1b055c6e..79b3f4b8295 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -62,7 +62,6 @@ run-make/issue-28595/Makefile
 run-make/issue-33329/Makefile
 run-make/issue-35164/Makefile
 run-make/issue-36710/Makefile
-run-make/issue-37839/Makefile
 run-make/issue-47551/Makefile
 run-make/issue-69368/Makefile
 run-make/issue-83045/Makefile
diff --git a/tests/run-make/issue-37839/Makefile b/tests/run-make/issue-37839/Makefile
deleted file mode 100644
index 6bad27b7bdc..00000000000
--- a/tests/run-make/issue-37839/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-all:
-	$(RUSTC) a.rs && $(RUSTC) b.rs
-	$(BARE_RUSTC) c.rs -L dependency=$(TMPDIR) --extern b=$(TMPDIR)/libb.rlib \
-		--out-dir=$(TMPDIR)
diff --git a/tests/run-make/issue-37839/a.rs b/tests/run-make/proc-macro-three-crates/a.rs
index b5dffac3ff6..b5dffac3ff6 100644
--- a/tests/run-make/issue-37839/a.rs
+++ b/tests/run-make/proc-macro-three-crates/a.rs
diff --git a/tests/run-make/issue-37839/b.rs b/tests/run-make/proc-macro-three-crates/b.rs
index 067f47c1b7a..067f47c1b7a 100644
--- a/tests/run-make/issue-37839/b.rs
+++ b/tests/run-make/proc-macro-three-crates/b.rs
diff --git a/tests/run-make/issue-37839/c.rs b/tests/run-make/proc-macro-three-crates/c.rs
index 4c7ce01b6a0..4c7ce01b6a0 100644
--- a/tests/run-make/issue-37839/c.rs
+++ b/tests/run-make/proc-macro-three-crates/c.rs
diff --git a/tests/run-make/proc-macro-three-crates/rmake.rs b/tests/run-make/proc-macro-three-crates/rmake.rs
new file mode 100644
index 00000000000..62dc547fcfb
--- /dev/null
+++ b/tests/run-make/proc-macro-three-crates/rmake.rs
@@ -0,0 +1,22 @@
+// A compiler bug caused the following issue:
+// If a crate A depends on crate B, and crate B
+// depends on crate C, and crate C contains a procedural
+// macro, compiling crate A would fail.
+// This was fixed in #37846, and this test checks
+// that this bug does not make a resurgence.
+
+//FIXME(Oneirical): ignore-cross-compile
+
+use run_make_support::{bare_rustc, cwd, rust_lib_name, rustc};
+
+fn main() {
+    rustc().input("a.rs").run();
+    rustc().input("b.rs").run();
+    let curr_dir = cwd().display().to_string();
+    bare_rustc()
+        .input("c.rs")
+        .arg(format!("-Ldependency={curr_dir}"))
+        .extern_("b", cwd().join(rust_lib_name("b")))
+        .out_dir(cwd())
+        .run();
+}