-
Notifications
You must be signed in to change notification settings - Fork 273
add support for macos 11.0, arm64, universal2 #319
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
Changes from 4 commits
a785aff
af377ea
7a47859
194973b
53ae010
caad9e6
df34896
b92cf9a
68f9dc3
0e0921b
48e8f1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -389,7 +389,7 @@ def _mac_binary_formats(version, cpu_arch): | |
| if cpu_arch == "x86_64": | ||
| if version < (10, 4): | ||
| return [] | ||
| formats.extend(["intel", "fat64", "fat32"]) | ||
| formats.extend(["intel", "fat64", "fat32", "universal2"]) | ||
|
|
||
| elif cpu_arch == "i386": | ||
| if version < (10, 4): | ||
|
|
@@ -407,7 +407,12 @@ def _mac_binary_formats(version, cpu_arch): | |
| return [] | ||
| formats.extend(["fat32", "fat"]) | ||
|
|
||
| formats.append("universal") | ||
| elif cpu_arch == "arm64": | ||
| formats.append("universal2") | ||
|
|
||
| if cpu_arch in {"x86_64", "i386", "ppc64", "ppc"}: | ||
| formats.append("universal") | ||
lawrence-danna-apple marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| return formats | ||
|
|
||
|
|
||
|
|
@@ -430,15 +435,42 @@ def mac_platforms(version=None, arch=None): | |
| arch = _mac_arch(cpu_arch) | ||
| else: | ||
| arch = arch | ||
| for minor_version in range(version[1], -1, -1): | ||
| compat_version = version[0], minor_version | ||
| binary_formats = _mac_binary_formats(compat_version, arch) | ||
| for binary_format in binary_formats: | ||
| yield "macosx_{major}_{minor}_{binary_format}".format( | ||
| major=compat_version[0], | ||
| minor=compat_version[1], | ||
| binary_format=binary_format, | ||
| ) | ||
|
|
||
| if (10, 0) <= version and version < (11, 0): | ||
| # Prior to Mac OS 11, each yearly release of Mac OS bumped the | ||
| # "minor" version number. The major version was always 10. | ||
| for minor_version in range(version[1], -1, -1): | ||
| compat_version = 10, minor_version | ||
| binary_formats = _mac_binary_formats(compat_version, arch) | ||
| for binary_format in binary_formats: | ||
| yield "macosx_{major}_{minor}_{binary_format}".format( | ||
| major=10, minor=minor_version, binary_format=binary_format | ||
| ) | ||
|
|
||
| if version >= (11, 0): | ||
| # Starting with Mac OS 11, each yearly release bumps the major version | ||
| # number. The minor versions are now the midyear updates. | ||
| for major_version in range(version[0], 10, -1): | ||
| compat_version = major_version, 0 | ||
| binary_formats = _mac_binary_formats(compat_version, arch) | ||
| for binary_format in binary_formats: | ||
| yield "macosx_{major}_{minor}_{binary_format}".format( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Mac OS X" was the name of the 10.x series. It was changed to "macOS" in 2016. Maybe it's time we do the switch for the tag too starting with 11.x? (could it somehow break backwards compatibility?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changing the tag format would probably require a PEP. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm against changing the tag. This is bound to break stuff and has limited advantages. In hindsight we should have set the tag to "macos" when we introduced this, but at that time "macosx" was the better choice (esp. because Mac OS 9 was still alive at that time). |
||
| major=major_version, minor=0, binary_format=binary_format | ||
| ) | ||
brettcannon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if version >= (11, 0) and arch == "x86_64": | ||
| # Mac OS 11 on x86_64 is compatible with binaries from previous releases. | ||
| # Arm64 support was introduced in 11.0, so no arm binaries from previous | ||
lawrence-danna-apple marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # releases exist. | ||
| for minor_version in range(16, 3, -1): | ||
brettcannon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| compat_version = 10, minor_version | ||
| binary_formats = _mac_binary_formats(compat_version, arch) | ||
| for binary_format in binary_formats: | ||
| yield "macosx_{major}_{minor}_{binary_format}".format( | ||
| major=compat_version[0], | ||
| minor=compat_version[1], | ||
| binary_format=binary_format, | ||
| ) | ||
|
|
||
|
|
||
| # From PEP 513, PEP 600 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.