-
Notifications
You must be signed in to change notification settings - Fork 42
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
Python 3.13 support TODOs #77
Comments
re test failures from null pointer subtraction errors: I've got a quick hack that seems to work fine with MSVC, can you check if it does the trick on clang? The hack is: index 4167bc05..ac6c163e 100644
--- a/src/cffi/recompiler.py
+++ b/src/cffi/recompiler.py
@@ -953,7 +953,7 @@ class Recompiler:
if cname is None or fbitsize >= 0:
offset = '(size_t)-1'
elif named_ptr is not None:
- offset = '((char *)&((%s)0)->%s) - (char *)0' % (
+ offset = '((char *)&((%s)4096)->%s) - (char *)4096' % (
named_ptr.name, fldname)
else:
offset = 'offsetof(%s, %s)' % (tp.get_c_name(''), fldname) It's not handling null pointers any more... and this expression is only used in a struct initialization, not in real code. |
If it doesn't help, we can try to make the clang warning not be an error for the tests (like it would likely be in production): index a7ac14d3..8dd93c16 100644
--- a/testing/cffi1/test_verify1.py
+++ b/testing/cffi1/test_verify1.py
@@ -729,7 +729,7 @@ def test_full_enum():
assert [lib.EE1, lib.EE2, lib.EE3] == [0, 1, 2]
def test_enum_usage():
- ffi = FFI()
+ ffi = FFI_warnings_not_error()
ffi.cdef("enum ee { EE1,EE2 }; typedef struct { enum ee x; } *sp;")
lib = ffi.verify("enum ee { EE1,EE2 }; typedef struct { enum ee x; } *sp;")
assert lib.EE2 == 1 |
Apologies if this proves irrelevant; I'm just a user. Currently trying to pip install (Python 3.13.0b1, Win 11) fails with errors that include: |
@alan-isaac Yeah, that's expected from released bits- assuming your box has the right tools already installed, you should be able to do |
@arigo yep, changing the named pointer stuff in recompiler as you suggested to use matching non-zero offsets prevents the null pointer subtraction warnings/errors on the newer clang releases. I've filed that as PR #78, since it's not just a test/build change. Thanks! |
For the static linking release criteria, this issue I opened a few weeks ago might provide useful context #75 |
Are there plans to cut a release with these fixes? My system (Python 3.13b2 on macOS ARM) fails to install cffi. Building against github works around the problem. I see now there is a pre-release, so passing |
Also curious about this - working on adding support to |
Now that Python 3.13 has hit beta, we're overdue for at least a pre-release that supports it. Prerequisite to getting that out the door:
musllinux
builds.The text was updated successfully, but these errors were encountered: