Clarification on multi-environment disk usage #6365
Replies: 3 comments
-
|
What Pixi (via rattler) keeps one global package cache and, when it creates an environment, it doesn't copy files into
So True duplication only happens when the cache and the envs are on different filesystems (a clone/hardlink can't cross them) or the FS supports neither, in which case pixi falls back to a real copy. On the second question: no — each environment is a full, self-contained prefix. Pixi deduplicates at the storage layer (shared blocks/inodes), not by exposing a subset of one shared resolved environment per feature. To sanity-check link sharing: |
Beta Was this translation helpful? Give feedback.
-
|
Hi @delcenjo Thank you. I do see your point. So in this case I would then expect that upon running |
Beta Was this translation helpful? Give feedback.
-
|
Hi @sabarish-vm, Short answer: a link count of Why the count stays 1On APFS, pixi/rattler doesn't hardlink from the cache — it clones via the
A clone is not a hardlink:
So clonefile does not increment the hardlink count. Seeing How to actually verify the sharing
Quick proof that clonefile works on your volume: df -h .
# clone (-c uses clonefile)
cp -c some/big/file ./clone.test
df -h . # free space barely moves -> blocks shared
# real copy for comparison
cp some/big/file ./copy.test
df -h . # free space drops by the file size -> real duplication
rm clone.test copy.testFor the environments themselves, don't trust df -h .
# delete one env (or the cache) and re-measure
rm -rf .pixi/envs/api
df -h . # this delta is the *real* unique cost of that envOne thing worth checking
pixi info # shows the cache directoryIf the cache (typically (And re: your earlier question — yes, each environment is still a full, self-contained prefix; pixi deduplicates at the storage layer, not by exposing a subset of one shared resolved environment.) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am confused about how Pixi manages storage isolation across multi-environments. Consider the following
pixi.tomlfile.When the environments
baseandapiare created, is it somehow possible to avoid creating duplicate copies of the packages in these environments? My impression was that Pixi handles deduplication automatically via the global cache.However, when I check the disk sizes of
envs/baseandenvs/api, they both appear to contain full duplicates of overlapping packages. This makes me wonder: can't Pixi resolve the dependency versions once globally, and then expose only the specific features/packages requested per environment? Is this not possible, or am I missing a configuration step?Beta Was this translation helpful? Give feedback.
All reactions