bazelbuild / bazelbuild/bazel-skylib
Support `stamp` in `run_binary`
- Dominant language
- Starlark
- Stars
- 444
- Forks
- 202
- PR merge metrics
- No merged PRs in 30d
Description
It's common to use `genrule` with `stamp = -1` to integrate the workspace status (git hash or timestamp) into binaries. (This is not well documented, but see https://github.com/bazelbuild/bazel/issues/4942.) However, `genrule` is not cross-platform; folks should really be using `run_binary` instead of `genrule` wherever they can. Unfortunately, `run_binary` doesn't have the `stamp` attribute!
The FR is to add that support.
BTW, the `bazel-lib` fork of `run_binary` does support `stamp = -1` https://github.com/bazel-contrib/bazel-lib/issues/185. I'm not sure if the fork is close enough for the support to be easy to upstream.
Contributor guide
Research direction
Start with the run_binary rule and compare its stamp behavior with genrule and the bazel-lib fork referenced in the issue. Confirm how stamp = -1 integrates workspace status, then add support and verify that run_binary can use it for cross-platform binary generation.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100