Skip to content

Commit b31a04f

Browse files
Update pkg/leeway/build.go
Co-authored-by: Mads Hartmann <[email protected]>
1 parent 2b2c4ec commit b31a04f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/leeway/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,8 @@ func (p *Package) build(buildctx *buildContext) (err error) {
621621
return err
622622
}
623623

624-
// Do this after building dependencies, to ensure all transitive dependencies are built
625-
// even if the package itself is already built.
624+
// Return early if the package is already built. We're explicitly performing this check after having built all the dependencies.
625+
// Previously we had it before, but that resulted in failed builds as there's no guarantee that the cache will contain transitive dependencies; in our case they were sometimes evicted from the cache due to S3 lifecycle rules
626626
_, alreadyBuilt := buildctx.LocalCache.Location(p)
627627
if p.Ephemeral {
628628
// ephemeral packages always require a rebuild

0 commit comments

Comments
 (0)