Skip to content

Instantly share code, notes, and snippets.

@the-mikedavis
Created January 19, 2023 16:14
Show Gist options
  • Save the-mikedavis/6b34a7f445a30fb34331d1fa19b89201 to your computer and use it in GitHub Desktop.
Save the-mikedavis/6b34a7f445a30fb34331d1fa19b89201 to your computer and use it in GitHub Desktop.
Bazel resize exit MWE
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.
load("//:defs.bzl", "build_run", "build_test")
build_run(name = "hello-run")
build_test(name = "hello-test")
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,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment