Skip to content

Commit

Permalink
Check exit status of build script commands.
Browse files Browse the repository at this point in the history
The result from running a command only indicates whether it was able to spawn and does not check whether it finished successfully. This change is to check whether the exit status was successful so `make` failures are not silently ignored.

Signed-off-by: David Skidmore <davidskidmore@google.com>
  • Loading branch information
davidskidmore authored Jan 24, 2025
1 parent 6a19c8d commit 8eb4e76
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/attestation/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,18 @@ fn main() {
.to_string();

// make servtd_attest_preparation
Command::new("make")
let status = Command::new("make")
.args(["-C", &lib_path, "servtd_attest_preparation"])
.status()
.expect("failed to run make servtd_attest_preparation for attestation library!");
assert!(status.success(), "failed to build servtd_attest_preparation: {status}");

// make servtd_attest
Command::new("make")
let status = Command::new("make")
.args(["-C", &lib_path, "servtd_attest"])
.status()
.expect("failed to run make servtd_attest for attestation library!");
assert!(status.success(), "failed to build servtd_attest: {status}");

let search_dir = format!(
"{}/external/dcap_source/QuoteGeneration/quote_wrapper/servtd_attest/linux",
Expand Down

0 comments on commit 8eb4e76

Please # to comment.