Skip to content

Commit

Permalink
Rollup merge of rust-lang#125227 - Oneirical:seventh, r=jieyouxu
Browse files Browse the repository at this point in the history
Migrate `run-make/issue-30063` to `rmake`

Part of rust-lang#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](rust-lang#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.
  • Loading branch information
fmease committed May 23, 2024
2 parents e282b1f + f377ea1 commit d392d68
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 37 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ run-make/issue-25581/Makefile
run-make/issue-26006/Makefile
run-make/issue-26092/Makefile
run-make/issue-28595/Makefile
run-make/issue-30063/Makefile
run-make/issue-33329/Makefile
run-make/issue-35164/Makefile
run-make/issue-36710/Makefile
Expand Down
36 changes: 0 additions & 36 deletions tests/run-make/issue-30063/Makefile

This file was deleted.

File renamed without changes.
38 changes: 38 additions & 0 deletions tests/run-make/reset-codegen-1/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// When rustc received 4 codegen-units, an output path and an emit flag all simultaneously,
// this could cause an annoying recompilation issue, uselessly lengthening the build process.
// A fix was delivered, which resets codegen-units to 1 when necessary,
// but as it directly affected the way codegen-units are manipulated,
// this test was created to check that this fix did not cause compilation failures.
// See https://github.com/rust-lang/rust/issues/30063

//@ ignore-cross-compile

use run_make_support::{rustc, tmp_dir};
use std::fs;

fn compile(output_file: &str, emit: Option<&str>) {
let mut rustc = rustc();
let rustc = rustc.codegen_units(4).output(tmp_dir().join(output_file)).input("foo.rs");
if let Some(emit) = emit {
rustc.emit(emit);
}
rustc.run();
}

fn main() {
let flags = [
("foo-output", None),
("asm-output", Some("asm")),
("bc-output", Some("llvm-bc")),
("ir-output", Some("llvm-ir")),
("link-output", Some("link")),
("obj-output", Some("obj")),
("dep-output", Some("dep-info")),
("multi-output", Some("asm,obj")),
];
for (output_file, emit) in flags {
fs::remove_file(output_file).unwrap_or_default();
compile(output_file, emit);
fs::remove_file(output_file);
}
}

0 comments on commit d392d68

Please sign in to comment.