fix(cli): synth verify exits non-zero when built without verify feature#125
Open
avrabe wants to merge 1 commit into
Open
fix(cli): synth verify exits non-zero when built without verify feature#125avrabe wants to merge 1 commit into
avrabe wants to merge 1 commit into
Conversation
`synth verify` is advertised as a subcommand in `synth --help` and in the top-level usage examples, but on a binary built without the `verify` feature (the default — `verify` pulls in z3-sys, which needs network and breaks `cargo install` for many users) it printed a "rebuild" hint and returned `Ok(())`. Exit code 0. A script or CI step gating on `synth verify` — the Z3 translation- validation oracle, the "did the ARM lowering preserve WASM semantics" check — would silently believe the binary was validated when in fact nothing ran. That is a correctness-of-process bug: the verify step is load-bearing on the ASIL-D path, and a success-shaped no-op defeats it. Fix: the `#[cfg(not(feature = "verify"))]` branch now `anyhow::bail!`s with a clear message and a non-zero exit. A consumer that runs `synth verify` and checks the exit code now correctly sees failure when the binary cannot verify. Also marks the `Verify` subcommand's help text as requiring `--features verify`, so `synth --help` is honest about the dependency. Not changed: `verify` stays a non-default feature. Making it default would pull z3-sys into every `cargo install`, which needs network at build time and is the reason it is opt-in. The fix is to fail honestly, not to force the dependency on everyone. Closes #124.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #124.
synth verifyis advertised insynth --helpand the usage examples, but on a binary built without theverifyfeature it printed a "rebuild" hint and returnedOk(())— exit code 0. A script or CI step gating onsynth verifywould silently believe the binary was validated when nothing ran.synth verifyis the Z3 translation-validation oracle — the "did the ARM lowering preserve WASM semantics" check, load-bearing on the ASIL-D path. A success-shaped no-op defeats it.Fix
The
#[cfg(not(feature = "verify"))]branch nowanyhow::bail!s with a clear message and a non-zero exit:Also marks the
Verifysubcommand's help text as requiring--features verify.What's deliberately NOT changed
verifystays a non-default feature. Making it default would pullz3-sysinto everycargo install— z3-sys needs network at build time, which is exactly why it's opt-in. The fix is to fail honestly, not to force the dependency on everyone.Test plan
cargo install --path crates/synth-cli(no verify) →synth verify a.wasm b.elfexits non-zero with the clear message.cargo install --path crates/synth-cli --features verify→synth verifyruns Z3 validation as before.synth --helpshows the--features verifyrequirement on the Verify subcommand.🤖 Generated with Claude Code