scripts/make.py: discover Cython sources for "clean" instead of hardcoding them - #10156
Merged
ThomasWaldmann merged 1 commit intoAug 19, 2026
Merged
Conversation
…oding them The hardcoded cython_sources list had drifted from reality and was missing 8 of the 21 .pyx modules: the chunkers base/fastcdc/goldilocks_aes/phte_chunker/ rabin_aes/toeplitz_aes, legacy/crypto/low_level and platform/netbsd. So "make.py clean" left their generated .c files and compiled extension modules behind. Stale extensions built for another Python version then linger in the working tree, which is confusing at best. Discover the sources by globbing src/borg/**/*.pyx instead, so newly added modules are covered automatically and the list cannot go stale again. The glob reproduces setup.py's cython_sources list exactly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10156 +/- ##
==========================================
+ Coverage 86.88% 86.94% +0.06%
==========================================
Files 101 101
Lines 17857 17983 +126
Branches 2709 2737 +28
==========================================
+ Hits 15515 15636 +121
- Misses 1636 1639 +3
- Partials 706 708 +2 ☔ View full report in Codecov by Harness. |
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.
The hardcoded
cython_sourceslist inscripts/make.pyhad drifted from reality: it listed 13 of the 21.pyxmodules. Missing werechunkers/base,chunkers/fastcdc,chunkers/goldilocks_aes,chunkers/phte_chunker,chunkers/rabin_aes,chunkers/toeplitz_aes,legacy/crypto/low_levelandplatform/netbsd.Consequence:
python scripts/make.py cleansilently left those modules' generated.cfiles and compiled extension modules behind. That is how stale*.cpython-3XX.sofiles from an older Python version end up lingering in a working tree, and it means the documented rebuild recipe (make.py clean && pip install -e .) does not actually give a clean rebuild for those modules.Found while setting borg up on a fresh FreeBSD box: after switching that checkout from Python 3.12 to 3.14,
cleanleft sixcpython-312chunker extensions behind.Fix
Discover the sources with
glob("src/borg/**/*.pyx")instead of maintaining a second hand-written list next to the one insetup.py. New modules are then covered automatically and the list cannot go stale again.Verification
setup.py'scython_sourceslist exactly - same 21 paths.clean, 17 compiled.soand 21 generated.c; afterclean, 0 and 0, withgit statusshowing no leftover build artifacts. Previously the same command left 8 modules' artifacts untouched.ruff check/ruff format --checkclean.🤖 Generated with Claude Code