Skip to content

fix(build): activate Cargo binary and receipt as a recoverable pair - #1087

Open
hiyouwhatsapp wants to merge 1 commit into
wavefnd:masterfrom
hiyouwhatsapp:fix/cargo-binary-receipt-transaction-1079
Open

hiyouwhatsapp wants to merge 1 commit into
wavefnd:masterfrom
hiyouwhatsapp:fix/cargo-binary-receipt-transaction-1079

Conversation

@hiyouwhatsapp

Copy link
Copy Markdown
Contributor

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

…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>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve the previous build output when writing its Cargo receipt fails

1 participant