mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(build): restore exact cache output snapshots (#122837)
This commit is contained in:
committed by
GitHub
parent
87b503675a
commit
93f5e0f1f6
@@ -853,6 +853,14 @@ export function restoreBuildAllStepCacheOutputs(
|
||||
}
|
||||
const fsImpl = params.fs ?? fs;
|
||||
const rootDir = params.rootDir ?? process.cwd();
|
||||
const stampedOutputSet = new Set(cacheState.stampedOutputs);
|
||||
// A restored snapshot owns its declared output set. Remove older checkout
|
||||
// outputs first so cache hits cannot combine declarations from two builds.
|
||||
for (const relativeFile of cacheState.relativeOutputFiles ?? []) {
|
||||
if (!stampedOutputSet.has(normalizePortablePath(relativeFile))) {
|
||||
fsImpl.rmSync(path.resolve(rootDir, relativeFile), { force: true });
|
||||
}
|
||||
}
|
||||
for (const relativeFile of cacheState.stampedOutputs) {
|
||||
copyFileSync(
|
||||
fsImpl,
|
||||
|
||||
Reference in New Issue
Block a user