Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn incorrectly uses $XDG_DATA_HOME for linkFolder #9029

Open
asottile-sentry opened this issue Jan 24, 2024 · 1 comment
Open

yarn incorrectly uses $XDG_DATA_HOME for linkFolder #9029

asottile-sentry opened this issue Jan 24, 2024 · 1 comment

Comments

@asottile-sentry
Copy link

yarn's default for linkFolder is in the default for $XDG_CONFIG_HOME:

$ yarn config current | grep linkFolder
  "linkFolder": "/Users/asottile/.config/yarn/link",

the default for XDG_CONFIG_HOME is ~/.config

applying XDG_DATA_HOME changes the value of linkFolder even if XDG_DATA_HOME is set to the default:

$ XDG_DATA_HOME=$HOME/.local/share yarn config current | grep linkFolder
  "linkFolder": "/Users/asottile/.local/share/yarn/link",

this appears to be two bugs -- fixing either would resolve this:

@Daniel15
Copy link
Member

Daniel15 commented May 24, 2024

Good point, and in fact there's a comment in the code that alludes to this:

// Instead, use our prior fallback. Some day this could be
// path.join(userHome, '.local', 'share', 'yarn')
// or return path.join(WIN32_APPDATA_DIR, 'Data') on win32

I think the old fallback was kept for backwards compatibility.

The XDG spec says:

$XDG_DATA_HOME defines the base directory relative to which user-specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.

So it should be falling back to .local/share/yarn/link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants