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

Add support for Python 3.11. #253

Merged
merged 8 commits into from
Jan 28, 2022
Merged

Add support for Python 3.11. #253

merged 8 commits into from
Jan 28, 2022

Conversation

icemac
Copy link
Member

@icemac icemac commented Jan 24, 2022

No description provided.

@icemac icemac requested a review from jamadden January 24, 2022 13:27
@icemac icemac self-assigned this Jan 24, 2022
Copy link
Member

@jamadden jamadden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as manylinux docker images never include pre-release versions of CPython, this mostly LGTM. (We don't want to take a chance on publishing a binary wheel compiled against a CPython whose ABI isn't stable yet.)

I am slightly concerned that appveyor.yml won't get updated when 3.11 goes final and we publish the next release. It would be nice if it could gracefully handle missing releases or something.

@icemac
Copy link
Member Author

icemac commented Jan 24, 2022

@jamadden I share your concerns. I currently see no way to address them and keep the chance to test against non-final versions to see upcoming problems early.

Currently we have a Segmentation Fault on Unbuntu for Python 3.11.0a4, see https://github.com/zopefoundation/zope.interface/runs/4922368009?check_suite_focus=true
I saw a similar Segfault in the tests of ExtensionClass pointing to zope.interface: https://github.com/zopefoundation/ExtensionClass/runs/4912932639?check_suite_focus=true 3.11.0a3 did not have this Segfault.

I have no idea how to debug these problem.

@jamadden
Copy link
Member

Currently we have a Segmentation Fault on Unbuntu for Python 3.11.0a4

That's an intermittent failure (at this writing, the PR run passed for 3.11, but failed for the push; I'll try re-running the push). I see the same thing in a local docker container of Ubuntu 20.04 using the deadsnakes build of 3.11a4 (roughly 50% run, and 50% crash).

Running under gdb seems to point the finger to an error in coverage, not this package:

$ gdb /usr/bin/python3.11
...
(gdb) run -m coverage run -m unittest discover src
Starting program: /usr/bin/python3.11 -m coverage run -m unittest discover src
warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
CTracer_handle_return (frame=0x7f54d570ea30, self=0x7f54d5a85b30) at coverage/ctracer/tracer.c:698
698	coverage/ctracer/tracer.c: No such file or directory.
(gdb) bt
#0  CTracer_handle_return (frame=0x7f54d570ea30, self=0x7f54d5a85b30) at coverage/ctracer/tracer.c:698
#1  CTracer_trace (self=0x7f54d5a85b30, frame=0x7f54d570ea30, what=3, arg_unused=<optimized out>) at coverage/ctracer/tracer.c:784
...

@icemac
Copy link
Member Author

icemac commented Jan 25, 2022

@jamadden Thank you for looking into this problem. Would you like to create in issue in the coverage project?

@jamadden
Copy link
Member

It was recorded in nedbat/coveragepy#1294 and fixed a few days ago, just waiting for a release.

@icemac
Copy link
Member Author

icemac commented Jan 26, 2022

Okay let's await the next coverage release then.

@icemac
Copy link
Member Author

icemac commented Jan 26, 2022

Wow, the release was just yesterday. Let's se what happens when re-running the tests.

@icemac
Copy link
Member Author

icemac commented Jan 26, 2022

What a pity: using coverage 6.3 did not help, see https://github.com/zopefoundation/zope.interface/runs/4948035836?check_suite_focus=true

@icemac
Copy link
Member Author

icemac commented Jan 26, 2022

The behavior for ExtensionClass did not change either using coverage 6.3. 😢

@jamadden
Copy link
Member

Unfortunately, we're installing the pre-built binary wheel for coverage, and I believe those are still built against Python 3.11a2. That's binary incompatible with 3.11a4. (This is why you don't publish wheels built on pre-releases!)

I can still reproduce the crashes easily locally using the pre-built coverage 6.3 wheels. But if I install coverage with --no-binary and build it from source, I don't get crashes.

Remove some coverage installs where they do not seem to be needed.
@icemac
Copy link
Member Author

icemac commented Jan 27, 2022

@jamadden Thank you for sharing your expertise. I changed to --no-binary and removed installing coverage at some places where it does not seem to be necessary. Let's see how it goes.

@icemac
Copy link
Member Author

icemac commented Jan 27, 2022

I added code to prevent pushing wheels of future Python versions to PyPI, see 5e81b38 and zopefoundation/meta#132

@icemac
Copy link
Member Author

icemac commented Jan 27, 2022

Okay preventing publishing wheels was not so easy but now it should work as expected.

@icemac icemac merged commit 5f8e2e0 into master Jan 28, 2022
@icemac icemac deleted the config-with-c-code-II branch January 28, 2022 07:22
@icemac
Copy link
Member Author

icemac commented Jan 28, 2022

Thank you for reviewing this PR. 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants