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
-
10
1
use std:: collections:: HashSet ;
11
2
use std:: env;
12
3
use std:: fs:: { self , File } ;
@@ -43,8 +34,7 @@ fn read_linker_args(path: &Path) -> String {
43
34
}
44
35
45
36
fn main ( ) {
46
- let tmpdir = PathBuf :: from ( env:: var_os ( "TMPDIR" ) . unwrap ( ) ) ;
47
- let ok = tmpdir. join ( "ok" ) ;
37
+ let ok = PathBuf :: from ( "ok" ) ;
48
38
if env:: var ( "YOU_ARE_A_LINKER" ) . is_ok ( ) {
49
39
if let Some ( file) = env:: args_os ( ) . find ( |a| a. to_string_lossy ( ) . contains ( "@" ) ) {
50
40
let file = file. to_str ( ) . expect ( "non-utf8 file argument" ) ;
@@ -57,16 +47,14 @@ fn main() {
57
47
let me_as_linker = format ! ( "linker={}" , env:: current_exe( ) . unwrap( ) . display( ) ) ;
58
48
for i in ( 1 ..) . map ( |i| i * 100 ) {
59
49
println ! ( "attempt: {}" , i) ;
60
- let file = tmpdir . join ( "bar.rs" ) ;
50
+ let file = PathBuf :: from ( "bar.rs" ) ;
61
51
let mut expected_libs = write_test_case ( & file, i) ;
62
52
63
53
drop ( fs:: remove_file ( & ok) ) ;
64
54
let output = Command :: new ( & rustc)
65
55
. arg ( & file)
66
56
. arg ( "-C" )
67
57
. arg ( & me_as_linker)
68
- . arg ( "--out-dir" )
69
- . arg ( & tmpdir)
70
58
. env ( "YOU_ARE_A_LINKER" , "1" )
71
59
. output ( )
72
60
. unwrap ( ) ;
0 commit comments