-
Notifications
You must be signed in to change notification settings - Fork 3
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
cython / c++ meson upstream tracking issue #36
Comments
Also need to remember to add meson to |
Some kind of solution may appear from day to day. Full C++ in Cython support is expected in 0.60. |
I have a PR for this here: mesonbuild/meson#9017, if you wanted to test :) |
@dcbaker Tried testing your branch --- I am probably doing something wrong? --- with your meson branch, am building locally on linux this branch #42
EDIT: in case it matters, |
Checked with dcbaker's PR. override_options : ['cython_language=cpp'], In |
If the whole project is cython -> c++ I'd put |
Thanks @dcbaker! For self-documenting purposes I'd stick with @noDGodyaev 's suggestion in gh-42, using And your mesonbuild/meson#9017 works great. Thanks for it, BTW. The next issue is tracking the dependencies (can open a separate issue if needed, let me know) : with For context, cython has To trigger the issue with dependencies: build the project, edit a syntax error into a
the syntax error is not picked up, i.e. the change in the pxd file is ignored. |
ideally cython would just write a depfile for that, but we could probably add support for them the way we do with .h files, where adding them to the sources causes them to be listed as dependencies by ninja. I'd open a separate issue for that. |
@dcbaker done : mesonbuild/meson#9049 ; happy to provide further info or otherwise help however I can |
Playing a bit with Cython.Build module, it seems to me that the dependecy graphs can be extracted/constructed from Cython.Build.cythonize reasonably easily: Not that I understand the depfile syntax though. Also not sure if cython devs are interested. And also, of course, how to make it useful for meson (assuming some from of this goes into cython.build). |
Note that you want them from using
Same here. I believe it's just Make syntax, but I'm not fluent in Make. If it's a smalll patch, should be doable to get it merged I'd think. Stefan has already commented a few times on the Cython-Meson interaction recently. And I'm getting more familiar with Meson, I should be able to help (also Meson maintainers are quite helpful).
not at all, it's great to collaborate like this |
@ev-br I just realized, if you don't have any C targets you probably want to change the default to c++, even if you're going to override on a per-target basis, otherwise meson will look for an unnecessary C compiler when it sees that you're using cython. |
Depfile syntax is indeed a makefile snippet, it looks like this: name/of/source.pyx: imported/source/1.pyx \
imported/source/2.pyx \
source.pyd \
... indentation is significant in make. |
@dcbaker Thanks. So for me to specify the requirements before writing code for the cython devs to consider. For this to be usable to you:
where all paths are relative to the project root, is this correct? P.S. Your comment on the global setting for the C++ compiler is noted, will specify it here. Thanks for this! |
It would be best if the cython executable itself emitted the depfile, as that's what ninja needs. I'd rather not be wrapping up calls like The only files that cython should be adding to the depfile are any files that it's using itself, so if changes to the C/C++ headers should trigger a fresh transpile from cython->C/C++ then they need to be in the depfile, if changes to the C/C++ headers only require that the C/C++ compiler regenerate a .o file then cython doesn't need to do anything with them, the C/C++ compiler will emit it's own depfile and ninja will do the right thing with that. |
Hey, did you ever get around to plugging depfile support into |
@eli-schwartz not yet, no. This is at the top of my to do list for next OSS time slot though. (Teaching term has started, so time's a bit of an issue) |
cython/cython#4563 which is now merged. |
This is to track the progress with upstream support of
py3.extension_module(..., cython_args: '--cplus')
The issue description and links : #14 (comment)
@noDGodyaev do you know what is the expected meson version when this lands? And how would the build look like when it does? Maybe it'd be nice to have a PR now so that we can merge when the upstream is ready.
The text was updated successfully, but these errors were encountered: