Pipelining: let the full rustc action write its own .rmeta (#4390)

Fixes #4389. Related: #3383, #3662.

With pipelining the `Rustc` action emitted `metadata` to the same path
as the `RustcMetadata` action. Without a sandbox the second write hits
the read-only file from the first. The full action now emits metadata to
`_rmeta_full/<name>.rmeta`, which is kept out of the declared outputs.
Skipped with `experimental_use_cc_common_link`.

Test: `bazel test
//test/unit/pipelined_compilation:pipelined_compilation_test_suite` (new
`rmeta_paths_test`; `second_lib_test` updated). The new test fails
without the change.

Assisted by Claude.
2 files changed
tree: 9ece51d01b6c8bfb6f279bbd3cfaebf1ed004dab
  1. .bazelci/
  2. .bcr/
  3. .github/
  4. cargo/
  5. crate_universe/
  6. docs/
  7. examples/
  8. extensions/
  9. ffi/
  10. nix/
  11. rust/
  12. test/
  13. tools/
  14. util/
  15. .bazelignore
  16. .bazelrc
  17. .clang-format
  18. .clippy.toml
  19. .envrc
  20. .gitattributes
  21. .gitignore
  22. .pre-commit-config.yaml
  23. .prettierrc.toml
  24. .rustfmt.toml
  25. .typos.toml
  26. ARCHITECTURE.md
  27. AUTHORS
  28. BUILD.bazel
  29. CODEOWNERS
  30. COMPATIBILITY.md
  31. CONTRIBUTING.md
  32. CONTRIBUTORS
  33. LICENSE.txt
  34. MODULE.bazel
  35. README.md
  36. version.bzl
  37. WORKSPACE.bazel
README.md

Rust Rules

  • Postsubmit Build status

Overview

This repository provides rules for building Rust projects with Bazel.

Starter repo

The fastest way to try this in an empty project is to click the green “Use this template” button on https://github.com/bazel-starters/rust.

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.