wheel: wheel 0.36.0 fails on macOS 11 (Big Sur) when MACOSX_DEPLOYMENT_TARGET=11
On previously macOS versions, the major version were 10.15, 10.14, etc. But on macOS Big Sur (11.x.y) the major version is now 11, and the next major version will be 12, etc.
Therefore, because MACOSX_DEPLOYMENT_TARGET typically specifies a major macOS version, it is now natural to have MACOSX_DEPLOYMENT_TARGET=11. This is accepted by all system build tools and compilers.
This triggered several build failures in cpython 3.9.0, which are now fixed (see https://github.com/python/cpython/pull/23556). This is also triggering problems now in wheel. We are seeing this error as part of Homebrew build and testing (https://github.com/Homebrew/homebrew-core/pull/66063#issuecomment-737538309).
I install Python 3.9.0, with an upstream patch (https://github.com/python/cpython/pull/23556), and wheel 0.36.0. Then I run pip3 install markupsafe, which gives the following error:
File "/usr/local/Cellar/python@3.9/3.9.0_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 337, in run
impl_tag, abi_tag, plat_tag = self.get_tag()
File "/usr/local/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 260, in get_tag
plat_name = get_platform(self.bdist_dir)
File "/usr/local/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 52, in get_platform
result = calculate_macosx_platform_tag(archive_root, result)
File "/usr/local/lib/python3.9/site-packages/wheel/macosx_libfile.py", line 356, in calculate_macosx_platform_tag
assert len(base_version) == 2
AssertionError
----------------------------------------
ERROR: Failed building wheel for markupsafe
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 5
- Comments: 23 (17 by maintainers)
@emeryberger, it actually works for Apple Silicon. Some packages will build their own separate dedicated environment with an old wheel version when installed (e.g. numpy). You need to write an issue for each package to make the wheel version >=0.36.1.
What’s happening?
calculate_macosx_platform_tagis called withplatform_tagbeingmacosx-11-x86_64. Thereforebase_versionbecomes(11, ), and this triggers the assert on line 356. I’m not actually sure why that assert is there, it seems contradictory with the check onlen(base_version)above.Even if we remove that assert, or the platform_tag were different: if
MACOSX_DEPLOYMENT_TARGET=11is set in the environment, then the code below will setbase_versiontodeploy_target, which will be(11, ). That’s not wrong, but it will trigger another assert on line 371.If I simply remove the two asserts, then I can run
pip3 install markupsafeand I get this behaviour:I am not sure whether the platform tag
macosx_11_0_x86_64is what is expected here, or if it should bemacosx_11_x86_64(i.e., only recording the major macOS version).