@@ -15,16 +15,14 @@ mod common;
15
15
16
16
fn main ( ) {
17
17
let ( work_dir, base) = if env:: var ( "DOCS_RS" ) . is_ok ( ) {
18
- let tempdir = tempfile:: tempdir ( ) . unwrap ( ) ;
19
- let status = Command :: new ( "git" )
18
+ let out_dir = env:: var ( "OUT_DIR" ) . unwrap ( ) ;
19
+ let tempdir = tempfile:: tempdir_in ( & out_dir) . unwrap ( ) ;
20
+ let output = Command :: new ( "git" )
20
21
. args ( [ "clone" , AFL_SRC_PATH , & * tempdir. path ( ) . to_string_lossy ( ) ] )
21
- . status ( )
22
+ . output ( )
22
23
. expect ( "could not run 'git'" ) ;
23
- assert ! ( status. success( ) ) ;
24
- (
25
- tempdir. into_path ( ) ,
26
- Some ( PathBuf :: from ( env:: var ( "OUT_DIR" ) . unwrap ( ) ) ) ,
27
- )
24
+ assert ! ( output. status. success( ) , "{:#?}" , output) ;
25
+ ( tempdir. into_path ( ) , Some ( PathBuf :: from ( out_dir) ) )
28
26
} else {
29
27
( PathBuf :: from ( AFL_SRC_PATH ) , None )
30
28
} ;
@@ -46,8 +44,8 @@ fn build_afl(work_dir: &Path, base: Option<&Path>) {
46
44
if std:: env:: var ( "DEBUG" ) . as_deref ( ) == Ok ( "false" ) {
47
45
command. env_remove ( "DEBUG" ) ;
48
46
}
49
- let status = command. status ( ) . expect ( "could not run 'make'" ) ;
50
- assert ! ( status. success( ) ) ;
47
+ let output = command. output ( ) . expect ( "could not run 'make'" ) ;
48
+ assert ! ( output . status. success( ) , "{:#?}" , output ) ;
51
49
}
52
50
53
51
fn build_afl_llvm_runtime ( work_dir : & Path , base : Option < & Path > ) {
@@ -57,11 +55,11 @@ fn build_afl_llvm_runtime(work_dir: &Path, base: Option<&Path>) {
57
55
)
58
56
. expect ( "Couldn't copy object file" ) ;
59
57
60
- let status = Command :: new ( AR_CMD )
58
+ let output = Command :: new ( AR_CMD )
61
59
. arg ( "r" )
62
60
. arg ( common:: archive_file_path ( base) )
63
61
. arg ( common:: object_file_path ( base) )
64
- . status ( )
62
+ . output ( )
65
63
. expect ( "could not run 'ar'" ) ;
66
- assert ! ( status. success( ) ) ;
64
+ assert ! ( output . status. success( ) , "{:#?}" , output ) ;
67
65
}
0 commit comments