Skip to content

build: replace deprecated mholt/archiver to resolve the klauspost/compress alert - #36

Merged
toyboot4e merged 4 commits into
mainfrom
build/vulnerabilities
Nov 2, 2026
Merged

toyboot4e merged 4 commits into
mainfrom
build/vulnerabilities

Conversation

@toyboot4e

@toyboot4e toyboot4e commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Background

Proposed changes.

Resolve the alert, bump the version to 1.75.0.1 and add mise.toml to pin the go version.

  • Require klauspost/compress v1.18.7 directly, since mholt/archives v0.1.5 still requires v1.18.0.
    • This change will resolve the dependabot alert.

Tests against AVCam and an iOS device

Zips produced by the old and new binaries are identical (entries, permissions, extracted contents, symlinks):

export MAGICPOD_API_TOKEN=<token>
export MAGICPOD_ORGANIZATION=<org>
export MAGICPOD_PROJECT=<project>

$ git checkout main && go build -o /tmp/mpc-old . && git checkout build/vulnerabilities && go build -o /tmp/mpc-new .
$ cd ~/Library/Developer/Xcode/DerivedData/AVCam-dpsltwpkpzykyvcwpsyjcaobxyeu/Build/Products/Debug-iphonesimulator
$ /tmp/mpc-old upload-app -t $MAGICPOD_API_TOKEN -o $MAGICPOD_ORGANIZATION -p $MAGICPOD_PROJECT -a ./AVCam.app && mv AVCam.app.zip /tmp/old.zip
4
$ /tmp/mpc-new upload-app -t $MAGICPOD_API_TOKEN -o $MAGICPOD_ORGANIZATION -p $MAGICPOD_PROJECT -a ./AVCam.app && mv AVCam.app.zip /tmp/new.zip
5
$ diff <(unzip -Z -l /tmp/old.zip | awk 'NF>=10{print $1,$NF}' | sort -k2) <(unzip -Z -l /tmp/new.zip | awk 'NF>=10{print $1,$NF}' | sort -k2) && echo SAME
SAME

upload-file and batch run:

$ cd ~/Library/Developer/Xcode/DerivedData/AVCam-dpsltwpkpzykyvcwpsyjcaobxyeu/Build/Products/Debug-iphonesimulator
$ FILE_NO=$(/tmp/mpc-new upload-app -a ./AVCam.app) && echo $FILE_NO
6
$ /tmp/mpc-new batch-run -S <test_settings_number> -s "{\"app_file_number\":\"${FILE_NO}\"}"
$ /tmp/mpc-new batch-run -S 10 -s "{\"app_file_number\":\"${FILE_NO}\"}"
test result page:
https://app.magicpod.com/<org>/<proj>/batch-run/10/

#10 wait until 1 tests to be finished..
.........1/1 finished
...batch run succeeded

toyboot4e and others added 2 commits November 2, 2026 12:23
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This comment was marked as resolved.

toyboot4e and others added 2 commits November 2, 2026 12:58
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@toyboot4e
toyboot4e requested a review from yaumu3 November 2, 2026 04:14
@toyboot4e

Copy link
Copy Markdown
Contributor Author

Tested against a Flutter app for regression checking:

$ go build -o /tmp/mpc-new
$ rm -rf /tmp/fv && mkdir /tmp/fv && cd /tmp/fv && unzip -q ~/Downloads/fixed/flutter_view_debug.app.zip && ls
fluter_view_debug.app
$ NEW_NO=$(/tmp/mpc-new upload-app -a ./flutter_view_debug.app) && echo $NEW_NO
15
$ /tmp/mpc-new batch-run -S 10 -s "{\"app_file_number\":\"${NEW_NO}\"}"
test result page:
https://app.magicpod.com/<org>/<proj>/batch-run/12/

#12 wait until 1 tests to be finished..
.........1/1 finished
...batch run succeeded

An iSO cloud device also launched in the test case editing page.

@toyboot4e

Copy link
Copy Markdown
Contributor Author

Tested against a Flutter app with symlinks

Setup:

$ # /tmp/mcp-new: this branch's app
$ go build -o /tmp/mpc-new

$ # /tmp/mcp-new-1.38: the failure case
$ git checkout 05bcbea && mise x go@1.27.3 -- go build -o /tmp/mpc-1.38 . && git checkout build/vulnerabilities

$  mkdir /tmp/fsym && cd /tmp/fsym && unzip -q ~/Downloads/fixed/flutter_view_debug.app.zip
$ A=flutter_view_debug.app
$ mkdir -p $A/symtest/real && echo hi > $A/symtest/real/file.txt && ln -s real $A/symtest/dirlink && ln -s real/file.txt $A/symtest/filelink
$ codesign --force --deep --sign - $A
flutter_view_debug.app: replacing existing signature

Failure reproduced with 1.38:

$ /tmp/mpc-1.38 upload-app -a ./$A; rm -f $A.zip
panic: writing file 69: dirlink: read flutter_view_debug.app/symtest/dirlink: is a directory

goroutine 1 [running]:
github.com/Magic-Pod/magicpod-api-client/common.zipAppDir({0x16d182dac, 0x18})
	/var/folders/7v/vq46jzcx67g1smxg2drbt45r0000gn/T/r1380/common/common.go:122 +0x1d8
github.com/Magic-Pod/magicpod-api-client/common.UploadApp({0x103178ccf, 0x18}, {0x37eb236582d3, 0x28}, {0x37eb23654256, 0x16}, {0x37eb23656011, 0x6}, 0x37eb23721e90, {0x16d182dac, ...})
	/var/folders/7v/vq46jzcx67g1smxg2drbt45r0000gn/T/r1380/common/common.go:157 +0x134
main.uploadAppAction(0x37eb237e0160)
	/var/folders/7v/vq46jzcx67g1smxg2drbt45r0000gn/T/r1380/magicpod-api-client.go:241 +0x9c
github.com/urfave/cli.HandleAction({0x103679c08?, 0x10373da90?}, 0xa?)
	/Users/<user>/go/pkg/mod/github.com/urfave/cli@v1.22.5/app.go:524 +0xd8
github.com/urfave/cli.Command.Run({{0x10316f2ea, 0xa}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x103177e41, 0x17}, {0x0, ...}, ...}, ...)
	/Users/<user>/go/pkg/mod/github.com/urfave/cli@v1.22.5/command.go:173 +0x4a4
github.com/urfave/cli.(*App).Run(0x37eb237da000, {0x37eb23728040, 0x4, 0x4})
	/Users/<user>/go/pkg/mod/github.com/urfave/cli@v1.22.5/app.go:277 +0x7cc
main.main()
	/var/folders/7v/vq46jzcx67g1smxg2drbt45r0000gn/T/r1380/magicpod-api-client.go:166 +0x864

Succeeded in this branch:

$ NEW_NO=$(/tmp/mpc-new upload-app -a ./$A) && mv $A.zip new.zip
$ /tmp/mpc-new batch-run -S 10 -s "{\"app_file_number\":\"${NEW_NO}\"}"1
test result page:
https://app.magicpod.com/<org>/<proj>/batch-run/14/

#14 wait until 1 tests to be finished..
.........1/1 finished
...batch run succeeded

@yaumu3 yaumu3 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. #26 was the main concern, but your tests show there's no problem.

@toyboot4e
toyboot4e merged commit b85d789 into main Nov 2, 2026
2 checks passed
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.

3 participants

⌂ 换网址