-
Notifications
You must be signed in to change notification settings - Fork 519
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
feat(builtin): add silent_on_success option to npm_package_bin #3336
Conversation
|
||
if [[ "$EXIT_CODE" != 0 ]]; then | ||
if [ ${STDOUT_CAPTURE_IS_NOT_AN_OUTPUT} = true ]; then | ||
cat "$STDOUT_CAPTURE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I debated doing a breaking change here of cat
ing the output even if it is being captured. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine, conceptually if the output is "captured" then I can see the case for it not making it to stdout. No ones opened an issue so far saying that they'd like to see the output of captured outs.
Discussed a little with Alex, I think we'd rather move towards the breaking change that I think you're trying to work around, rather than introducing an explicit "silence the tool" attribute. If we instead introduced a new attribute here, Does this cover the use case fully? |
I think it might also be reasonable to have the new |
Thanks for looking! If I go the route of
All that would be possible today without the extra flag, right? Since I'd need the I guess we are smashing the JS-world into the |
Yes, correct. The part that breaks at rh is that the rule consuming the output of the loud tool is only expecting a single file as its input, so we need the The genrule will also have to provide some output file that something depends on too, otherwise it'll never be run. |
Thank you. Given that, couldn't that genrule just filter out the stdout and we wouldn't need any upstream changes? I guess I'm saying that either I need all the extra machinery downstream of this rule, or I need this rule to behave like `bazel` expects, but doing `include_captured_stdio_in_default_outputs` doesn't really do either.
|
I guess it could? The genrule would have to be able to tell which was the "main" output file (expanding all of them via |
I'm working on something like that, and it is somewhat working, but |
I updated to add the same option to
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows failure looks like it's the same at HEAD.
lgtm
|
||
if [[ "$EXIT_CODE" != 0 ]]; then | ||
if [ ${STDOUT_CAPTURE_IS_NOT_AN_OUTPUT} = true ]; then | ||
cat "$STDOUT_CAPTURE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine, conceptually if the output is "captured" then I can see the case for it not making it to stdout. No ones opened an issue so far saying that they'd like to see the output of captured outs.
produce no output on stdout nor stderr when program exits with status code 0. | ||
This makes node binaries match the expected bazel paradigm. | ||
|
||
Defaults to `False` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll open a tracking issue for if we want to flip this to True
in 6.x
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
nodejs programs which output on stdout and stderr have no way to be silenced on success
What is the new behavior?
A new flag where we can silence binaries that are loud when they are successful.
I couldn't figure out how to write a test here since
sh_test
can't invokebazel build
commands easily to check the stdout, and my flag doesn't change the behavior of thestdout
norstderr
files incase a user wants to still use them.Without this flag I get:
and then with it I get:
And if I introduce a syntax error into
internal/node/test/terser_input_with_diagnostics.js
I still see the errors when running:Does this PR introduce a breaking change?
Other information