Skip to content

Commit fe6feb8

Browse files
committed
rewrite long-linker-command-lines to rmake
1 parent 342b807 commit fe6feb8

File tree

4 files changed

+21
-23
lines changed

4 files changed

+21
-23
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ run-make/libtest-json/Makefile
1313
run-make/libtest-junit/Makefile
1414
run-make/libtest-thread-limit/Makefile
1515
run-make/long-linker-command-lines-cmd-exe/Makefile
16-
run-make/long-linker-command-lines/Makefile
1716
run-make/macos-deployment-target/Makefile
1817
run-make/min-global-align/Makefile
1918
run-make/native-link-modifier-bundle/Makefile

tests/run-make/long-linker-command-lines/Makefile

-8
This file was deleted.

tests/run-make/long-linker-command-lines/foo.rs

+2-14
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
// This is a test which attempts to blow out the system limit with how many
2-
// arguments can be passed to a process. This'll successively call rustc with
3-
// larger and larger argument lists in an attempt to find one that's way too
4-
// big for the system at hand. This file itself is then used as a "linker" to
5-
// detect when the process creation succeeds.
6-
//
7-
// Eventually we should see an argument that looks like `@` as we switch from
8-
// passing literal arguments to passing everything in the file.
9-
101
use std::collections::HashSet;
112
use std::env;
123
use std::fs::{self, File};
@@ -43,8 +34,7 @@ fn read_linker_args(path: &Path) -> String {
4334
}
4435

4536
fn main() {
46-
let tmpdir = PathBuf::from(env::var_os("TMPDIR").unwrap());
47-
let ok = tmpdir.join("ok");
37+
let ok = PathBuf::from("ok");
4838
if env::var("YOU_ARE_A_LINKER").is_ok() {
4939
if let Some(file) = env::args_os().find(|a| a.to_string_lossy().contains("@")) {
5040
let file = file.to_str().expect("non-utf8 file argument");
@@ -57,16 +47,14 @@ fn main() {
5747
let me_as_linker = format!("linker={}", env::current_exe().unwrap().display());
5848
for i in (1..).map(|i| i * 100) {
5949
println!("attempt: {}", i);
60-
let file = tmpdir.join("bar.rs");
50+
let file = PathBuf::from("bar.rs");
6151
let mut expected_libs = write_test_case(&file, i);
6252

6353
drop(fs::remove_file(&ok));
6454
let output = Command::new(&rustc)
6555
.arg(&file)
6656
.arg("-C")
6757
.arg(&me_as_linker)
68-
.arg("--out-dir")
69-
.arg(&tmpdir)
7058
.env("YOU_ARE_A_LINKER", "1")
7159
.output()
7260
.unwrap();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// This is a test which attempts to blow out the system limit with how many
2+
// arguments can be passed to a process. This'll successively call rustc with
3+
// larger and larger argument lists in an attempt to find one that's way too
4+
// big for the system at hand. This file itself is then used as a "linker" to
5+
// detect when the process creation succeeds.
6+
//
7+
// Eventually we should see an argument that looks like `@` as we switch from
8+
// passing literal arguments to passing everything in the file.
9+
// See https://github.com/rust-lang/rust/issues/41190
10+
11+
//@ ignore-cross-compile
12+
// Reason: the compiled binary is executed
13+
14+
use run_make_support::{run, rustc};
15+
16+
fn main() {
17+
rustc().input("foo.rs").arg("-g").opt().run();
18+
run("foo");
19+
}

0 commit comments

Comments
 (0)