Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
freakboy3742 opened this issue Feb 6, 2025 · 2 comments
Closed
Labels
docs Documentation in the Doc dir OS-mac type-bug An unexpected behavior, bug, or error

Comments

@freakboy3742
Copy link
Contributor

freakboy3742 commented Feb 6, 2025

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

@ronaldoussoren
Copy link
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.

@freakboy3742
Copy link
Contributor Author

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 😄

freakboy3742 added a commit that referenced this issue Feb 22, 2025
…DK. (#130389)

Document the architectures supported by macOS universal SDK configuration flags, 
and add details on wheel tag naming.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 22, 2025
…rsal SDK. (pythonGH-130389)

Document the architectures supported by macOS universal SDK configuration flags,
and add details on wheel tag naming.
(cherry picked from commit 474c388)

Co-authored-by: Russell Keith-Magee <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 22, 2025
…rsal SDK. (pythonGH-130389)

Document the architectures supported by macOS universal SDK configuration flags,
and add details on wheel tag naming.
(cherry picked from commit 474c388)

Co-authored-by: Russell Keith-Magee <[email protected]>
freakboy3742 added a commit that referenced this issue Feb 22, 2025
…ersal SDK. (GH-130389) (#130449)

Document the architectures supported by macOS universal SDK configuration flags,
and add details on wheel tag naming.
(cherry picked from commit 474c388)

Co-authored-by: Russell Keith-Magee <[email protected]>
freakboy3742 added a commit that referenced this issue Feb 22, 2025
…ersal SDK. (GH-130389) (#130450)

Document the architectures supported by macOS universal SDK configuration flags,
and add details on wheel tag naming.
(cherry picked from commit 474c388)

Co-authored-by: Russell Keith-Magee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir OS-mac type-bug An unexpected behavior, bug, or error
Projects
Status: Todo
Development

No branches or pull requests

2 participants