Merge pull request #962 from tonistiigi/bake-deps-error

build: fix deadlock on handling deps errors
This commit is contained in:
CrazyMax 2022-02-22 10:50:24 +01:00 committed by GitHub
commit 75cdea48e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -866,15 +866,13 @@ func Build(ctx context.Context, drivers []DriverInfo, opt map[string]Options, do
c := clients[dp.driverIndex]
eg.Go(func() error {
pw = progress.ResetTime(pw)
defer wg.Done()
if err := waitContextDeps(ctx, dp.driverIndex, results, &so); err != nil {
return err
}
pw = progress.ResetTime(pw)
defer wg.Done()
ch, done := progress.NewChannel(pw)
defer func() { <-done }()
frontendInputs := make(map[string]*pb.Definition)
for key, st := range so.FrontendInputs {
def, err := st.Marshal(ctx)
@ -893,6 +891,9 @@ func Build(ctx context.Context, drivers []DriverInfo, opt map[string]Options, do
so.FrontendAttrs = nil
so.FrontendInputs = nil
ch, done := progress.NewChannel(pw)
defer func() { <-done }()
rr, err := c.Build(ctx, so, "buildx", func(ctx context.Context, c gateway.Client) (*gateway.Result, error) {
res, err := c.Solve(ctx, req)
if err != nil {