From 60480db5b8359fa9877e175d100cad4b3a3d40c3 Mon Sep 17 00:00:00 2001 From: Julio Gonzalez Date: Thu, 26 Sep 2024 15:42:16 +0200 Subject: [PATCH] Wait for spawn child in order to avoid concurrency problems. --- builder/build/arch/linux.rs | 6 ++++-- builder/build/arch/musl.rs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/builder/build/arch/linux.rs b/builder/build/arch/linux.rs index bb05ce240..9fbc7eccf 100644 --- a/builder/build/arch/linux.rs +++ b/builder/build/arch/linux.rs @@ -58,10 +58,12 @@ pub fn strip_libraries(lib_path: &str) { } pub fn fix_soname(lib_path: &str) { - Command::new("patchelf") + let mut patch_soname = Command::new("patchelf") .arg("--set-soname") .arg(PROF_DYNAMIC_LIB) .arg(lib_path.to_owned() + "/" + PROF_DYNAMIC_LIB) .spawn() - .expect("failed to change the soname"); + .expect("failed to span patchelf"); + + patch_soname.wait().expect("failed to change the soname"); } diff --git a/builder/build/arch/musl.rs b/builder/build/arch/musl.rs index 0e2e3be0f..74734bf6d 100644 --- a/builder/build/arch/musl.rs +++ b/builder/build/arch/musl.rs @@ -58,10 +58,12 @@ pub fn strip_libraries(lib_path: &str) { } pub fn fix_soname(lib_path: &str) { - Command::new("patchelf") + let mut patch_soname = Command::new("patchelf") .arg("--set-soname") .arg(PROF_DYNAMIC_LIB) .arg(lib_path) .spawn() - .expect("failed to change the soname"); + .expect("failed to spawn patchelf"); + + patch_soname.wait().expect("failed to change the soname"); }