[rust] Support pbzx-compressed macOS .pkg payloads - #17691
Merged
Conversation
Newer Firefox macOS packages (starting on the beta channel, 153.0b1) wrap the cpio Payload in Apple's pbzx (LZMA-block) format instead of gzip. The apple-flat-package crate only decodes gzip, so it fed the raw pbzx bytes to the cpio reader and failed with "cpio archive error: bad magic value", leaving Selenium Manager unable to install affected Firefox builds. Read the Payload via the XAR reader, detect the pbzx magic, and decode it to the raw cpio stream before extraction. gzip and uncompressed payloads are unchanged. Adds unit tests covering stored, xz, multi-chunk, and non-pbzx inputs.
Member
|
I made this change in the browser update PR. It seems we should be downloading the dmg instead of pkg. The dmg is what we are actually using in pinned browsers. Edit: I made means (Claudio and me). |
Member
Author
|
|
1 task
AutomatedTester
added a commit
that referenced
this pull request
Jun 22, 2026
The DMG-only workaround was added because PKG extraction failed with a cpio "bad magic value" error on newer Firefox builds. That root cause was fixed in #17691 (support for pbzx-compressed macOS .pkg payloads), so the version-based PKG/DMG selection can be restored.
This was referenced Jul 11, 2026
This was referenced Jul 15, 2026
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
Selenium Manager fails to install newer Firefox builds on macOS with:
Root cause
Mozilla changed the Firefox macOS
.pkgPayload compression from gzip-cpio to Apple'spbzx(LZMA-block) format, starting on the beta channel (153.0b1). Theapple-flat-packagecrate's payload decoder only sniffs the gzip header — for anything else it passes the bytes through untouched — so thepbzx/LZMA bytes were fed straight into the cpio reader, which rejected them as bad magic.This was verified end-to-end: the downloaded
.pkgis byte-for-byte valid (SHA256 matches Mozilla's publishedSHA256SUMS); only extraction was broken. The Payload begins with70 62 7a 78(pbzx) on153.0b1versus1f 8b(gzip) on152.0/ESR.Today this affects the beta channel; once
153promotes to stable it would break all macOS Firefox installs via Selenium Manager.Fix
uncompress_pkgnow reads thePayloadvia the XAR reader, detects thepbzxmagic, and decodes it (pbzx → xz blocks → cpio) before extraction. gzip and uncompressed payloads are handled exactly as before. No new dependencies (xz2/flate2were already present).Verification
bazel test //rust:unit).firefox --browser-version beta(153.0b1, pbzx) — now extracts and resolves the browser path. ✅firefox --browser-version 121.0.1(gzip) — still works (no regression). ✅Types of changes
Checklist