Skip to content

Commit

Permalink
apacheGH-40236: [Python][CI] Disable generating C lines in Cython tra…
Browse files Browse the repository at this point in the history
…cebacks (apache#40225)

### Rationale for this change

We're getting timeouts (on AppVeyor) and very long compilation times (on GHA wheel builds) for `lib.cpp`, a Cython-generated C++ file. Examination suggests that `lib.cpp` is more than 300 thousand lines long, and we can hypothesize that this can blow up available memory on some machines and compilers.

### What changes are included in this PR?

Disable a not really useful (and undocumented) Cython feature to make C++ code slightly easier to compile.

### Are these changes tested?

Yes. This solves, at least temporarily, the timeout issues on AppVeyor and makes the wheel builds much faster (down to ~35 minutes for the wheel build step, instead of 3 hours).

### Are there any user-facing changes?

No.
* GitHub Issue: apache#40236

Authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
  • Loading branch information
pitrou authored and thisisnic committed Mar 8, 2024
1 parent 8ccb478 commit e1d81a7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,9 @@ endif()

# Error on any warnings not already explicitly ignored.
set(CYTHON_FLAGS "${CYTHON_FLAGS}" "--warning-errors")
# GH-40236: make generated C++ code easier to compile by disabling an
# undocumented Cython feature.
set(CYTHON_FLAGS "${CYTHON_FLAGS}" "--no-c-in-traceback")

foreach(module ${CYTHON_EXTENSIONS})
string(REPLACE "." ";" directories ${module})
Expand Down

0 comments on commit e1d81a7

Please sign in to comment.