-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
add quiet mode to bazel run #4867
Comments
Agree that this would be nice to have. Realistically, I won't have time to work on this in the next months, even though this should not be a huge change. @ixdy Is the --script_path flag a possible workaround for your usecase? |
@philwo to me it looks like a bug that the And for us |
The --logging flag isn't related to the command-line output, but to
internal logging.
…On Tue, Sep 11, 2018 at 6:04 PM Joseph Lisee ***@***.***> wrote:
@philwo <https://github.com/philwo> to me it looks like a bug that the run
command not respecting the --logging flag
<https://github.com/bazelbuild/bazel/blob/3c5a109/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java#L72>.
For example even with --logging=0, bazel run still produces INFO logging
information. From looking at the code
<https://github.com/bazelbuild/bazel/blob/56d125b9a4c8bf9a18bb83e473bc07759c708087/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalEventHandler.java>
it appears we need more filtering options in the build event handler.
And for us --script_path is not really a work around because it does not
force a rebuild. We are trying to go for a system where you don't
explicitly build anything you always use a bazal command, but that is
hampered by the noise generated here.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4867 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHA9YZIGv2lJPJj40hYv-3BaSfVpCmJ4ks5uZ98ggaJpZM4SuiR3>
.
|
Have any new workarounds been found since last year for this? |
Unfortunately, it looks like setting it to 0 means no limit. |
At the moment there is not an option to easily control the verbosity of Bazel UI. The `ui_event_filters` option allows to arbitrarily filter events from the UI. The syntax is the same as `build_tag_filters` or `output_group`, so it is possible to add or remove events, using leading `+/-`, or override the default set completely with direct assignment. Related: #4867 Closes #10936. PiperOrigin-RevId: 310417852
@ulfjack Is there a way to use |
No, unfortunately not. It limits all output, not just info messages. Bazel 3.3.0 has commit 7c67d1d, which adds |
Hey, just wanted to share the option I've gone with to invoke CLI tools build via Bazel:
|
Beware that @peter-db 's approach means you will lose edit: a more complete fix is to use #!/usr/bin/env bash
set -e
# Make a temp dir for this script.
tempdir="$(mktemp -d)"
# Generate a script containing the commands that bazel run *would* execute.
# Write build logs to a file (not the terminal), and if the build fails,
# *then* show the output from the file.
bazel run //foo --script_path="$tempdir/script.sh" &>"$tempdir/build.log" || {
cat "$tempdir/build.log" >&2
exit 1
}
# Run the script, forwarding extra args.
chmod +x "$tempdir/script.sh"
exec "$script" "$@" |
Seems like this issue is solved by ui_event_filters, no?
Related: #12831 (comment) |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team ( |
I feel like this is still not working correctly, if I set the following flags:
I still see debug logs when the server is shutdown:
|
Yep, there are some logs still left (maybe that is the only one?) |
I also occasionally see "Extracting Bazel installation...". Is there any way to suppress this log and "Starting local Bazel server and connecting to it..."? I have the following:
|
Update: I'm cooking a change for this. It's Google-internal because it turns out that it requires quite a bit of refactoring in the client to suppress the The interface will be |
Finishing touches for #4867. RELNOTES: None. PiperOrigin-RevId: 686819148 Change-Id: I9ff2424683b8579ad5a953f7974c9579c5e715db
This change adds a "--quiet" startup option, which causes Blaze not to print any status messages, progress messages, info messages or warnings of any kind. Error messages are still emitted as usual. Fixes #4867. RELNOTES[NEW]: The "blaze --quiet" command line option can now be used to make Blaze emit much less output. PiperOrigin-RevId: 686784300 Change-Id: Ibaa0b6a1788b43863337dce6fc16da09defb6724
Finishing touches for #4867. RELNOTES: None. PiperOrigin-RevId: 686819148 Change-Id: I9ff2424683b8579ad5a953f7974c9579c5e715db
Implement "quiet mode" This change adds a "--quiet" startup option, which causes Blaze not to print any status messages, progress messages, info messages or warnings of any kind. Error messages are still emitted as usual. Fixes #4867. RELNOTES[NEW]: The "blaze --quiet" command line option can now be used to make Blaze emit much less output. PiperOrigin-RevId: 686784300 Change-Id: Ibaa0b6a1788b43863337dce6fc16da09defb6724
Rearguard fighting for #4867. RELNOTES: None. PiperOrigin-RevId: 688453143 Change-Id: I3f5a2f3f69676b5c5d6941b25b0d4c35a06e6056
Rearguard fighting for #4867. RELNOTES: None. PiperOrigin-RevId: 688453143 Change-Id: I3f5a2f3f69676b5c5d6941b25b0d4c35a06e6056
Rearguard fighting for #4867. RELNOTES: None. PiperOrigin-RevId: 688453143 Change-Id: I3f5a2f3f69676b5c5d6941b25b0d4c35a06e6056
A fix for this issue has been included in Bazel 8.0.0 RC2. Please test out the release candidate and report any issues as soon as possible. |
Description of the problem / feature request:
bazel run
always prints out a few INFO log messages before running the command, and there seems to be no way of suppressing that output.For example, I want to suppress all of these
INFO:
lines when running the following in kuberentes/kubernetes:Feature requests: what underlying problem are you trying to solve with this feature?
I'd like to be able to build and run binaries through bazel without any additional information being written to stderr/stdout, since the tool being run also prints to stderr/stdout.
What operating system are you running Bazel on?
Linux
What's the output of
bazel info release
?release 0.11.1
Have you found anything relevant by searching the web?
Found a related discussion in https://groups.google.com/forum/#!topic/bazel-discuss/JVCotYRXeyk.
I couldn't find any feature requests filed after @ulfjack's last reply there.
The text was updated successfully, but these errors were encountered: