-
Notifications
You must be signed in to change notification settings - Fork 81
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
Allow making the cabal builds totally silent #1208
Conversation
haskell/private/cabal_wrapper.py.tpl
Outdated
print(err.stdout.decode()) | ||
print(err.stderr.decode(), file=sys.stderr) |
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 you can avoid the decode
with sys.std(out|err).buffer.write
.
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.
Oh thanks, didn't know that. I'll try this
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.
Nice, that works indeed.
"verbose": attr.bool( | ||
default = False, | ||
doc = "Whether to show the output of the build", | ||
), |
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.
This needs to be forwarded to the generated calls to haskell_cabal_library
to have any effect.
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.
Indeed, just noticed that. Should be good now
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.
Looks good, thank you!
One small comment.
haskell/private/cabal_wrapper.py.tpl
Outdated
# print(err.stdout.decode()) | ||
# print(err.stderr.decode(), file=sys.stderr) |
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.
Remove those?
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.
Oops 😇
Done
Give an option in `cabal_haskell_library` and `stack_snapshot` to make the builds totally silent (except in case of failure). This is useful to enforce quietness even for build steps for which cabal can't enforce it (like `cabal configure` or `cabal haddock`)
…han true Co-Authored-By: Andreas Herrmann <andreas.herrmann@tweag.io>
476abb7
to
6bb8092
Compare
Give an option in
cabal_haskell_library
andstack_snapshot
to make the builds totally silent (except in case of failure).This is useful to enforce quietness even for build steps for which cabal can't enforce it (like
cabal configure
orcabal haddock
).I didn't add a test for it because I don't know how to test for the console output of a rule in bazel. If someone knows a way, I'd be happy to add a test for it.