yarnpkg / berry

📦🐈 Active development trunk for Yarn ⚒
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.47k stars 1.12k forks source link

[Bug]: enableGlobalCache doesn't work properly #6562

Closed sequencerr closed 1 month ago

sequencerr commented 1 month ago

Self-service

Describe the bug

enableGlobalCache: false set custom global cache dir, yarn install, stores cache both to global dir and to the user defined one.

To reproduce

YARN_CACHE_FOLDER="$XDG_CACHE_HOME/yarn" YARN_ENABLE_GLOBAL_CACHE=false yarn

Environment

OS: Linux 6.10 Debian GNU/Linux 12 (bookworm) Yarn: 4.5.1 - /tmp/xfs-b8d0ec6c/yarn

type yarn yarn is hashed (/home/###/.local/bin/yarn)

Additional context

No response

arcanis commented 1 month ago

YARN_ENABLE_GLOBAL_CACHE is misnamed, and actually controls whether Yarn use the local cache or not. Whether it uses the global folder as well as the local cache is controlled by a different setting, enableMirror.