pixi
pixi copied to clipboard
Display warning if cache cannot be used for hardlinks
Problem description
Hi everyone! I've just started playing with pixi and I really find it cool! I just wanted to report on an aspect that puzzled me on my first experience. I'm adding this as a feature request since it is not a bug.
TL; DR
It would be very important to display a clear warning to the user if pixi is falling back from the hardlink to the copy mechanism for the cache upon the pixi install
, init
or add
commands (maybe somewhere else as well?).
Full story
In my Windows 10x64 system I have two physical disk drives, C:
(for system) and D:
(for data and work). All of my coding work is done on drive D:
. However, on a default pixi installation, the default location of PIXI_HOME
and PIXI_CACHE_DIR
is on the C:
drive where all the system is installed.
In this way, IIUC, for all projects on the D:
drive, the pixi cache will work only as a cache for downloaded files, but it will not use cache to hardlink the packages. Therefore, it (silently) keeps on creating copies of the package files for all instantiated projects on the D:
drive.
It took some time to me to inspect the .pixi
folders and files with fsutil
and verify that indeed copies were created, not hardlinks, thereby significantly growing the used space on the drive. This is due to hardlinking not being possible across different filesystems.
Solution to avoid the problem
Change the PIXI_HOME
and PIXI_CACHE_DIR
to be D:\.pixi
and D:\.pixi\cache
(or any location within the drive your projects live in) and hardlinking works fine.