Ray's Knowledge Base
Unlock

The editable install's extension rebuild fails when CMake cached a deleted uv build Python

PitfallVerified 29 Sep 2026Holds project: dftracer-utils
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.

Symptom#

Python tests still ran an old extension ('count_distinct' arrives in duql stage 12f after the code changed). m.__loader__.rebuild() failed with CalledProcessError: Command '['cmake', '--build', '.']'; in build/cp312-cp312-macosx_26_0_arm64, cmake --build . showed Interpreter: Cannot run the interpreter "<uv cache>/builds-v0/.tmp<id>/bin/python" and CMake Error at src/CMakeLists.txt:1537: Python was not found, but DFTRACER_UTILS_BUILD_PYTHON is ON.

Cause#

The editable install (scikit-build-core, build-dir = "build/{wheel_tag}") configured CMake with uv's temporary build Python, which uv deleted after the install. The venv's _editable_skbc_dftracer_utils does not rebuild on import, so the extension goes stale until you rebuild by hand.

Fix#

Point the cache at the venv's Python, then run the loader's rebuild hook:

cmake -S . -B build/cp312-cp312-macosx_26_0_arm64 \
  -DPython_EXECUTABLE=$PWD/.venv_test_py/bin/python \
  -DPython_ROOT_DIR=$PWD/.venv_test_py
.venv_test_py/bin/python -c "import dftracer.utils.dftracer_utils_ext as m; m.__loader__.rebuild()"

Evidence#

After both commands, .venv_test_py/bin/python -m pytest tests/python ran the new code: 1167 passed (2026-09-29).

Also found by searching

  • Interpreter: Cannot run the interpreter "<uv cache>/builds-v0/.tmpXXXX/bin/python"; Python was not found, but DFTRACER_UTILS_BUILD_PYTHON is ON
  • python tests still run the old compiled extension after I changed the C++ code
  • how do I fix the scikit-build-core editable rebuild failing with CalledProcessError cmake --build
  • uv pip install -e stale CMakeCache points to deleted temporary build python, delete build/{wheel_tag}
  • editable install extension not rebuilding, python tests run old compiled module
  • m.__loader__.rebuild() CalledProcessError cmake --build . scikit-build-core editable
  • how do I fix scikit-build-core editable rebuild after uv removed its temporary build env python