Fix long-running clang-format after running integration tests - #1406
Conversation
Signed-off-by: Miles Song <bodasong@amazon.com>
|
Reviewers for this PR
Assigned automatically to the least-assigned members of the reviewer pools in |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe ChangesFormatting traversal
Suggested reviewers: Priority: ⬇️ Low Change: Bug fix Merge Risk: ⚪ Minimal · up to The formatting traversal change is narrowly scoped and presents no established merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Fix long-running clang-format after running integration tests
Skip build directories when formatting
./build.sh --formattakes ~1m46s instead of ~2s once integration tests have been run.Cause
format()walkstesting/with no exclusion for build directories.testing/integration/CMakeLists.txtcreates its venv at${CMAKE_BINARY_DIR}/venv, i.e.testing/integration/.build-<config>/venv, andrequirements.txtinstallspyarrow, whose wheel ships the Arrow C++ API —xxhash.h(7678 lines),date.h(6717),arrow/type.h,arrow_to_pandas.ccand more. clang-format, single-threaded, then reformats 570 files of third-party code on every invocation.Measured on a tree that has run integration tests once:
Two properties make this easy to miss: the venv survives until deleted, so formatting stays slow on days you never touch integration tests; and
testing/integration/.gitignoreignores.build*, sogit statusstays clean while 258MB of headers sit in the working tree.Fix
Prune
.build*directories in thefind.-type dkeeps a source file whose name starts with.buildeligible, and the parentheses around the-namealternation are required once-prune -oenters the expression.Notes
integration/suite is unaffected — it puts its venv in${BUILD_DIR}/integration/envat the repo root, whichformat()never walks.rm -rf testing/integration/.build-*/venvreclaims the space, and the fix makes it irrelevant to formatting either way.Testing
Verified with a simulated
testing/integration/.build-release/venv/.../xxhash.h: the glob goes from 270 to 268 paths with zero venv entries, all tracked sources still included,bash -n build.shclean.