Skip to content

Ensure multi-tagged wheels are correctly identified as universal#2692

Merged
mhsmith merged 2 commits into
beeware:mainfrom
freakboy3742:multi-tag-merge
Feb 23, 2026
Merged

Ensure multi-tagged wheels are correctly identified as universal#2692
mhsmith merged 2 commits into
beeware:mainfrom
freakboy3742:multi-tag-merge

Conversation

@freakboy3742

Copy link
Copy Markdown
Member

If a macOS binary wheel has multiple platform tags, Briefcase's platform merging code won't correctly identify this fact, and will mark the wheel as requiring merging. This is because the WHEEL metadata is a multi-valued header - it contains an independent Tag entry for each tag in the wheel.

The example package that revealed this was orjson, which is tagged cp313-cp313-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl. The wheel metadata for this wheel reads:

Wheel-Version: 1.0
Generator: maturin (1.11.5)
Root-Is-Purelib: false
Tag: cp313-cp313-macosx_10_15_x86_64
Tag: cp313-cp313-macosx_11_0_arm64
Tag: cp313-cp313-macosx_10_15_universal2

Briefcase identifies the tag for this wheel as arm64, because this is the value for the Tag header that is returned from the WHEEL file (presumably because it is alphabetically last). This means Briefcase doesn't identify the wheel as universal, and so it installs a second copy of the same wheel as the "other" architecture, and then fails on merging because there is an existing x86-64 slice in the binaries being merged.

This PR adds multi-tag handling to WHEEL file processing, ensuring that any universal2 entry is identified as a universal wheel. It also ensures that if a wheel is multi-tagged as arm64 and x86-64, that is also identified as effectively universal (as no merging is required).

Fixes #2690.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@freakboy3742 freakboy3742 requested a review from mhsmith February 16, 2026 23:55
Comment thread tests/platforms/macOS/test_AppPackagesMergeMixin__find_binary_packages.py Outdated
@freakboy3742 freakboy3742 requested a review from mhsmith February 22, 2026 02:02
@mhsmith mhsmith merged commit cd2e2cf into beeware:main Feb 23, 2026
76 of 77 checks passed
@freakboy3742 freakboy3742 deleted the multi-tag-merge branch February 24, 2026 00:21
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.

Briefcase fails to package orjson with macOS's universal builds

2 participants