GH-50702: [Python] Fix .pyx changes requiring two builds to take effect - #50719
Open
pratyushadk wants to merge 1 commit into
Open
GH-50702: [Python] Fix .pyx changes requiring two builds to take effect#50719pratyushadk wants to merge 1 commit into
pratyushadk wants to merge 1 commit into
Conversation
…ing BYPRODUCTS in Cython CMake target
|
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes incremental rebuild behavior for PyArrow Cython extensions by teaching CMake that the generated C/C++ sources (and related headers) are build byproducts of the Cython custom target, so downstream compilation can re-trigger in the same build pass.
Changes:
- Re-enabled
BYPRODUCTS ${_generated_files}on the Cythonadd_custom_target(...)invocation to ensure build tools (e.g., Ninja) correctly track generated outputs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
I noticed while editing a .pyx file that my changes weren't
showing up after a rebuild — I had to build twice. Traced it
to
BYPRODUCTSbeing commented out inUseCython.cmake.What changes are included in this PR?
I uncommented
BYPRODUCTS ${_generated_files}incpp/cmake_modules/UseCython.cmake. Without it, CMake doesn'trealize the .cpp was updated in the same build pass, so it
skips recompiling the .so until the next build.
The line was commented out for older CMake compatibility — but
the project requires CMake >= 3.25 now, and BYPRODUCTS has
worked since 3.2, so that's no longer a concern.
Are these changes tested?
This is a build system fix so there's no unit test for it.
The CI builds pyarrow from source and runs the full test suite,
which will validate the build still works correctly.
Are there any user-facing changes?
No — this only improves the dev experience when iterating on
.pyx files. One build instead of two.