Build and test Python 3.15 wheels with cibuildwheel - #946
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #946 +/- ##
==========================================
- Coverage 92.49% 92.35% -0.15%
==========================================
Files 99 99
Lines 11787 11793 +6
Branches 430 432 +2
==========================================
- Hits 10902 10891 -11
- Misses 885 902 +17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Now the 3.15 problems are being noticed cause #927 did not actually test 3.15 inside the wheel building step :( |
|
The cibuildwheel logs are a bit long and require some patience too but I looked into them and we're getting test failures in 3.15t and a seg fault in i686 only. I had claude parse the logs the generate a report for me which I think is generally accurate from looking at the logs briefly. Here is the report below. I can definitely tackle some of them like the abi3t injecter thing but I definitely cannot debug the i686 segfault without a 32-bit machine. I'd like to know how the maintainers want to proceed here cause 3.15t support is not there yet. Wheels CI failure analysis (run 27154079947)TL;DREvery failure is isolated to the free-threaded Python 3.15 ( Per-job breakdown
Root causes1) — injecter = pathlib.Path(memray.__file__).parent / "_inject.abi3.so"
assert injecter.exists()
2) — native parse produces zero records of some type 3) — segfault on 32-bit free-threaded 4) — flaky timeout (not a 3.15 issue) |
|
I have fixed the injecter problem and now I'm chasing the failure in this line memray/tests/integration/test_main.py Lines 630 to 631 in e15c16a but I can't reproduce it locally (even by running the whole cibuildwheel chain locally).For the i686 segfault, someone with a 32-bit machine could do or I can do it later with QEMU which will be a bit annoying. Edit: Edit2: |
|
The i686 segfault looks likely more likely to be a CPython bug than a Memray bug. I'll see if I can find a way to reproduce it. The missing FRAME_POP records is... very weird. I'll probably need to reproduce that to figure out what's up. Maybe our trace function is getting uninstalled, or is somehow not firing... At least that one reproduces on x86-64! Only happening on musl is also quite odd... It might be worth adding a call to |
|
Yeah that's what I thought about i686 as well. Perhaps Pablo is interested too if it's a cpython bug. |
|
Running this on an x86-64 machine reproduces the crash: docker run -it quay.io/pypa/manylinux_2_34_i686 /usr/local/bin/python3.15t -c 'import ctypes; PyObject_Realloc = ctypes.pythonapi.PyObject_Realloc; PyObject_Realloc.argtypes = [ctypes.c_void_p, ctypes.c_size_t]; PyObject_Realloc.restype = ctypes.c_void_p; print(PyObject_Realloc(None, 984))' |
|
I've reported the crash upstream as python/cpython#151297 |
|
Nice, thanks! So I guess here we can just skip the i686 CI on 3.15t until there's the next python beta release with the fix? |
Signed-off-by: Iason Krommydas <iason.krom@gmail.com>
Signed-off-by: Iason Krommydas <iason.krom@gmail.com>
Signed-off-by: Iason Krommydas <iason.krom@gmail.com>
Signed-off-by: Iason Krommydas <iason.krom@gmail.com>
Signed-off-by: Iason Krommydas <iason.krom@gmail.com>
This will help us better track down CI failures. Signed-off-by: Matt Wozniski <godlygeek@gmail.com>
d4c2d31 to
cb25fa8
Compare
I'm pretty sure that one's just a flaw in the tests. We only record the stacks of locations where allocations were performed. I believe we used to pop all frames at the end of the tracking run, but we definitely don't anymore. The test only directly makes allocations with one stack, but expects to see pop records for moving from one stack to another. I think it's only been working by coincidence, as we observe allocations inside the |
It was assuming that there would always be `FRAME_POP` records in the output, but was not written in a way that guaranteed that. Signed-off-by: Matt Wozniski <godlygeek@gmail.com>
Signed-off-by: Matt Wozniski <godlygeek@gmail.com>
|
If CI is happy I think this should generally be good unless you have other suggesions. |
The news is always relative to the last release, and we haven't cut a release that includes support for Python 3.15 yet, so this isn't fixing a bug. In fact, we can just add the "skip news" label to this PR, since what this PR is doing is just adding 3.15 to CI, and we already have a news entry staged for adding support for 3.15 itself. There's only two bug fixes here, one in the test suite (for the FRAME_POP thing) and one in attach (for the |
I'd rather keep it. It can save us a lot of effort trying to reproduce issues in various environments if we get more info in the logs. We can always revert it later if it turns out to be more trouble than it's worth, but for now I'm thinking it'll make our lives easier. |
Signed-off-by: Iason Krommydas <iason.krom@gmail.com>
Signed-off-by: Iason Krommydas <iason.krom@gmail.com>
Signed-off-by: Iason Krommydas <iason.krom@gmail.com>
This is just meant as a quick smoke test to make sure that we can successfully unwind the stacks of the python-build-standalone interpreters that uv installs. We don't benefit from testing more than one uv-installed interpreter; the problems we're trying to catch here should be found by testing any one of them. Signed-off-by: Matt Wozniski <godlygeek@gmail.com>
cibuildwheel is now using 3.15.0b3 Signed-off-by: Matt Wozniski <godlygeek@gmail.com>
|
I think cibuildwheel still gets 3.15.0b2 until they make a release. I believe they hardcode the version and do not get the latest pre-release. I had tried it a couple of commits ago and the hack was still needed. |
Ah - I checked their OK, presumably that'll fail. If so, I'll revert that commit and leave the hack in for now. Other than that, I'm gonna revert the change to test all of 3.1{4,5}{t,} with uv. That job is just a quick smoke test, we're not trying to be exhaustive - the types of failures we think we might catch with that test should appear for any one of the uv interpreters, so there's no reason to test multiple. I'm also gonna add a news entry that announces we're dropping support for 3.8, too. After that, this is good to go! |
Yeah on the readme badges you also claim to support 3.7 and also the readme says "Memray requires Python 3.7+". You don't have wheels in the latest release naturally due to cibuildwheel having dropped it: https://pypi.org/project/memray/#files |
Thanks, I've updated those as well to say 3.9+ (though the badges won't update until we cut the next release, since they're based on the PyPI metadata).
I've removed a few more references to 3.7 and 3.8, though I left a few in the "attaching" docs. In theory attaching to an old version of Python might still work, so long as (an older version of) memray is installed in the environment of the process you're attaching to. |
d789e77 to
e77da26
Compare
Signed-off-by: Matt Wozniski <godlygeek@gmail.com>
Nope, the latest released version of cibuildwheel still uses beta2. This reverts commit afe971f. Signed-off-by: Matt Wozniski <godlygeek@gmail.com>
Signed-off-by: Matt Wozniski <godlygeek@gmail.com>
Signed-off-by: Matt Wozniski <godlygeek@gmail.com>
Signed-off-by: Matt Wozniski <godlygeek@gmail.com>
e77da26 to
fafd50a
Compare
|
Absolutely yeah. Just deal with my branch however you want and modify title + description accordingly :) |
Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
Follow-up of #927
cibuildwheel 4.0 is now released (not an RC anymore) so we update CI to that.
We also fix its config. We have to enable
cpython-prereleaseto build for python 3.15 (went unnoticed in the other PR) and we also fix the request for the python versions in CI and pyproject.toml. cibuildwheel 4.0 supports python 3.9 - 3.15. Asking for 3.7 or 3.8 like the CI did so far does not do anything. Looking at the existing wheels https://pypi.org/project/memray/#files, there are no wheels for 3.7 even though the CI was so far trying to ask for them. One has to use an older cibuildwheel version for older python versions.