Skip to content

Commit 952b343

Browse files
authored
build: make linter emit output (#28704)
1 parent cd58897 commit 952b343

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

build/ci.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ func doLint(cmdline []string) {
366366

367367
linter := downloadLinter(*cachedir)
368368
lflags := []string{"run", "--config", ".golangci.yml"}
369-
build.MustRunCommand(linter, append(lflags, packages...)...)
369+
build.MustRunCommandWithOutput(linter, append(lflags, packages...)...)
370370
fmt.Println("You have achieved perfection.")
371371
}
372372

internal/build/util.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,25 @@ func MustRunCommand(cmd string, args ...string) {
6868
MustRun(exec.Command(cmd, args...))
6969
}
7070

71+
func MustRunCommandWithOutput(cmd string, args ...string) {
72+
var done chan bool
73+
// This is a little loop to generate some output, so CI does not tear down the
74+
// process after 300 seconds.
75+
go func() {
76+
for i := 0; i < 15; i++ {
77+
fmt.Printf("Waiting for command %q\n", cmd)
78+
select {
79+
case <-time.After(time.Minute):
80+
break
81+
case <-done:
82+
return
83+
}
84+
}
85+
}()
86+
MustRun(exec.Command(cmd, args...))
87+
close(done)
88+
}
89+
7190
var warnedAboutGit bool
7291

7392
// RunGit runs a git subcommand and returns its output.

0 commit comments

Comments
 (0)