🔥 Drop WARPKIT_DEV escape hatch in favor of cmake build cache - #19
Closed
vanandrew wants to merge 2 commits into
Closed
🔥 Drop WARPKIT_DEV escape hatch in favor of cmake build cache#19vanandrew wants to merge 2 commits into
vanandrew wants to merge 2 commits into
Conversation
WARPKIT_DEV pointed `import warpkit` at a manual `cmake -B build` build to dodge the slow uv-sync rebuild. Setting FETCHCONTENT_BASE_DIR + CMAKE_CXX_COMPILER_LAUNCHER=ccache once gets the same speed-up while keeping `uv sync --group dev` as the single dev-workflow entry point, with no two-import-paths-in-__init__ to maintain. Document the env vars in CLAUDE.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR removes the undocumented WARPKIT_DEV import-path escape hatch and replaces that workflow guidance with documented CMake caching/ccache environment variables to speed up repeated uv sync rebuilds.
Changes:
- Simplified
warpkit/__init__.pyto always import the packagedwarpkit_cppextension (dropping the repo-rootbuild/import path). - Added documentation to
CLAUDE.mddescribingFETCHCONTENT_BASE_DIRandCMAKE_CXX_COMPILER_LAUNCHER=ccacheto amortize ITK fetch/build cost across syncs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
warpkit/__init__.py |
Removes WARPKIT_DEV conditional import logic; always imports warpkit_cpp from the package. |
CLAUDE.md |
Documents environment-variable-based caching approach for faster uv sync rebuilds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
VS Code's terminal.integrated.env.* setting is unreliable for env injection (especially with extension-spawned shells like Claude Code's), so document direnv as the recommended setup and ship an .envrc that sets FETCHCONTENT_BASE_DIR + CMAKE_CXX_COMPILER_LAUNCHER on `cd` into the repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #19 +/- ##
==========================================
+ Coverage 94.44% 95.14% +0.69%
==========================================
Files 15 15
Lines 1081 1071 -10
==========================================
- Hits 1021 1019 -2
+ Misses 60 52 -8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
WARPKIT_DEV=1branch in warpkit/init.py — it pointedimport warpkitat a manualcmake -B buildbuild to skirt slowuv syncrebuilds;FETCHCONTENT_BASE_DIR+ccachedoes the same job without forking the import path.uv syncrebuilds" subsection.Why
uv syncruns the build backend in a fresh tempdir each time, so CMake re-fetches and re-builds ITK from scratch. WARPKIT_DEV worked around that by routing the import through a long-livedcmake -B builddirectory — but it required users to remember to set the env var, and the fallback path made__init__.pycarry two import strategies.Setting these once in your shell:
— gets the same speed-up. ITK's tarball gets fetched + extracted once total; ccache hits on rebuilds of the same ITK sources in a fresh build dir. CMake still re-configures per sync (PEP-517 doesn't expose a persistent build dir), but the heavy work is amortized.
WARPKIT_DEVwasn't documented anywhere outside the code, so removal is a clean op.Test plan
uv sync --group dev --config-setting editable_mode=strictbuilds successfully withoutWARPKIT_DEVFETCHCONTENT_BASE_DIRsurvives across syncs (manual:ls ~/.cache/warpkit-fetchcontentpopulated after first sync)ccache -sshows non-zero hits after second sync)🤖 Generated with Claude Code