pypa / setuptools

Official project repository for the Setuptools build system
https://pypi.org/project/setuptools/
MIT License
2.54k stars 1.19k forks source link

[BUG] `setuptools-wrap.py` hardcodes archs for macOS which may break building of dependents #4738

Closed barracuda156 closed 2 weeks ago

barracuda156 commented 2 weeks ago

setuptools version

setuptools 75.3.0

Python version

Python 3.11.10

OS

macOS 10.6

Additional environment information

MacPorts build system

Description

Setuptools in setuptools-wrap.py hardcode macOS archs for no good reason:

assert machine in {"x86_64", "arm64", "universal2"}, f"macOS arch {machine} not understood"

This unnecessarily breaks building dependents which use this module for any other arch.

Expected behavior

Any valid combo of arch and OS should be recognized, regardless of being in current production or not. If a build happens to fail, it should fail for other reasons. (Here, for example, there are none such: blosc2 itself builds fine on all archs.)

The are 5 archs on which macOS 10+ may run (arm64, i386, ppc, ppc64, x86_64). There are several possible combos of archs in FAT builds.

How to Reproduce

Run the build of py-blosc2, for example, on powerpc or, presumably, i386. See it fail.

Output

* Getting build dependencies for wheel...
/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ptr/__init__.py:81: SetuptoolsDeprecationWarning: The test command is disabled and references to it are deprecated.
!!

        ********************************************************************************
        Please remove any references to `setuptools.command.test` in all supported versions of the affected package.

        By 2024-Nov-15, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.
        ********************************************************************************

!!
  class PyTest(orig.test):
running egg_info
writing blosc2.egg-info/PKG-INFO
writing dependency_links to blosc2.egg-info/dependency_links.txt
writing requirements to blosc2.egg-info/requires.txt
writing top-level names to blosc2.egg-info/top_level.txt
[11/08/24 14:23:59] ERROR    listing git files failed - pretending     git.py:26
                             there aren't any                                   
reading manifest file 'blosc2.egg-info/SOURCES.txt'
adding license file 'LICENSE.txt'
writing manifest file 'blosc2.egg-info/SOURCES.txt'
* Building wheel...
/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ptr/__init__.py:81: SetuptoolsDeprecationWarning: The test command is disabled and references to it are deprecated.
!!

        ********************************************************************************
        Please remove any references to `setuptools.command.test` in all supported versions of the affected package.

        By 2024-Nov-15, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.
        ********************************************************************************

!!
  class PyTest(orig.test):
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
    main()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main
    json_out["return_val"] = hook(**hook_input["kwargs"])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
    return _build_backend().build_wheel(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 434, in build_wheel
    return _build(['bdist_wheel'])
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 425, in _build
    return self._build_with_temp_dir(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 406, in _build_with_temp_dir
    self.run_setup()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 521, in run_setup
    super().run_setup(setup_script=setup_script)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 319, in run_setup
    exec(code, locals())
  File "<string>", line 24, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/skbuild/setuptools_wrap.py", line 577, in setup
    assert machine in {"x86_64", "arm64", "universal2"}, f"macOS arch {machine} not understood"
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: macOS arch Power Macintosh not understood

ERROR Backend subprocess exited when trying to invoke build_wheel
barracuda156 commented 2 weeks ago

Ok, the file refers to setuptools, but is supplied by another Python port, scikit-build. Closing here, will open an issue with their upstream. Sorry for a hassle.