Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: pass the -x output as a Context key instead of hard-coding os.Stderr #56886

Open
bcmills opened this issue Nov 21, 2022 · 1 comment
Open
Labels
GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Nov 21, 2022

When we run go build -x, we send a bunch of extra logging to os.Stderr. That's fine in production code, but it makes unit-testing unpleasant: if tests run in parallel with cfg.BuildX set to true, the logging from the tests ends up all jumbled together.

We're already threading through a context.Context argument to many functions for tracing (see cmd/go.maybeStartTrace). We should also use that argument for output streams in order to better isolate tests.

@bcmills bcmills added NeedsFix The path to resolution is known, but the work has not been done. GoCommand cmd/go labels Nov 21, 2022
@bcmills bcmills added this to the Backlog milestone Nov 21, 2022
@gopherbot
Copy link

Change https://go.dev/cl/452456 mentions this issue: cmd/go: propagate Context arguments through modfetch methods

gopherbot pushed a commit that referenced this issue May 18, 2023
For #56886.
For #38714.

Change-Id: I15c4a8673407d3423d7e203d645c6d0fb780d192
Reviewed-on: https://go-review.googlesource.com/c/go/+/452456
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants