Repository: alloy-rs/svm-rs (language: rust)

Issue:
Exist status is not passed back
the solc binary installed by svm does not pass back the exist status of the real solc, making it very difficult to deal with errors in build scripts.


Discussion / hints:

Fix patch:
diff --git a/src/solc/main.rs b/src/solc/main.rs
index bce0096..d22ec3c 100644
--- a/src/solc/main.rs
+++ b/src/solc/main.rs
@@ -7,7 +7,7 @@ fn main() -> anyhow::Result<()> {
     let mut version_path = svm_lib::version_path(version.to_string().as_str());
     version_path.push(format!("solc-{}", version.to_string().as_str()));
 
-    Command::new(version_path).args(args).spawn()?;
-
-    Ok(())
+    let status = Command::new(version_path).args(args).status()?;
+    let code = status.code().unwrap_or(-1);
+    std::process::exit(code);
 }


Test patch: