chore: change default for run_binary#stamp
Greg convinced me that users will get really slow stamped builds because most run_binary tools don't actually read the status files, but will be cache-invalidated.
This commit is contained in:
parent
56bc408d94
commit
8a11a106db
|
@ -34,7 +34,7 @@ This rule does not require Bash (unlike `native.genrule`).
|
|||
| <a id="run_binary-mnemonic"></a>mnemonic | A one-word description of the action, for example, CppCompile or GoLink. | <code>"RunBinary"</code> |
|
||||
| <a id="run_binary-progress_message"></a>progress_message | Progress message to show to the user during the build, for example, "Compiling foo.cc to create foo.o". The message may contain %{label}, %{input}, or %{output} patterns, which are substituted with label string, first input, or output's path, respectively. Prefer to use patterns instead of static strings, because the former are more efficient. | <code>None</code> |
|
||||
| <a id="run_binary-execution_requirements"></a>execution_requirements | Information for scheduling the action.<br><br>For example,<br><br><pre><code> execution_requirements = { "no-cache": "1", }, </code></pre><br><br>See https://docs.bazel.build/versions/main/be/common-definitions.html#common.tags for useful keys. | <code>None</code> |
|
||||
| <a id="run_binary-stamp"></a>stamp | Whether to include build status files as inputs to the tool. Possible values:<br><br>- <code>stamp = 1</code>: Always include build status files as inputs to the tool, even in [--nostamp](https://docs.bazel.build/versions/main/user-manual.html#flag--stamp) builds. This setting should be avoided, since it is non-deterministic. It potentially causes remote cache misses for the target and any downstream actions that depend on the result. - <code>stamp = 0</code>: Never include build status files as inputs to the tool. This gives good build result caching. - <code>stamp = -1</code>: Inclusion of build status files as inputs is controlled by the [--[no]stamp](https://docs.bazel.build/versions/main/user-manual.html#flag--stamp) flag. Stamped targets are not rebuilt unless their dependencies change.<br><br>When stamping is enabled, an additional two environment variables will be set for the action: - <code>BAZEL_STABLE_STATUS_FILE</code> - <code>BAZEL_VOLATILE_STATUS_FILE</code><br><br>These files can be read and parsed by the action, for example to pass some values to a linker. | <code>-1</code> |
|
||||
| <a id="run_binary-stamp"></a>stamp | Whether to include build status files as inputs to the tool. Possible values:<br><br>- <code>stamp = 0</code> (default): Never include build status files as inputs to the tool. This gives good build result caching. Most tools don't use the status files, so including them in <code>--stamp</code> builds makes those builds have many needless cache misses. (Note: this default is different from most rules with an integer-typed <code>stamp</code> attribute.) - <code>stamp = 1</code>: Always include build status files as inputs to the tool, even in [--nostamp](https://docs.bazel.build/versions/main/user-manual.html#flag--stamp) builds. This setting should be avoided, since it is non-deterministic. It potentially causes remote cache misses for the target and any downstream actions that depend on the result. - <code>stamp = -1</code>: Inclusion of build status files as inputs is controlled by the [--[no]stamp](https://docs.bazel.build/versions/main/user-manual.html#flag--stamp) flag. Stamped targets are not rebuilt unless their dependencies change.<br><br>When stamping is enabled, an additional two environment variables will be set for the action: - <code>BAZEL_STABLE_STATUS_FILE</code> - <code>BAZEL_VOLATILE_STATUS_FILE</code><br><br>These files can be read and parsed by the action, for example to pass some values to a linker. | <code>0</code> |
|
||||
| <a id="run_binary-output_dir"></a>output_dir | If set to True then an output directory named the same as the target name is added to out_dirs.<br><br>Deprecated. For backward compatability with @aspect_bazel_lib 1.x. Use out_dirs instead. | <code>False</code> |
|
||||
| <a id="run_binary-kwargs"></a>kwargs | Additional arguments | none |
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ def run_binary(
|
|||
mnemonic = "RunBinary",
|
||||
progress_message = None,
|
||||
execution_requirements = None,
|
||||
stamp = -1,
|
||||
stamp = 0,
|
||||
# TODO: remove output_dir in 2.x release
|
||||
output_dir = False,
|
||||
**kwargs):
|
||||
|
@ -187,13 +187,16 @@ def run_binary(
|
|||
|
||||
stamp: Whether to include build status files as inputs to the tool. Possible values:
|
||||
|
||||
- `stamp = 0` (default): Never include build status files as inputs to the tool.
|
||||
This gives good build result caching.
|
||||
Most tools don't use the status files, so including them in `--stamp` builds makes those
|
||||
builds have many needless cache misses.
|
||||
(Note: this default is different from most rules with an integer-typed `stamp` attribute.)
|
||||
- `stamp = 1`: Always include build status files as inputs to the tool, even in
|
||||
[--nostamp](https://docs.bazel.build/versions/main/user-manual.html#flag--stamp) builds.
|
||||
This setting should be avoided, since it is non-deterministic.
|
||||
It potentially causes remote cache misses for the target and
|
||||
any downstream actions that depend on the result.
|
||||
- `stamp = 0`: Never include build status files as inputs to the tool.
|
||||
This gives good build result caching.
|
||||
- `stamp = -1`: Inclusion of build status files as inputs is controlled by the
|
||||
[--[no]stamp](https://docs.bazel.build/versions/main/user-manual.html#flag--stamp) flag.
|
||||
Stamped targets are not rebuilt unless their dependencies change.
|
||||
|
|
|
@ -28,5 +28,7 @@ run_binary(
|
|||
name = "run_stamper",
|
||||
outs = ["stamped"],
|
||||
args = ["$(location stamped)"],
|
||||
# Include status files as inputs when --stamp is set.
|
||||
stamp = -1,
|
||||
tool = "stamper",
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue