зеркало из https://github.com/golang/tools.git
gopls/internal/server: print stderr in go mod vendor error message
TestInconsistentVendoring is flaking on Windows with the not-so-helpful "exit status 1". Include stderr in the error message to help debug. For golang/go#64229 Change-Id: Iadb946e799e866af683ea9ea7fc039f34b45b1ba Reviewed-on: https://go-review.googlesource.com/c/tools/+/550375 Auto-Submit: Robert Findley <rfindley@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Родитель
e601fd80ad
Коммит
3bed1477e2
|
@ -386,12 +386,16 @@ func (c *commandHandler) Vendor(ctx context.Context, args command.URIArg) error
|
|||
// If golang/go#44119 is resolved, go mod vendor will instead modify
|
||||
// modules.txt in-place. In that case we could theoretically allow this
|
||||
// command to run concurrently.
|
||||
stderr := new(bytes.Buffer)
|
||||
err := deps.snapshot.RunGoCommandPiped(ctx, cache.Normal|cache.AllowNetwork, &gocommand.Invocation{
|
||||
Verb: "mod",
|
||||
Args: []string{"vendor"},
|
||||
WorkingDir: filepath.Dir(args.URI.Path()),
|
||||
}, &bytes.Buffer{}, &bytes.Buffer{})
|
||||
return err
|
||||
}, &bytes.Buffer{}, stderr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("running go mod vendor failed: %v\nstderr:\n%s", err, stderr.String())
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче