Skip to content
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

BLD: build failure with new setuptools 73.0.0 #21416

Closed
tylerjereddy opened this issue Aug 19, 2024 · 8 comments
Closed

BLD: build failure with new setuptools 73.0.0 #21416

tylerjereddy opened this issue Aug 19, 2024 · 8 comments
Labels
Build issues Issues with building from source, including different choices of architecture, compilers and OS upstream bug Items related to bugs in upstream projects

Comments

@tylerjereddy
Copy link
Contributor

tylerjereddy commented Aug 19, 2024

I don't think it is particularly surprising when this happens, but it did just bite me while working on the release/backports in gh-21362, and I confirmed that I can reproduce on main with setuptools 73.0.0, released an hour ago, via its interaction with pythran 0.16.0, 0.15.0, or 0.16.1 on MacOS ARM (didn't check other platforms).

[560/1283] Generating 'scipy/stats/_stats_pythran.cpython-312-darwin.so.p/_stats_pythran.cpp'
FAILED: scipy/stats/_stats_pythran.cpython-312-darwin.so.p/_stats_pythran.cpp 
/Users/treddy/python_venvs/py_312_scipy_dev2/bin/pythran -E ../scipy/stats/_stats_pythran.py -o scipy/stats/_stats_pythran.cpython-312-darwin.so.p/_stats_pythran.cpp
Traceback (most recent call last):
  File "/Users/treddy/python_venvs/py_312_scipy_dev2/bin/pythran", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/Users/treddy/python_venvs/py_312_scipy_dev2/lib/python3.12/site-packages/pythran/run.py", line 190, in run
    pythran.compile_pythranfile(args.input_file,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/treddy/python_venvs/py_312_scipy_dev2/lib/python3.12/site-packages/pythran/__init__.py", line 127, in __getattr__
    import pythran.toolchain
  File "/Users/treddy/python_venvs/py_312_scipy_dev2/lib/python3.12/site-packages/pythran/toolchain.py", line 11, in <module>
    from pythran.dist import PythranExtension, PythranBuildExt
  File "/Users/treddy/python_venvs/py_312_scipy_dev2/lib/python3.12/site-packages/pythran/dist.py", line 142, in <module>
    class PythranBuildExt(PythranBuildExtMixIn, LegacyBuildExt, metaclass=PythranBuildExtMeta):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
[575/1283] Compiling C++ object scipy/sparse/sparsetools/_sparsetools.cpython-312-darwin.so.p/bsr.cxx.o

python -m pip install "setuptools<73.0.0" in an affected environment suffices to fix the issue. I suspect this is an "upstream" matter, but perhaps worth noting at least. cc @serge-sans-paille just in case maybe, though perhaps setuptools will yank if it is a problem on their end.

@tylerjereddy tylerjereddy added Build issues Issues with building from source, including different choices of architecture, compilers and OS upstream bug Items related to bugs in upstream projects labels Aug 19, 2024
tylerjereddy added a commit to tylerjereddy/scipy that referenced this issue Aug 19, 2024
* Try adding a workaround in the wheel builds
for scipygh-21416.

[wheel build]
tylerjereddy added a commit to tylerjereddy/scipy that referenced this issue Aug 19, 2024
* Try setting an upper bound to `setuptools` version
in `pyproject.toml` (this is probably terrible), to hack
around scipygh-21416.

[wheel build]
@tylerjereddy
Copy link
Contributor Author

This hack does seem to help isolated builds deal with the transitive dep issue locally, but is obviously very undesirable:

--- a/pyproject.toml
+++ b/pyproject.toml
@@ -28,6 +28,7 @@ requires = [
     # The upper bound on pythran is pre-emptive only; 0.16.1
     # is released/working at time of writing.
     "pythran>=0.14.0,<0.17.0",
+    "setuptools<73.0.0", # hack to work around gh-21416

So, hopefully gets resolved/yanked upstream.

@tommilligan
Copy link

Thanks for the above investigation and fix - I've opened an issue and proposed a fix to pythran upstream here: serge-sans-paille/pythran#2229

@rgommers
Copy link
Member

xref serge-sans-paille/pythran#2228 (comment) for context

@agriyakhetarpal
Copy link
Contributor

I just bisected, and the first bad commit in setuptools seems to be f9398b1f. I'll have a look and try to write a bug report for this there.

cross-posted from serge-sans-paille/pythran#2228

@agriyakhetarpal
Copy link
Contributor

Upstream issue: pypa/setuptools#4579 (as linked above).

@agriyakhetarpal
Copy link
Contributor

@agriyakhetarpal
Copy link
Contributor

This can now be closed since https://pypi.org/project/setuptools/73.0.1/ is now up.

@tylerjereddy
Copy link
Contributor Author

@agriyakhetarpal Thanks for the hard work bisecting and coordinating upstream with setuptools for us.

I see the issue fixed locally as well, with the newly-released setuptools 73.0.1.

tylerjereddy added a commit to tylerjereddy/scipy that referenced this issue Aug 20, 2024
* Revert some commits related to `setuptools` breakage.
See scipygh-21416.

[wheel build]
mamccorm added a commit to wolfi-dev/os that referenced this issue Aug 24, 2024
Bump py3-setuptools package to pick-up fix for:
scipy/scipy#21416

This was a bug introduced upstream which is causing a number of our
packages to fail to build. This patch release resolves it:
pypa/setuptools@ebddeb3

The tag was cut 4 days ago but they haven't cut a release yet - we're
monitoring releases not tags. But given this is causing package
failures, bumping ahead.

Signed-off-by: Mark McCormick <mark.mccormick@chainguard.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build issues Issues with building from source, including different choices of architecture, compilers and OS upstream bug Items related to bugs in upstream projects
Projects
None yet
Development

No branches or pull requests

4 participants