Repository navigation
fix(build): activate Cargo binary and receipt as a recoverable pair - #1087
hiyouwhatsapp wants to merge 1 commit into
Conversation
…ansaction Stage and validate both outputs before replacing either, use the existing backup-aware replacement utility, and preserve the executable mode of the compiled binary Cover receipt conflicts, successful activation, rollback, retained recovery backups and missing previous receipts Signed-off-by: hiyouwhatsapp <89997383+hiyouwhatsapp@users.noreply.github.com>
LunaStev
left a comment
There was a problem hiding this comment.
Reviewed exact head b997c40e0fa79b59cd913549fd7f1322f114adda against canonical base 021140cf.
[P1] The tooling crate cannot compile. activate_compiler_output_with(..., fs::rename) passes the generic fs::rename function item to a callback requiring independent borrowed-Path lifetimes. Rust 1.89 reports four errors: implementation of FnMut/FnOnce is not general enough at tools/src/build.rs:131. I reproduced this locally with:
cargo +1.89.0 check --locked --jobs 2 -p wave-tools --all-targetsExact-head CI 42406972239 fails the shared matrix bootstrap with the same diagnostics, so downstream jobs do not validate the replacement transaction.
Please adapt this call using a closure such as |source, destination| fs::rename(source, destination) or an appropriately typed wrapper, keeping the existing rollback/recovery behavior. Then run the five new output transaction tests and the existing storage transaction coverage; none of these new tests can run on the submitted head because compilation fails.
[P2] The pinned full formatting check also fails at tools/src/build.rs around535 and545. Generate formatting with Rust1.89.0 rather than manually matching a layout.
Validation after repair:
cargo +1.89.0 fmt --all -- --check
cargo +1.89.0 check --locked --jobs 2 -p wave-tools --all-targets
cargo +1.89.0 test --locked --jobs 2 -p wave-tools --lib build_output_tests
cargo +1.89.0 test --locked --jobs 2 -p wave-tools --test artifactsNo contributor branch edit or CI retry was performed.
| /// The prior pair is restored by the shared replacement transaction if either | ||
| /// activation fails, and its backups are retained if restoration itself fails. | ||
| fn activate_compiler_output(binary: &Path, output: &Path, receipt: &Value) -> Result<()> { | ||
| activate_compiler_output_with(binary, output, receipt, fs::rename) |
There was a problem hiding this comment.
[P1] Passing generic fs::rename directly does not satisfy the callback lifetime bound on Rust 1.89: the crate fails with four FnMut/FnOnce-not-general-enough errors. Reproduced with cargo check -p wave-tools --all-targets and confirmed in the exact-head shared-matrix CI log. Use a closure or typed wrapper here, then execute the new rollback tests; preserve the transaction guarantees.
LunaStev
left a comment
There was a problem hiding this comment.
Reviewed the code changes. Approved based on code review; CI status is not a merge gate for this decision.
Retracted at the repository owner's request.
Maintainer Notice — No Response to Requested ChangesMore than 3 days (72 hours) have passed since a maintainer requested changes to this pull request. During this period, we have not received a response or any follow-up commits addressing the requested changes. To keep the contribution and review process active, pull requests that receive no response or follow-up commits within 3 days of a maintainer's change request are subject to closure due to inactivity. This policy applies regardless of CI status or previous approval comments. This PR is therefore eligible for closure due to inactivity. You are welcome to submit a new pull request once you are ready to address the outstanding feedback. Thank you for your contribution to Wave. |
Fixes #1079
The build-cargo helper previously replaced the compiler binary before writing its build.json receipt, so a receipt failure could discard the previous successful compiler
I now prepare and validate both destinations and stage the binary and serialized receipt before any replacement
Both files are activated through the existing backup-aware multi-file replacement transaction, restoring the previous output pair on failure or retaining recovery backups when restoration cannot complete
A conflicting receipt directory or symlink is rejected before touching the previous output, and the newly staged compiler retains its executable permissions
Added five focused regression tests for successful matching binary/receipt activation, a conflicting receipt directory, receipt activation rollback, restoration failure with retained backups, and a previously absent receipt
Cargo invocation, receipt identity validation and Meson orchestration are unchanged
The Rust suite has not been run locally, so CI still needs to verify the patch