Skip to content

Commit f6d4cb6

Browse files
committed
chore: debug logs
Signed-off-by: Chris Goller <goller@gmail.com>
1 parent f506e90 commit f6d4cb6

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

pkg/buildx/commands/bake.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,13 @@ func BakeCmd() *cobra.Command {
422422
}
423423

424424
// Wait for all builds to complete
425+
fmt.Fprintf(os.Stderr, "**waiting for builds to complete***\n")
425426
err = eg.Wait()
426427

427428
// Now wait for the printer to finish and flush all output
429+
fmt.Fprintf(os.Stderr, "**waiting for printer to finish***\n")
428430
for range projectIDs {
431+
fmt.Fprintf(os.Stderr, "**waiting for one printer Wait***\n")
429432
_ = printer.Wait()
430433
}
431434

pkg/progresshelper/shared.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package progresshelper
22

33
import (
44
"context"
5+
"fmt"
56
"os"
67
"sync"
78
"sync/atomic"
@@ -45,20 +46,23 @@ func NewSharedPrinter(mode string) (*SharedPrinter, error) {
4546
// Each call to Add() should be matched with a call to Wait().
4647
func (w *SharedPrinter) Add() {
4748
w.wg.Add(1)
48-
w.numPrinters.Add(1)
49+
numPrinters := w.numPrinters.Add(1)
50+
fmt.Fprintf(os.Stderr, "**add done, numPrinters=%d***\n", numPrinters)
4951
}
5052

5153
func (w *SharedPrinter) Wait() error {
5254
w.wg.Done()
53-
55+
numPrinters := w.numPrinters.Load()
5456
lastPrinter := w.numPrinters.Add(-1) == 0
57+
fmt.Fprintf(os.Stderr, "**wait done, numPrinters=%d***\n", numPrinters)
5558

5659
// The docker progress writer will only return an
5760
// error if it is a context cancellation error.
5861
//
5962
// Only the last printer will be the one to stop the docker printer as
6063
// the docker printer closes channels.
6164
if lastPrinter {
65+
fmt.Fprintf(os.Stderr, "**last printer, stopping docker printer***\n")
6266
w.wg.Wait()
6367
w.cancel()
6468
_ = w.printer.Wait()

0 commit comments

Comments
 (0)