bazel-contrib / bazel-contrib/rules_multitool
cwd target doesn't work with ibazel
- Dominant language
- Starlark
- Stars
- 25
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
A customer pointed out that the pattern documented on the README
https://github.com/theoremlp/rules_multitool?tab=readme-ov-file#running-tools-in-the-current-working-directory
doesn't work correctly with some programs like `ibazel` (bazel-watcher) because zombie processes get left behind.
We think this post from @lberki is related https://groups.google.com/g/bazel-discuss/c/I6TWUv8AI5o
I think this can be reproduced by running some server target under `./tools/ibazel //my/server:target`, then when you ctrl-c (SIGINT) you'll still see the server is running.
So we changed our `aspect init` https://github.com/aspect-build/aspect-workflows-template/pull/87
to still stamp out a script that DOES function correctly:
```
#!/bin/sh
target="@multitool//tools/$(basename "$0")"
bazel 2>/dev/null build "$target" && exec $(bazel info execution_root)/$(bazel 2>/dev/null cquery --output=files "$target") "$@"
```
Personally I think `bazel run` is still just busted in a way rules_multitool shouldn't try to fix.
Contributor guide
Assessment
This issue has not been assessed yet.