Fix `cppwinrt` build concurrency (#3289)
This commit is contained in:
Родитель
bf53fa6d7e
Коммит
26635b2c00
|
@ -14,7 +14,13 @@ where
|
|||
let mut path = std::env::temp_dir();
|
||||
path.push(format!("cppwinrt-{VERSION}.exe"));
|
||||
|
||||
std::fs::write(&path, std::include_bytes!("../cppwinrt.exe")).unwrap();
|
||||
let bytes = std::include_bytes!("../cppwinrt.exe");
|
||||
|
||||
// Concurrent builds can cause this to fail, so we just make sure the bytes match on failure.
|
||||
if std::fs::write(&path, bytes).is_err() {
|
||||
assert_eq!(*bytes, *std::fs::read(&path).unwrap());
|
||||
}
|
||||
|
||||
let mut command = std::process::Command::new(&path);
|
||||
command.args(args);
|
||||
let output = command.output().expect("failed to run cppwinrt");
|
||||
|
|
Загрузка…
Ссылка в новой задаче