-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Enhancement request: Warn if stamp = True
is used with no other input files
#4842
Comments
@buchgr related, the issue @mmorearty points out in rules_nodejs is because I couldn't find a way to apply a stamp to arbitrary rules (I'd rather have it on my |
@alexeagle - are you saying that there's no way to add stamp inputs for Skylark actions? That's independent of this feature request? |
@ulfjack I haven't found a way to do it yet. Also the only resource I could find on stamping has an empty- |
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 3 years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team ( |
Description of the problem / feature request:
It is a feature, not a bug, of build-stamping (genrule
stamp = True
) that the genrule will only be re-executed if one of the input files other thanbazel-out/volatile-status.txt
has changed.This is a good feature; but it is subtle, and seems to be something that a lot of people miss. One example, apparently from within Google: See step 3 under https://github.com/bazelbuild/rules_nodejs/blob/de5393f683b9a73d69d023ca0ffce8ed5d39fcfd/README.md#stamping
Bazel could help with this. If Bazel encounters a
genrule
which includesstamp = True
, but has nosrcs
at all, it would make sense to omit an error message (or at least a warning; but I think an error is appropriate).Feature requests: what underlying problem are you trying to solve with this feature?
People mis-using
stamp = True
, assuming that a genrule withstamp = True
and no input files can be used to generate an intermediate output file that can then be used by other targets.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
WORKSPACE
: empty fileBUILD
:main.in
:To repro the problem:
bazel build :main
, then look atbazel-bin/main.out
main.in
bazel build :main
again, and then look at the newbazel-bin/main.out
BUILD_TIMESTAMP
line ofbazel-bin/main.out
has not changed! It would be great if Bazel had given me an error in this case, since I wrote themystamp
rule incorrectly.What operating system are you running Bazel on?
Ubuntu Linux 14.04
What's the output of
bazel info release
?release 0.11.1
Have you found anything relevant by searching the web?
Searched bazelbuild/bazel/issues for
is:open stamp
The text was updated successfully, but these errors were encountered: