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

Pin Cython dependency to <3 #9

Merged
merged 1 commit into from
Jul 18, 2023
Merged

Conversation

miri64
Copy link
Contributor

@miri64 miri64 commented Jul 18, 2023

DTLSSocket currently does not build with Cython 3.0.0 (released yesterday).

DTLSSocket currently does not build with Cython 3.0.0 (released 2023-07-17).
@chrysn
Copy link
Contributor

chrysn commented Jul 18, 2023

Note that merely downgrading the language level (as would be achieved by

--- a/DTLSSocket/dtls.pyx
+++ b/DTLSSocket/dtls.pyx
@@ -1,3 +1,4 @@
+# cython: language_level=2

, and is a common fix) is insufficient: Then, the error produced would be

Error compiling Cython file:                                                                                             
------------------------------------------------------------                                                             
...                                                                                                                      
    tdtls.dtls_init()                                                                                                    
    self.ctx = tdtls.dtls_new_context(<void*>self)                                                                       
    self.cb.write = _write                                                                                               
    self.cb.read  = _read                                                                                                
    self.cb.event = _event
    self.cb.get_psk_info = _get_psk_info
                           ^
------------------------------------------------------------ 

DTLSSocket/dtls.pyx:197:27: Cannot assign type 'int (dtls_context_t *, const session_t *, dtls_credentials_type_t, const unsigned char *, size_t, unsigned char *, size_t) except? -1' to 'int (*)(dtls_context_t *, const session_t *, dtls_credentials_type_t, const unsigned char *, size_t, unsigned char *, size_t) noexcept'

and many similar ones.

Pinning this dependency and publishing a new release would be relatively urgent, as it can't easily be installed otherwise.

For a proper fix (with more time), I'd assume that going for language_version=2 first (fixing the function type errors) and then 2to3'ing would be the way to go.

@kabel42
Copy link
Collaborator

kabel42 commented Jul 18, 2023

easy enough, let's go with this now

@kabel42 kabel42 merged commit 3dde486 into mclab-hbrs:master Jul 18, 2023
@miri64 miri64 deleted the cython-lt-3 branch July 18, 2023 14:30
@miri64
Copy link
Contributor Author

miri64 commented Jul 18, 2023

Thanks!

@cdce8p cdce8p mentioned this pull request Jul 19, 2023
32 tasks
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.

3 participants