-
Notifications
You must be signed in to change notification settings - Fork 4.2k
stamp parameter for genrule is undocumented #4942
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
Comments
This looks like a duplicate of #4219 Also, related to this documentation issue, it's unclear from https://docs.bazel.build/versions/master/user-manual.html#workspace_status how to make use of the variables in those files. I tried using them in genrule in a similar fashion to how rules_docker makes them templated, e.g. genrule
Additionally, |
I used the stable-status.txt file to embed a git hash into my build:
The
There are probably more elegant ways to do this but this works for me. Without |
The authoritative guide to stamping: Workspace statusBazel invokes the workspace status command for each build. This command can output variables to stdout in FilesBazel places variables in two files in
RulesIt is up to each rule if any how they use these files ( Many rules have a Genrule
You have to read from |
Does this mean that genrules using |
Correct.
Yes. Though, I often write a rule to extract a single value anyway. status(
name = "example",
key = "FOO",
type = "volatile",
) And then pass that to downstream rules, for better cache hits. |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale. |
bump |
https://docs.bazel.build/versions/master/be/general.html#genrule
It doesn't mention the
stamp
parameter, used together with--workspace_status_command
to addbazel-out/stable-status.txt
andbazel-out/volatile-status.txt
as dependencies.The text was updated successfully, but these errors were encountered: