Repository navigation
macOS combined architecture platform tags are undocumented, and inconsistent #129712
Description
Bug report
Bug description:
While formalising the definition of platform tags for iOS and Android in packaging.python.org/pull/1804, I notice that macOS combined architecture tags (e.g., universal2) aren't documented.
The canonical definition is here:
Lines 546 to 562 in cdcacec
| if len(archs) == 1: | |
| machine = archs[0] | |
| elif archs == ('arm64', 'x86_64'): | |
| machine = 'universal2' | |
| elif archs == ('i386', 'ppc'): | |
| machine = 'fat' | |
| elif archs == ('i386', 'x86_64'): | |
| machine = 'intel' | |
| elif archs == ('i386', 'ppc', 'x86_64'): | |
| machine = 'fat3' | |
| elif archs == ('ppc64', 'x86_64'): | |
| machine = 'fat64' | |
| elif archs == ('i386', 'ppc', 'ppc64', 'x86_64'): | |
| machine = 'universal' | |
| else: | |
| raise ValueError( | |
| "Don't know machine value for archs=%r" % (archs,)) |
However, these tags aren't documented as part of the mac usage guide, beyond a passing reference to the default installers being "universal2".
The documentation of the configure options that enable these builds add an extra layer of complexity, as they describe options that exist, but (a) the names don't match the values returned by sysconfig.get_platform(), and (b) any mapping between the two isn't documented. What architectures are built for a "3-way" build? What's the corresponding wheel platform tag? (i386, ppc and x86_64; and fat3, respectively)
These options are almost entirely anachronistic as Python isn't maintaining support for i386, ppc or ppc64. The "fix" here might be to remove support for all tags other than universal2.
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsTodo
Activity
ronaldoussoren commentedon Feb 6, 2025
These have grown organically, and it shows. We've been very conservative with removing support for old systems (one might say, too conservative) because some users actually do run python on ancient macOS systems.
That said, my personal opinion is that the only 3 tags that are useful on macOS are arm64, x86_64 and universal2. Any system that needs one of the others is basically for a museum.
BTW The universal2 tag intentionally mirrors Apple's "Universal 2" description for fat binaries that support arm64 and x86_64.
@ned-deily might disagree though.
freakboy3742 commentedon Feb 7, 2025
Agreed; but there are evidently plenty of museum curators in our user base 😄
gh-129712: Document the wheels tags corresponding to each universal S…
pythongh-129712: Document the wheels tags corresponding to each unive…
pythongh-129712: Document the wheels tags corresponding to each unive…
[3.13] gh-129712: Document the wheels tags corresponding to each univ…
[3.12] gh-129712: Document the wheels tags corresponding to each univ…