diff --git a/build/build.go b/build/build.go index 6a18091c..106c9a17 100644 --- a/build/build.go +++ b/build/build.go @@ -759,6 +759,11 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s results.Set(rKey, res) if children, ok := childTargets[rKey]; ok && len(children) > 0 { + // wait for the child targets to register their LLB before evaluating + _, err := results.Get(ctx, children...) + if err != nil { + return nil, err + } // we need to wait until the child targets have completed before we can release eg, ctx := errgroup.WithContext(ctx) eg.Go(func() error {