[
https://issues.apache.org/jira/browse/PROTON-2095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17567518#comment-17567518
]
ASF GitHub Bot commented on PROTON-2095:
----------------------------------------
jiridanek commented on PR #375:
URL: https://github.com/apache/qpid-proton/pull/375#issuecomment-1186235175
@astitcher I've updated #318 to use current proton main and to run all
tests. I want to keep that previous PR for future reference, so I am closing
that one and opening a new PR.
So far, I am thinking that
1) CFFI is certainly possible and (maybe with the exception of the tracer
test) it can maintain the api that swig previously exposed to the python code
2) Ownership of the cffi cdata values might be tricky in places. So far I
never had problems with it, but maybe I was just lucky. The thing is that CFFI
discourages relying on CPython specifics (ref counting) so values must be kept
alive by something on the python side always referencing them. Trying out Pypy
should flush out problems, I hope
3) python-tests don't cover many data types; the type conversion in the PR
is woefully incomplete but they still pass. some other ctest targets maybe test
that
4) The CFFI wrapper functions (in `_cpython` directory) can be probably
mostly generated from the c type signatures, but I don't think that there is a
cffi tool for that; it would need to be done by us; currently they are
hand-written as needed (to pass tests)
5) I noticed asan job on GHA for this PR is not running, that is something
to fix
6) There is a script to autogenerate the c signatures for cffi from .h
files, somewhere, I need to find it. Currently, I made edits by hand.
> Move away from SWIG to CFFI
> ---------------------------
>
> Key: PROTON-2095
> URL: https://issues.apache.org/jira/browse/PROTON-2095
> Project: Qpid Proton
> Issue Type: Wish
> Components: python-binding
> Affects Versions: proton-c-0.29.0, proton-c-future
> Reporter: Omer Katz
> Assignee: Arunagirinadan Sudharshan
> Priority: Major
> Fix For: proton-c-future
>
>
> SWIG is fine but we're not using it for anything other than exporting all of
> proton-c's API as is.
> Unfortunately SWIG only generates CPython extension bindings. This may be a
> problem on PyPy where CPython extensions are either slow or simply won't
> compile.
> Unlike SWIG, CFFI is portable both on CPython and PyPy.
> It also satisfies the same requirements as SWIG currently does.
> In addition, calls to CFFI simply release the GIL which will help
> parallelizing Python applications using threads.
> By using CFFI we can also get rid of all of our setup.py code and simply use
> it to build the extension. We will also no longer have problems building
> wheels.
> The newest version of CFFI supports pkg-config so we can use that to find
> proton-c easily.
> I'm willing to help with the refactor but I'll need a mentor since I'm not
> familiar with the code base.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]