Unverified Commit ddafc990 authored by Jiwon Choi's avatar Jiwon Choi Committed by GitHub

Fix upgrade eval worktree dependency links (#100257)

### Why?

pnpm rejects symlinked task-state paths, so the upgrade evals fail while
preparing the stable candidate build.

### How?

Create a real `node_modules` directory in the isolated checkout and link
the installed dependency entries into it. Leave pnpm task state local to
that checkout.
parent f1a69d7d
...@@ -170,11 +170,21 @@ function buildStableCandidate(runRoot, destination) { ...@@ -170,11 +170,21 @@ function buildStableCandidate(runRoot, destination) {
stdio: 'ignore', stdio: 'ignore',
}) })
try { try {
fs.symlinkSync( // pnpm stores task state here and requires a real directory at this path.
path.join(root, 'node_modules'), // Reuse installed dependencies, but let this checkout own its task state.
path.join(checkout, 'node_modules'), const modules = path.join(checkout, 'node_modules')
'dir' fs.mkdirSync(modules)
) for (const name of fs.readdirSync(path.join(root, 'node_modules'))) {
if (name === '.pnpm-task-run-state-v1') {
continue
}
const source = path.join(root, 'node_modules', name)
fs.symlinkSync(
source,
path.join(modules, name),
fs.statSync(source).isDirectory() ? 'dir' : 'file'
)
}
for (const name of fs.readdirSync(path.join(root, 'packages'))) { for (const name of fs.readdirSync(path.join(root, 'packages'))) {
const modules = path.join(root, 'packages', name, 'node_modules') const modules = path.join(root, 'packages', name, 'node_modules')
const directory = path.join(checkout, 'packages', name) const directory = path.join(checkout, 'packages', name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment