perfsonar / pscheduler

The perfSONAR Scheduler
Apache License 2.0
53 stars 32 forks source link

PyJQ: Migrate Cython 0.29 -> 3.0 #1439

Closed mfeit-internet2 closed 2 weeks ago

mfeit-internet2 commented 3 weeks ago

PyJQ has problems with Cython 3.0 on u24:

cython3 -I/usr/include/python3.12 -I/usr/include/python3.12 _pyjq.pyx

Error compiling Cython file:
------------------------------------------------------------
...
    def __init__(self, const char* script, vars={}, library_paths=[]):
        self._errors = []
        self._jq = jq_init()
        if not self._jq:
            raise RuntimeError('Failed to initialize jq')
        jq_set_error_cb(self._jq, Script_error_cb, <void*>self)
                                  ^
------------------------------------------------------------

_pyjq.pyx:176:34: Cannot assign type 'void (void *, jv) except *' to 'jq_err_cb'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void *, jv) except *'.

Already have a patch for this, need to check if it breaks d11/d12/u20 and probably EL.

See https://cython.readthedocs.io/en/latest/src/userguide/migrating_to_cy30.html#exception-values-and-noexcept

mfeit-internet2 commented 2 weeks ago

Added a patch and it works on all versions:

U24: Cython 3.0.8 - Build OK Run OK U22: Cython 0.29 - Build OK Run OK U20: Cython 0.29 - Build OK Run OK D12: Cython 0.29 - Build OK Run OK D11: Cython 0.29 - Build OK Run OK EL9: Cython 0.29 - Build OK Run OK OL8: Cython 0.29 - Build OK Run OK

mfeit-internet2 commented 2 weeks ago

This was fixed and merged.