Skip to content

🔥 Drop WARPKIT_DEV escape hatch in favor of cmake build cache - #19

Closed
vanandrew wants to merge 2 commits into
mainfrom
dev/cmake-build-cache
Closed

🔥 Drop WARPKIT_DEV escape hatch in favor of cmake build cache#19
vanandrew wants to merge 2 commits into
mainfrom
dev/cmake-build-cache

Conversation

@vanandrew

Copy link
Copy Markdown
Owner

Summary

  • Remove the WARPKIT_DEV=1 branch in warpkit/init.py — it pointed import warpkit at a manual cmake -B build build to skirt slow uv sync rebuilds; FETCHCONTENT_BASE_DIR + ccache does the same job without forking the import path.
  • Document the cache env vars in CLAUDE.md under a new "Speeding up uv sync rebuilds" subsection.

Why

uv sync runs 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-lived cmake -B build directory — but it required users to remember to set the env var, and the fallback path made __init__.py carry two import strategies.

Setting these once in your shell:

export FETCHCONTENT_BASE_DIR=$HOME/.cache/warpkit-fetchcontent
export CMAKE_CXX_COMPILER_LAUNCHER=ccache

— 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_DEV wasn't documented anywhere outside the code, so removal is a clean op.

Test plan

  • uv sync --group dev --config-setting editable_mode=strict builds successfully without WARPKIT_DEV
  • Verify FETCHCONTENT_BASE_DIR survives across syncs (manual: ls ~/.cache/warpkit-fetchcontent populated after first sync)
  • Verify ccache hits on second sync (ccache -s shows non-zero hits after second sync)
  • CI green

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings April 25, 2026 15:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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__.py to always import the packaged warpkit_cpp extension (dropping the repo-root build/ import path).
  • Added documentation to CLAUDE.md describing FETCHCONTENT_BASE_DIR and CMAKE_CXX_COMPILER_LAUNCHER=ccache to 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>
@vanandrew vanandrew closed this Apr 25, 2026
@vanandrew
vanandrew deleted the dev/cmake-build-cache branch April 25, 2026 16:04
@codecov

codecov Bot commented Apr 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.14%. Comparing base (aceacc9) to head (1204372).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants