Stamp only binaries by default (#1452)

Currently we pass `bazel-out/volatile-status.txt` to all the `Rustc` actions, which is bad for remote caching with `--stamp`enabled.

This PR makes only `rust_binary` be affected by the `--stamp` flag by default. The rest of the rust rules have `stamp = 0` as a default. Should you want to force stamp you can set `stamp = 1`. If you want to make your target stamp behavior depend on the `--stamp` command line flag, use `stamp = -1`.

Additionally, this PR makes `rules_rust` also use the stable keys for stamping, by passing `bazel-out/stable-status.txt` to the relevant `Rustc` actions when stamping is enabled. This makes `rules_rust` adhere to the contract described here: https://docs.bazel.build/versions/main/user-manual.html#flag--workspace_status_command
9 files changed
tree: a8b852486e5f59c2b5ca6e514c3536dea78b0889
  1. .bazelci/
  2. .github/
  3. bindgen/
  4. cargo/
  5. crate_universe/
  6. distro/
  7. docs/
  8. examples/
  9. proto/
  10. rust/
  11. test/
  12. tools/
  13. util/
  14. wasm_bindgen/
  15. .bazelignore
  16. .bazelrc
  17. .clang-format
  18. .gitignore
  19. ARCHITECTURE.md
  20. AUTHORS
  21. BUILD.bazel
  22. CODEOWNERS
  23. COMPATIBILITY.md
  24. CONTRIBUTING.md
  25. CONTRIBUTORS
  26. LICENSE.txt
  27. README.md
  28. version.bzl
  29. WORKSPACE.bazel
  30. workspace.bzl
README.md

Rust Rules

  • Postsubmit Build status

Overview

This repository provides rules for building Rust projects with Bazel.

Community

General discussions and announcements take place in the GitHub Discussions, but there are additional places where community members gather to discuss rules_rust.

Documentation

Please refer to the full documentation.