You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Make sure build fails if command returns non-zero code (#1499)
fix: Make sure build fails if command returns non-zero code
**What does this PR do?**
This PR introduces a `wait_for_success` helper and uses it throughout
the builder crate to ensure that the status code for a command is
checked, and the build fails if it is non-zero.
**Motivation:**
I ran into this very sharp edge as I was experimenting with some
build changes in libdatadog: whenever an external command exits
with a non-zero status code, the build would continue, rather
than fail immediately.
This happens because we were not previously checking for the
command status code. This change fixes this.
**Additional Notes:**
N/A
**How to test the change?**
Since the error code only gets triggered when something goes wrong,
you won't see it by default. To test this, I replaced command
invocations (to e.g. `cargo` in `profiling.rs`) with a call to `false`:
this is an actual command that runs successfully, but then returns
a non-zero code and thus can be used to see this change in action.
Make linters happy
Co-authored-by: ivo.anjo <[email protected]>
0 commit comments