BLD: exclude numpy 2.5.0 when building wheels (py3.14 segfault)#66090
Conversation
That is not true AFAIK. Since numpy 2.0 we don't have to do this pinning anymore. If this is actually what is happening, that sounds as a bug in numpy we should report. |
|
I think the issue is indeed backward incompatibility. I did manage to reproduce by compiling pandas against Numpy 2.5.0 and after downgrading Numpy I got the segfault. From the Numpy docs:
I think the solution is to build the wheels against the minimum supported version of NumPy? |
|
numpy/numpy#31804 was opened in NumPy to discuss the ABI break and it sounds like we'll need to pin NumPy when building |
|
Sorry, repeating here, but you shouldn't have to do this, if you do then something is very wrong. It sounded like the whole problem here is making sure that |
|
So for context, I believe the yanked 3.0.4 wheels were built from this job: https://github.com/pandas-dev/pandas/actions/runs/28315212942 From skimming some build logs:
|
|
I was able to get an agent to find a plausible NumPy bug that caused the segfault numpy/numpy#31814 |
|
Thanks @mroeschke, I would suggest you just blocklist specifically NumPy 2.5.0 for compilation (I dunno how nice that is). This is clearly a bug in NumPy's (All that said, I could see forcing the identical NumPy version for all bug-fix releases, but as annoying as this, I am not sure it's worth the logistics.) |
|
@jbrockmendel can you update this based on the comments? |
|
It isn't clear to me there is a consensus on what to update. |
|
Honestly, @charris was so nice and did the 2.5.1 yesterday which should fix this. So you should be able to just do nothing in practice. |
My read is: keep the change to avoid cython pre-releases (as Matt also +1ed above, and in general there is no reason to build with pre-releases), and for numpy specifically disallow just 2.5.0 (as Sebastian said, although with the new numpy release that might not be needed, but would maybe still do it) |
|
@jbrockmendel can you also update the PR title and reduce the verbosity of the comments a bit? And you could keep the cython change? |
numpy 2.5.0 shipped a regression that made wheels built against it segfault on older numpy (2.3.x/2.4.x) -- how the yanked 3.0.4 cp31x wheels crashed for users on an older numpy (GH#66086; numpy GH#31804, fixed in numpy 2.5.1). Exclude just numpy 2.5.0 from the build environment (numpy>=2.0.0,!=2.5.0). Also bound Cython <4 rather than <4.0.0a0: a pre-release in the bound makes pip eligible to install Cython pre-releases, which is how the 3.3.0a1 alpha got pulled into the 3.0.4 wheels. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
…lding wheels (py3.14 segfault)) (#66319) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
closes #66083
closes #66085
closes #66086
closes #66089
closes #66104
Summary
The 3.0.4 wheels segfault constructing a
Timedelta(and on other datetime paths) on Python 3.14 + numpy 2.3.x/2.4.x. This is not a pandas source bug —timedeltas.pyx/util.pxd/meson.buildare byte-identical to 3.0.3.The 3.0.4 wheels were built against numpy 2.5.0, and a wheel built against numpy 2.5.0 is not backward-compatible with older numpy — it segfaults at runtime on numpy 2.3.x/2.4.x. This is numpy's documented forward- but not backward-compatible ABI (numpy 2.5's header reorganization for opaque builds made it bite). Independently reproduced by
@Alvaro-Kothe, and discussed upstream in numpy/numpy#31804. The fix is the standard one: build the wheels against the oldest supported numpy.Isolation (linux x86_64, py3.14)
2×2 of build numpy × build Cython, each run on numpy 2.5.0 / 2.4.6 / 2.3.3:
The crash tracks the build numpy only — the Cython version is irrelevant. (Reproduced fault offsets match the reports exactly:
_multiarray_umath …+0x101f18,…+0xd5f58.)Changes (
pyproject.toml)>=2.0.0→==2.3.3: build against the oldest numpy with wheels for every supported Python/platform (cp314 + win_arm64), instead of the newest. Building against the oldest supported numpy keeps wheels compatible with every numpy ≥ the runtime floor (and with numpy 1.26+).Notes
3.0.xfor a 3.0.5 release (3.0.4 is the broken release); av3.0.5whatsnew entry should be added on the backport.🤖 Generated with Claude Code