Skip to content

Fix Windows in-place rebuild locking its existing extension - #262

Open
drebbe-intrepid wants to merge 1 commit into
masterfrom
codex/fix-249-inplace-build
Open

drebbe-intrepid wants to merge 1 commit into
masterfrom
codex/fix-249-inplace-build

Conversation

@drebbe-intrepid

Copy link
Copy Markdown
Collaborator

Windows in-place rebuilds imported the existing extension twice before attempting to replace it: generated-structure validation and setuptools dynamic version lookup. Run validation in a checked subprocess that exits before copying the extension, and read the generated version literal directly.

Adds six regression cases for child-process isolation, import failures, regeneration, and metadata lookup, plus two consecutive forced in-place builds in Windows CI.

Validation (Windows x64, CPython 3.14.5):

  • Reproduced original second-build failure: Access is denied replacing the existing .pyd.
  • Two consecutive python setup.py build_ext --inplace --force commands pass after the fix.
  • python setup.py build_py, then PYTHONPATH=gen python -m pytest tests -q: 36 passed.
  • Independent critic /root/critic agrees with final five-file diff; builder agrees. Critic independently ran all six regression tests and inspected build logs.

Fixes #249

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.

[P2] Windows build_ext --inplace locks its own existing extension before copying the rebuild

1 participant