Repository navigation
Avoid copying a cached fallback wheel onto itself - #241
Open
harbinresearcher wants to merge 1 commit into
Open
harbinresearcher wants to merge 1 commit into
harbinresearcher wants to merge 1 commit into
Conversation
agammann
approved these changes
Nov 1, 2026
agammann
left a comment
There was a problem hiding this comment.
I checked the two fallback build paths with the metadata and wheel directories both shared and separate. The new samefile guard skips an invalid self-copy only for the shared directory, while the normal copy still produces the cached wheel in a distinct output directory. All four focused cases pass, and this matches the reproduction in #240.
This branch has not been deployed
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.
Closes #240.
When the metadata fallback builds a wheel in the directory later passed to
build_wheel()orbuild_editable(), cached-wheel reuse copies the wheel onto itself. The subprocess fails even though the requested wheel is already present.Skip the cached-wheel copy when the existing destination is the same file. Separate output directories retain the existing copy behavior. No backend hook or public API changes.
Four regression cases exercise wheel/editable fallbacks with same/separate directories. A trailing marker verifies the cached wheel is preserved rather than rebuilt. On unmodified main, the two same-directory cases fail and the separate-directory cases pass.
Validation:
test_path_pollution_symlinked_in_processbecause this local process lacks symlink privileges (WinError 1314); the new regressions pass on both versions.Prepared with AI assistance, including tests and local validation. No maintainer approval or production usage is claimed.