Skip to content

macOS combined architecture platform tags are undocumented, and inconsistent #129712

Description

@freakboy3742

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:

cpython/Lib/_osx_support.py

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

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    docsDocumentation in the Doc dir
    on Feb 6, 2025
  2. ronaldoussoren commented on Feb 6, 2025

    @ronaldoussoren
    Contributor

    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.

  3. freakboy3742 commented on Feb 7, 2025

    @freakboy3742
    ContributorAuthor

    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.

    Agreed; but there are evidently plenty of museum curators in our user base 😄

  4. added a commit that references this issue on Feb 22, 2025
  5. added 2 commits that reference this issue on Feb 22, 2025
  6. added 2 commits that reference this issue on Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-macdocsDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions