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

[0.29] implement the depfile command-line option for the "cython" tool #4949

Merged
merged 2 commits into from
Aug 5, 2022

Conversation

eli-schwartz
Copy link
Contributor

Backports #4916

I'm not sure I understand what's up with the second commit here.

@eli-schwartz eli-schwartz changed the base branch from master to 0.29.x August 4, 2022 00:06
* refactor cythonize depfile support to be reusable

We would like to use it in the frontend for the cython tool as well.
Pull it out of the main loop and make it a utility function.

* fix depfiles emitting unusable relative paths

The paths for files in the source tree are relative instead of absolute.
This is not inherently a problem, but they are relative to the
containing directory of the source code file but the program that parses
these files (make, ninja) computes filenames relative to its working
directory, not relative to the source file.

Likewise, the final output file had its entire path component trimmed,
leaving just a bare filename.

Make this actually work by computing all relative paths relative to the
current working directory of the cython process itself. When invoked by
a build system, this will be the same directory the build system expects
files to be based on. This has the obvious drawback of requiring a sensible
work directory (i.e. you can't "just run" cython next to the sources), but it's
still a reasonable thing to assume and we already make that assumption in
other places.

(cherry picked from commit 820b444)
Fix a broken test that seems to be different on 0.29 vs. master?
@eli-schwartz eli-schwartz marked this pull request as ready for review August 4, 2022 23:46
@scoder scoder added this to the 0.29.33 milestone Aug 5, 2022
@scoder scoder merged commit c656624 into cython:0.29.x Aug 5, 2022
@scoder
Copy link
Contributor

scoder commented Aug 5, 2022

Looks good. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants