File tree Expand file tree Collapse file tree 4 files changed +19
-6
lines changed 
src/tools/run-make-support 
tests/run-make/invalid-library Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,12 @@ dependencies = [
228228 " backtrace"  ,
229229]
230230
231+ [[package ]]
232+ name  = " ar" 
233+ version  = " 0.9.0" 
234+ source  = " registry+https://github.com/rust-lang/crates.io-index" 
235+ checksum  = " d67af77d68a931ecd5cbd8a3b5987d63a1d1d1278f7f6a60ae33db485cdebb69" 
236+ 
231237[[package ]]
232238name  = " ar_archive_writer" 
233239version  = " 0.2.0" 
@@ -3394,6 +3400,7 @@ dependencies = [
33943400name  = " run_make_support" 
33953401version  = " 0.2.0" 
33963402dependencies  = [
3403+  " ar"  ,
33973404 " gimli 0.28.1"  ,
33983405 " object 0.34.0"  ,
33993406 " regex"  ,
Original file line number Diff line number Diff line change @@ -9,3 +9,4 @@ similar = "2.5.0"
99wasmparser  = " 0.118.2" 
1010regex  = " 1.8"   #  1.8 to avoid memchr 2.6.0, as 2.5.0 is pinned in the workspace
1111gimli  = " 0.28.1" 
12+ ar  = " 0.9.0" 
Original file line number Diff line number Diff line change @@ -63,10 +63,15 @@ pub fn target() -> String {
6363
6464/// `AR` 
6565#[ track_caller]  
66- #[ must_use]  
67- pub  fn  ar_command ( )  -> Command  { 
68-     let  ar_path = env_var ( "AR" ) ; 
69-     Command :: new ( ar_path) 
66+ pub  fn  ar ( inputs :  & [ impl  AsRef < Path > ] ,  output_path :  impl  AsRef < Path > )  { 
67+     let  output = fs:: File :: create ( & output_path) . expect ( & format ! ( 
68+         "the file in path \" {}\"  could not be created" , 
69+         output_path. as_ref( ) . display( ) 
70+     ) ) ; 
71+     let  mut  builder = ar:: Builder :: new ( output) ; 
72+     for  input in  inputs { 
73+         builder. append_path ( input) . unwrap ( ) ; 
74+     } 
7075} 
7176
7277/// Check if target is windows-like. 
Original file line number Diff line number Diff line change 11use  run_make_support:: fs_wrapper:: create_file; 
2- use  run_make_support:: { ar_command ,  rustc} ; 
2+ use  run_make_support:: { ar ,  rustc} ; 
33
44fn  main ( )  { 
55    create_file ( "lib.rmeta" ) ; 
6-     ar_command ( ) . arg ( "crus" ) . arg ( " libfoo-ffffffff-1.0.rlib") . arg ( "lib.rmeta" ) . run ( ) ; 
6+     ar ( & [ "lib.rmeta" ] ,   " libfoo-ffffffff-1.0.rlib") ; 
77    rustc ( ) . input ( "foo.rs" ) . run_fail ( ) . assert_stderr_contains ( "found invalid metadata" ) ; 
88} 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments