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 {
60
60
pub fn apply ( & self , dir : & Path ) -> anyhow:: Result < ( ) > {
61
61
log:: debug!( "applying {} to {:?}" , self . name, dir) ;
62
62
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
+ } ;
65
76
66
77
command_output ( & mut cmd) ?;
67
78
You can’t perform that action at this time.
0 commit comments