Skip to content

Commit d392d68

Browse files
authored
Rollup merge of #125227 - Oneirical:seventh, r=jieyouxu
Migrate `run-make/issue-30063` to `rmake` Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). (Sorry about the [inconvenience](#125224 (comment)) of all these PRs, this is the last one batched for today. I will discuss how we can cut these down a bit.) The last check was previously commented out in the Makefile, and I have readded it. If it fails the CI, this can be reconsidered.
2 parents e282b1f + f377ea1 commit d392d68

File tree

4 files changed

+38
-37
lines changed

4 files changed

+38
-37
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ run-make/issue-25581/Makefile
101101
run-make/issue-26006/Makefile
102102
run-make/issue-26092/Makefile
103103
run-make/issue-28595/Makefile
104-
run-make/issue-30063/Makefile
105104
run-make/issue-33329/Makefile
106105
run-make/issue-35164/Makefile
107106
run-make/issue-36710/Makefile

tests/run-make/issue-30063/Makefile

-36
This file was deleted.
File renamed without changes.
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// When rustc received 4 codegen-units, an output path and an emit flag all simultaneously,
2+
// this could cause an annoying recompilation issue, uselessly lengthening the build process.
3+
// A fix was delivered, which resets codegen-units to 1 when necessary,
4+
// but as it directly affected the way codegen-units are manipulated,
5+
// this test was created to check that this fix did not cause compilation failures.
6+
// See https://github.com/rust-lang/rust/issues/30063
7+
8+
//@ ignore-cross-compile
9+
10+
use run_make_support::{rustc, tmp_dir};
11+
use std::fs;
12+
13+
fn compile(output_file: &str, emit: Option<&str>) {
14+
let mut rustc = rustc();
15+
let rustc = rustc.codegen_units(4).output(tmp_dir().join(output_file)).input("foo.rs");
16+
if let Some(emit) = emit {
17+
rustc.emit(emit);
18+
}
19+
rustc.run();
20+
}
21+
22+
fn main() {
23+
let flags = [
24+
("foo-output", None),
25+
("asm-output", Some("asm")),
26+
("bc-output", Some("llvm-bc")),
27+
("ir-output", Some("llvm-ir")),
28+
("link-output", Some("link")),
29+
("obj-output", Some("obj")),
30+
("dep-output", Some("dep-info")),
31+
("multi-output", Some("asm,obj")),
32+
];
33+
for (output_file, emit) in flags {
34+
fs::remove_file(output_file).unwrap_or_default();
35+
compile(output_file, emit);
36+
fs::remove_file(output_file);
37+
}
38+
}

0 commit comments

Comments
 (0)