Repository navigation
build: preserve IPA output on extraction failure - #38
Merged
Interlap01 merged 1 commit intoOct 6, 2026
Merged
Conversation
Collaborator
|
Lgtm. Thank you! |
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.
Description
A failed GitHub artifact extraction leaves a corrupt
.ipain the output directory, or overwrites a previously valid file at the same destination. Save to a temporary file in the destination directory and rename it only after copying and closing succeed. Remove the temporary file on every exit path, matching the existing external-provider download pattern.Reproduction and root cause
Create an artifact ZIP containing a stored
App.ipaentry and flip one payload byte without updating its CRC.extractIPAFromZipreturnszip.ErrChecksum, butextractFilehas already created/truncated the final destination and copied the corrupt bytes into it. The failed build therefore leaves a fresh*.ipathat later commands can select throughipa.Newest.The regression test reproduces both cases: no previous destination and an existing destination. Before the fix, both fail because corrupt bytes remain at the final path. After the fix, no new IPA is published and an existing file retains its original bytes.
Related Issue
No existing issue; checked open issues and pull requests for duplicates.
Type of Change
Checklist
go vet ./...passesTesting
Passed locally on macOS arm64:
go test ./internal/build -run TestExtractIPAFromZip -count=1 -v: checksum failures preserve or omit the destination, successful extraction replaces the destination, and a rename failure leaves no temporary file.go test -race ./...(Go 1.27.1).GOTOOLCHAIN=go1.26.0 go test ./....GOTOOLCHAIN=go1.24.0 go test ./internal/build.go vet ./...,gofmt -l .(empty),golangci-lint run --timeout=5m(v2.14.0, 0 issues), andgit diff --check.Cloud builds and live Apple uploads were not run; the failure is reproduced entirely with a local ZIP fixture.