GH-50702: [Python] Fix .pyx changes requiring two builds to take effect - #50719
Conversation
…ing BYPRODUCTS in Cython CMake target
|
|
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.
pitrou
left a comment
There was a problem hiding this comment.
+1, let's check that CI is happy
|
@github-actions crossbow submit -g python |
|
@github-actions crossbow submit wheelcp314t* |
|
Revision: 425963c Submitted crossbow builds: ursacomputing/crossbow @ actions-687b996793 |
|
Revision: 425963c Submitted crossbow builds: ursacomputing/crossbow @ actions-a6bb2ad842 |
|
CI failures are unrelated, I'll merge. |
|
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit b8e2df4. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 12 possible false positives for unstable benchmarks that are known to sometimes produce them. |
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.