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
Fix use of a .pxi Cython include file as source from configure_file
#11594
base: master
Are you sure you want to change the base?
Conversation
Huh, I thought this was fixed in commit 9b999dd. |
That fixed the problem for The problem we're hitting now happens earlier, and is not about dropping order dependencies but plain choking on Lines 811 to 827 in b3b5734
As you see from the comment, meson/mesonbuild/utils/universal.py Lines 460 to 465 in b3b5734
.pxi is an unknown file type.
The assumption made that a py.extension_module(...
'a_source.pyx',
depends: generated_pxi,
) rather than passing everything to |
In fact, you are wrong there. If it comes from a configure_file then it is created before calling You don't need to depend on it as an order dependency, because it can't ever not exist for the first transpilation / compilation. It's still valuable to list as a depfile dependency for incremental rebuilds. So the obvious immediate solution is to "just stop doing that" and the build will work. That means the nature of this issue shifts in my mind from "get cython transpile to work" to "figure out why this UX is the way it is, and why we distinguish between generated sources and static sources". What is the general purpose of this error message? |
Thanks for pointing that out. Yes, if it's generated before meson is invoked and we're using Cython's depfile support for
Yeah, the UX is confusing. The Why the difference: just a guess, but maybe the only reason to pass non-sources as sources is if you have a generated target containing a mix of sources and headers? For static non-sources there should never be a need to pass them as sources. That said, I would not qualify |
This fix is still helpful I think, and correct? Maybe |
Is this worth getting into 1.2.0? Otherwise I can target it to 1.3.0. Seems like the previous conversation was never resolved |
Thanks for checking in on this @tristan957. I think this is mergeable as is and quite safe, but it's not that urgent to me since it's not blocking for anything. We're already at 1.2.0rc3 now, so targeting this for 1.3.0 seems fine. |
Cool. I think that is what I did already (on mobile right now). Maybe it is worth rebasing for the CI? |
Without adding .pxi` as a known header suffix, the added test will fail with: ``` No specified compiler can handle file stuff.pxi ``` Technically only .pxd are header files, and .pxi are "include files" which are literally included in .pyx files. Adding them as headers seems to be fine though, since they're kinda similar and the point is to avoid treating them as source files.
95d74a4
to
929e5bd
Compare
Without adding
.pxi
as a known header suffix, the added test will fail with:Technically only .pxd are header files, and .pxi are "include files" which are literally included in .pyx files. Adding them as headers seems to be fine though, since they're kinda similar and the point is to avoid treating them as source files.