Repository navigation
🐛 fix(seed): keep linked seed directories local - #3755
Closed
gaborbernat wants to merge 4 commits into
Closed
gaborbernat wants to merge 4 commits into
gaborbernat wants to merge 4 commits into
Conversation
When environments link a package directory, a pip reinstall replaces files in their shared cache. Give each environment its own directories and metadata so pip replaces the local links. Keep the image format usable by existing environments. Fixes pypa#3620
Walk the image once and record paths relative to its root while creating file links. Skip empty directories so a second install can reuse the environment, even when the wheel contains directory entries. Refs pypa#3620
A full disk or interrupted install can leave the package directories and file links in place before RECORD is written. On retry, reuse real directories and links to the expected image files. Preserve files the user added to the environment. Refs pypa#3620
gaborbernat
force-pushed
the
fix/symlink-seed-files
branch
from
November 21, 2026 02:14
4dc4e6e to
1c91c99
Compare
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.
Reinstalling a seed package with pip in one environment could change the package in every environment sharing its cache (#3620). Environments created with
--symlink-app-datanow own their package directories and installation metadata. Package files still link to the cache. When pip reinstalls a wheel, it replaces each link with a file in that environment.Existing environments keep their directory links. Rerun virtualenv on those environments to adopt file links. The same cache images can be reused.
Creating one link per file costs more than linking the whole directory. On Linux with CPython 3.15 and embedded pip, median warm-cache environment creation over 15 runs took 15 ms with file links, 3.6 ms with directory links, and 18 ms with the default copy mode. On Windows 11 with CPython 3.14, median warm-cache creation over nine runs took 422 ms with file links and 471 ms with copies.
Fixes #3620