fix: don't rebuild unmodified deps on repeat install (#7270)

close #7268
This commit is contained in:
Zoltan Kochan
2023-11-01 18:21:49 +02:00
committed by GitHub
parent 55403726ea
commit b06f501831
2 changed files with 12 additions and 7 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/build-modules": patch
"pnpm": patch
---
Fixed a regression that was shipped with pnpm v8.10.0. Dependencies that were already built should not be rebuilt on repeat install. This issue was introduced via the changes related to [supportedArchitectures](https://github.com/pnpm/pnpm/pull/7214). Related issue [#7268](https://github.com/pnpm/pnpm/issues/7268).

View File

@@ -100,8 +100,9 @@ async function buildDependency (
builtHoistedDeps?: Record<string, DeferredPromise<void>>
warn: (message: string) => void
}
) {
): Promise<void> {
const depNode = depGraph[depPath]
if (!depNode.filesIndexFile) return
if (opts.builtHoistedDeps) {
if (opts.builtHoistedDeps[depNode.depPath]) {
await opts.builtHoistedDeps[depNode.depPath].promise
@@ -135,12 +136,10 @@ async function buildDependency (
patchFileHash: depNode.patchFile?.hash,
isBuilt: hasSideEffects,
})
if (depNode.filesIndexFile) {
await opts.storeController.upload(depNode.dir, {
sideEffectsCacheKey,
filesIndexFile: depNode.filesIndexFile,
})
}
await opts.storeController.upload(depNode.dir, {
sideEffectsCacheKey,
filesIndexFile: depNode.filesIndexFile,
})
} catch (err: any) { // eslint-disable-line
if (err.statusCode === 403) {
logger.warn({