Use a persistent scikit-build build-dir to fix Windows tempdir cleanup flake#20
Merged
Conversation
…p flake python -m build intermittently fails on windows-2022 CI runners with PermissionError [WinError 32] while cleaning up scikit-build-core's TemporaryDirectory build dir (a lingering mspdbsrv.exe/AV handle holds files in Temp). The wheel itself builds fine; only the cleanup fails. Setting build-dir to a persistent, gitignored location skips the temporary directory entirely, so there is no cleanup to race with. Also gives incremental rebuilds locally. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Transurgeon
added a commit
that referenced
this pull request
Jul 13, 2026
…p flake (#20) python -m build intermittently fails on windows-2022 CI runners with PermissionError [WinError 32] while cleaning up scikit-build-core's TemporaryDirectory build dir (a lingering mspdbsrv.exe/AV handle holds files in Temp). The wheel itself builds fine; only the cleanup fails. Setting build-dir to a persistent, gitignored location skips the temporary directory entirely, so there is no cleanup to race with. Also gives incremental rebuilds locally. Co-authored-by: Transurgeon <peter.zijie@gmail.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
build_wheels (windows-2022, *)jobs fail intermittently (e.g. runs #100, #101) with:The traceback is raised from
TemporaryDirectorycleanup at the very end ofbuild_wheel-- the wheel compiles fine; only the cleanup of scikit-build-core's temp build dir fails, because a lingering process (mspdbsrv.exe / AV scanner) still holds a handle inTemp. The same commit passed on thev0.6.0tag run, confirming this is a flake, not a code issue.Fix
Set a persistent, gitignored build dir so scikit-build-core never creates (or cleans up) a temporary directory:
No temp dir, no cleanup, no race -- regardless of who holds the handle.
build/is already in.gitignore, so it stays out of the sdist; each CI job builds a single wheel tag, so there are no collisions; and local development gains incremental rebuilds.🤖 Generated with Claude Code