Skip to content

Commit 715f600

Browse files
authored
Unrolled build for rust-lang#125683
Rollup merge of rust-lang#125683 - Oneirical:patience-testing-test, r=jieyouxu Rewrite `suspicious-library`, `resolve-rename` and `incr-prev-body-beyond-eof` `run-make` tests in `rmake.rs` format 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). Some oddly specific ignore flags in `incr-prev-body-beyond-eof`: ```rs // ignore-none // ignore-nvptx64-nvidia-cuda ``` it could be interesting to run a try job, but it seems there is no nvidia-cuda in the CI settings (`jobs.yml`). try-job: armhf-gnu
2 parents 5ee2dfd + 59e2074 commit 715f600

File tree

9 files changed

+64
-37
lines changed

9 files changed

+64
-37
lines changed

src/tools/compiletest/src/header.rs

+1
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
799799
"ignore-none",
800800
"ignore-nto",
801801
"ignore-nvptx64",
802+
"ignore-nvptx64-nvidia-cuda",
802803
"ignore-openbsd",
803804
"ignore-pass",
804805
"ignore-remote",

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

+6
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ impl Rustc {
6969
self
7070
}
7171

72+
/// Add a suffix in each output filename.
73+
pub fn extra_filename(&mut self, suffix: &str) -> &mut Self {
74+
self.cmd.arg(format!("-Cextra-filename={suffix}"));
75+
self
76+
}
77+
7278
/// Specify type(s) of output files to generate.
7379
pub fn emit(&mut self, kinds: &str) -> &mut Self {
7480
self.cmd.arg(format!("--emit={kinds}"));

src/tools/tidy/src/allowed_run_make_makefiles.txt

-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ run-make/inaccessible-temp-dir/Makefile
7070
run-make/include_bytes_deps/Makefile
7171
run-make/incr-add-rust-src-component/Makefile
7272
run-make/incr-foreign-head-span/Makefile
73-
run-make/incr-prev-body-beyond-eof/Makefile
7473
run-make/incremental-debugger-visualizer/Makefile
7574
run-make/incremental-session-fail/Makefile
7675
run-make/inline-always-many-cgu/Makefile
@@ -202,7 +201,6 @@ run-make/remap-path-prefix-dwarf/Makefile
202201
run-make/remap-path-prefix/Makefile
203202
run-make/reproducible-build-2/Makefile
204203
run-make/reproducible-build/Makefile
205-
run-make/resolve-rename/Makefile
206204
run-make/return-non-c-like-enum-from-c/Makefile
207205
run-make/return-non-c-like-enum/Makefile
208206
run-make/rlib-chain/Makefile
@@ -232,7 +230,6 @@ run-make/static-pie/Makefile
232230
run-make/staticlib-blank-lib/Makefile
233231
run-make/staticlib-dylib-linkage/Makefile
234232
run-make/std-core-cycle/Makefile
235-
run-make/suspicious-library/Makefile
236233
run-make/symbol-mangling-hashed/Makefile
237234
run-make/symbol-visibility/Makefile
238235
run-make/symbols-include-type-name/Makefile

tests/run-make/incr-prev-body-beyond-eof/Makefile

-19
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// After modifying the span of a function, if the length of
2+
// the span remained the same but the end line number became different,
3+
// this would cause an internal compiler error (ICE), fixed in #76256.
4+
5+
// This test compiles main.rs twice, first with end line 16 and
6+
// then with end line 12. If compilation is successful, the end line
7+
// was hashed by rustc in addition to the span length, and the fix still
8+
// works.
9+
10+
//@ ignore-none
11+
// reason: no-std is not supported
12+
13+
//@ ignore-nvptx64-nvidia-cuda
14+
// FIXME: can't find crate for `std`
15+
16+
use run_make_support::{rustc, tmp_dir};
17+
use std::fs;
18+
19+
fn main() {
20+
// FIXME(Oneirical): Use run_make_support::fs_wrapper here.
21+
fs::create_dir(tmp_dir().join("src")).unwrap();
22+
fs::create_dir(tmp_dir().join("incr")).unwrap();
23+
fs::copy("a.rs", tmp_dir().join("src/main.rs")).unwrap();
24+
rustc().incremental(tmp_dir().join("incr")).input(tmp_dir().join("src/main.rs")).run();
25+
fs::copy("b.rs", tmp_dir().join("src/main.rs")).unwrap();
26+
rustc().incremental(tmp_dir().join("incr")).input(tmp_dir().join("src/main.rs")).run();
27+
}

tests/run-make/resolve-rename/Makefile

-7
This file was deleted.
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// If a library is compiled with -C extra-filename, the rust compiler
2+
// will take this into account when searching for libraries. However,
3+
// if that library is then renamed, the rust compiler should fall back
4+
// to its regular library location logic and not immediately fail to find
5+
// the renamed library.
6+
// See https://github.com/rust-lang/rust/pull/49253
7+
8+
use run_make_support::{rustc, tmp_dir};
9+
use std::fs;
10+
fn main() {
11+
rustc().extra_filename("-hash").input("foo.rs").run();
12+
rustc().input("bar.rs").run();
13+
fs::rename(tmp_dir().join("libfoo-hash.rlib"), tmp_dir().join("libfoo-another-hash.rlib"))
14+
.unwrap();
15+
rustc().input("baz.rs").run();
16+
}

tests/run-make/suspicious-library/Makefile

-8
This file was deleted.
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// This test creates some fake dynamic libraries with nothing inside,
2+
// and checks if rustc avoids them and successfully compiles as a result.
3+
4+
//@ ignore-cross-compile
5+
6+
use run_make_support::{dynamic_lib, rustc};
7+
use std::fs::File;
8+
9+
fn main() {
10+
rustc().input("foo.rs").arg("-Cprefer-dynamic").run();
11+
File::create(dynamic_lib("foo-something-special")).unwrap();
12+
File::create(dynamic_lib("foo-something-special2")).unwrap();
13+
rustc().input("bar.rs").run();
14+
}

0 commit comments

Comments
 (0)