mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-07 11:16:37 +00:00
Ensure cargo-binstall build.rs always join the thread (#2185)
Make sure the build script waits for it to finish before exiting the whole process Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
parent
9539174474
commit
28525359d3
1 changed files with 19 additions and 13 deletions
|
@ -11,17 +11,7 @@ fn succeeds(res: io::Result<Child>) -> bool {
|
||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn emit_vergen_info() {
|
||||||
let handle = thread::spawn(|| {
|
|
||||||
println!("cargo:rerun-if-changed=build.rs");
|
|
||||||
println!("cargo:rerun-if-changed=manifest.rc");
|
|
||||||
println!("cargo:rerun-if-changed=windows.manifest");
|
|
||||||
|
|
||||||
embed_resource::compile("manifest.rc", embed_resource::NONE)
|
|
||||||
.manifest_required()
|
|
||||||
.unwrap();
|
|
||||||
});
|
|
||||||
|
|
||||||
let git = Command::new("git").arg("--version").spawn();
|
let git = Command::new("git").arg("--version").spawn();
|
||||||
|
|
||||||
// .git is usually a dir, but it also can be a file containing
|
// .git is usually a dir, but it also can be a file containing
|
||||||
|
@ -41,6 +31,22 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.emit().unwrap();
|
builder.emit().unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
thread::scope(|s| {
|
||||||
|
let handle = s.spawn(|| {
|
||||||
|
println!("cargo:rerun-if-changed=build.rs");
|
||||||
|
println!("cargo:rerun-if-changed=manifest.rc");
|
||||||
|
println!("cargo:rerun-if-changed=windows.manifest");
|
||||||
|
|
||||||
|
embed_resource::compile("manifest.rc", embed_resource::NONE)
|
||||||
|
.manifest_required()
|
||||||
|
.unwrap();
|
||||||
|
});
|
||||||
|
|
||||||
|
emit_vergen_info();
|
||||||
|
|
||||||
handle.join().unwrap();
|
handle.join().unwrap();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue