Skip to content

fix: apply correct fs restrictions for pnpm gvs#22415

Merged
bluwy merged 8 commits into
vitejs:mainfrom
btea:fix/pnpm-global-virtual-store-22405
Jun 6, 2026
Merged

fix: apply correct fs restrictions for pnpm gvs#22415
bluwy merged 8 commits into
vitejs:mainfrom
btea:fix/pnpm-global-virtual-store-22405

Conversation

@btea

@btea btea commented May 10, 2026

Copy link
Copy Markdown
Contributor

close #22405

@bluwy

bluwy commented May 19, 2026

Copy link
Copy Markdown
Member

I don't think this addresses what sapphi mentioned here. But we also don't want to run this exec for everyone on every startup.

I noticed pnpm saves some metadata in node_modules/.modules.yaml where:

non-gvs:

{
  "storeDir": "/Users/bjorn/Library/pnpm/store/v11",
  "virtualStoreDir": ".pnpm",
  "virtualStoreDirMaxLength": 120
}

gvs:

{
  "storeDir": "/Users/bjorn/Library/pnpm/store/v11",
  "virtualStoreDir": "../../../../Library/pnpm/store/v11/links",
  "virtualStoreDirMaxLength": 120,

we could use the path here to pass to the allowlist.

@btea

btea commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

This looks good; we don't even need to distinguish whether GVS is running or not. We can directly read the relevant file and retrieve the value of the storeDir field. However, it seems we need to add an operation to read and parse the YAML file.

@btea

btea commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

Normally, the content of a node_modules/.modules.yaml file is in a standard JSON format, so using JSON.parse to parse it is generally sufficient.

Comment thread packages/vite/src/node/server/index.ts Outdated
Comment thread packages/vite/src/node/server/index.ts Outdated
@bluwy bluwy merged commit 092320b into vitejs:main Jun 6, 2026
18 checks passed
@btea btea deleted the fix/pnpm-global-virtual-store-22405 branch June 6, 2026 13:22
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

Successfully merging this pull request may close these issues.

Support pnpm enableGlobalVirtualStore

2 participants