Created
January 19, 2023 16:14
-
-
Save the-mikedavis/6b34a7f445a30fb34331d1fa19b89201 to your computer and use it in GitHub Desktop.
Bazel resize exit MWE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reproduction steps: | |
1. Clone this repository | |
2. `bazel run :hello-test` | |
3. Once the "..." characters have been printed, resize the terminal twice. | |
The `bazel run` process should exit with code 156. | |
Also notice that this behavior does not happen when running an executable | |
non-test rule: run `bazel run :hello-run` and resize the terminal. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("//:defs.bzl", "build_run", "build_test") | |
build_run(name = "hello-run") | |
build_test(name = "hello-test") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _impl(ctx): | |
output = ctx.actions.declare_file(ctx.label.name) | |
script = """echo "..." | |
sleep 60 | |
echo "Hi!" | |
""" | |
ctx.actions.write( | |
output = output, | |
content = script, | |
) | |
return [DefaultInfo(executable = output)] | |
build_test = rule( | |
implementation = _impl, | |
test = True, | |
) | |
build_run = rule( | |
implementation = _impl, | |
executable = True, | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# empty |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment