File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed 
collector/src/compile/benchmark Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,19 @@ impl Patch {
6060    pub  fn  apply ( & self ,  dir :  & Path )  -> anyhow:: Result < ( ) >  { 
6161        log:: debug!( "applying {} to {:?}" ,  self . name,  dir) ; 
6262
63-         let  mut  cmd = Command :: new ( "git" ) ; 
64-         cmd. current_dir ( dir) . args ( [ "apply" ] ) . arg ( & * self . path ) ; 
63+         // It's harder to use patch(1) in pure Windows MSVC toolchain 
64+         let  mut  cmd = if  cfg ! ( all( windows,  target_env = "msvc" ) )  { 
65+             let  mut  command = Command :: new ( "git" ) ; 
66+             command. current_dir ( dir) . args ( [ "apply" ] ) . arg ( & * self . path ) ; 
67+             command
68+         }  else  { 
69+             let  mut  command = Command :: new ( "patch" ) ; 
70+             command
71+                 . current_dir ( dir) 
72+                 . args ( [ "-p1" ,  "-i" ] ) 
73+                 . arg ( & * self . path ) ; 
74+             command
75+         } ; 
6576
6677        command_output ( & mut  cmd) ?; 
6778
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments