There was an error while loading. Please reload this page.
2 parents 2120e3b + 28ec75e commit 3982771Copy full SHA for 3982771
1 file changed
collector/src/compile/benchmark/patch.rs
@@ -60,8 +60,19 @@ impl Patch {
60
pub fn apply(&self, dir: &Path) -> anyhow::Result<()> {
61
log::debug!("applying {} to {:?}", self.name, dir);
62
63
- let mut cmd = Command::new("git");
64
- cmd.current_dir(dir).args(["apply"]).arg(&*self.path);
+ // It's harder to use patch(1) in pure Windows MSVC toolchain
+ 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
71
+ .current_dir(dir)
72
+ .args(["-p1", "-i"])
73
+ .arg(&*self.path);
74
75
+ };
76
77
command_output(&mut cmd)?;
78
0 commit comments