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

Improve structure of output of failed commands #15820

Open
fmeum opened this issue Jul 6, 2022 · 0 comments
Open

Improve structure of output of failed commands #15820

fmeum opened this issue Jul 6, 2022 · 0 comments
Labels
help wanted Someone outside the Bazel team could own this P3 We're not considering working on this, but happy to review a PR. (No assignee) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: feature request

Comments

@fmeum
Copy link
Collaborator

fmeum commented Jul 6, 2022

Description of the feature request:

Currently, when an action fails during the build, the output of the failed command is mixed with Bazel status information:

...
INFO: Found 1 target...
ERROR: /home/fhenneke/git/bazel-gazelle/language/go/BUILD.bazel:15:11: GoCompilePkg language/go/go.a failed: (Exit 1): builder failed: error executing command bazel-out/k8-opt-exec-2B5CBBC6/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix linux_amd64 -src language/go/bzlmod.go -src language/go/config.go -src language/go/constants.go ... (remaining 80 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
language/go/bzlmod.go:6:2: result declared but not used
compilepkg: error running subcommand external/go_sdk/pkg/tool/linux_amd64/compile: exit status 2
Target //language/go:go failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 7.574s, Critical Path: 0.78s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully

The order and structure of the log output can certainly be improved. I would personally find this much cleaner if it read more like this:

...
INFO: Found 1 target...
ERROR: /home/fhenneke/git/bazel-gazelle/language/go/BUILD.bazel:15:11: GoCompilePkg language/go/go.a failed: (Exit 1): builder failed: error executing command bazel-out/k8-opt-exec-2B5CBBC6/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix linux_amd64 -src language/go/bzlmod.go -src language/go/config.go -src language/go/constants.go ... (remaining 80 arguments skipped)
language/go/bzlmod.go:6:2: result declared but not used
compilepkg: error running subcommand external/go_sdk/pkg/tool/linux_amd64/compile: exit status 2

Target //language/go:go failed to build
Use --verbose_failures to see the command lines of failed build steps.
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
INFO: Elapsed time: 7.574s, Critical Path: 0.78s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully

Since --sandbox_debug seems to effectively imply --verbose_failures, this could probably be improved further.

What underlying problem are you trying to solve with this feature?

It should be clear to users which console output belongs to Bazel and which output belongs to the build tools invoked by Bazel.

Which operating system are you running Bazel on?

Any

What is the output of bazel info release?

5.2.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@sgowroji sgowroji added type: feature request untriaged team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website labels Jul 6, 2022
@meteorcloudy meteorcloudy added P3 We're not considering working on this, but happy to review a PR. (No assignee) help wanted Someone outside the Bazel team could own this and removed untriaged labels Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Someone outside the Bazel team could own this P3 We're not considering working on this, but happy to review a PR. (No assignee) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: feature request
Projects
None yet
Development

No branches or pull requests

3 participants