@@ -16,7 +16,6 @@ import (
16
16
"os"
17
17
"os/exec"
18
18
"path/filepath"
19
- "reflect"
20
19
"regexp"
21
20
"runtime"
22
21
"strconv"
@@ -250,16 +249,13 @@ func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error {
250
249
cmd .Stdout = stdout
251
250
cmd .Stderr = stderr
252
251
253
- // cmd.WaitDelay was added only in go1.20 (see #50436).
254
- if waitDelay := reflect .ValueOf (cmd ).Elem ().FieldByName ("WaitDelay" ); waitDelay .IsValid () {
255
- // https://go.dev/issue/59541: don't wait forever copying stderr
256
- // after the command has exited.
257
- // After CL 484741 we copy stdout manually, so we we'll stop reading that as
258
- // soon as ctx is done. However, we also don't want to wait around forever
259
- // for stderr. Give a much-longer-than-reasonable delay and then assume that
260
- // something has wedged in the kernel or runtime.
261
- waitDelay .Set (reflect .ValueOf (30 * time .Second ))
262
- }
252
+ // https://go.dev/issue/59541: don't wait forever copying stderr
253
+ // after the command has exited.
254
+ // After CL 484741 we copy stdout manually, so we we'll stop reading that as
255
+ // soon as ctx is done. However, we also don't want to wait around forever
256
+ // for stderr. Give a much-longer-than-reasonable delay and then assume that
257
+ // something has wedged in the kernel or runtime.
258
+ cmd .WaitDelay = 30 * time .Second
263
259
264
260
// The cwd gets resolved to the real path. On Darwin, where
265
261
// /tmp is a symlink, this breaks anything that expects the
0 commit comments