Fix Autogen Lockfile Overrides

This commit is contained in:
2026-04-25 23:36:12 +02:00
parent 88843a1ec1
commit d893785c0c
3 changed files with 305 additions and 25 deletions
+3 -15
View File
@@ -319,25 +319,13 @@ func newestAutogenInput(p *project.Project, now time.Time) (time.Time, string, e
}
cachePath := filepath.Join(p.Root, ".cache", consumer.Manifest.CacheName)
info, err := os.Stat(cachePath)
candidateTime, candidatePath, err := newestReleasedAutogenManifestInput(p, consumer, now, cachePath)
if err != nil {
if os.IsNotExist(err) {
if now.After(newest) {
newest = now
newestPath = cachePath
}
continue
}
return time.Time{}, "", fmt.Errorf("stat autogen manifest cache %s: %w", cachePath, err)
}
candidateTime := info.ModTime()
if autogenManifestCacheMaxAge > 0 && now.Sub(info.ModTime()) > autogenManifestCacheMaxAge {
candidateTime = now
return time.Time{}, "", err
}
if candidateTime.After(newest) {
newest = candidateTime
newestPath = cachePath
newestPath = candidatePath
}
}
return newest, newestPath, nil