Map all generated input roots into legacy doctest runfiles (#4271)

Legacy doctests run from a runfiles directory, but the launcher only
strips output roots found through crate and C++ library providers. A
generated rustc environment file built in an execution configuration
retains a `bazel-out/...` path and fails before rustdoc starts.

Collect the nonempty roots of every declared action input instead. This
also covers generated compiler/linker tools and keeps source paths
intact. The new regression executes a doctest using an environment file
forwarded through an execution transition; it fails with a missing-file
error on main and passes with this change.

Validation on macOS with Bazel 9.2.0: 17 owning tests pass on this
standalone branch. This extends the C++ runtime-root handling from
#4220. Windows execution was not tested locally.

Closes #4288.
4 files changed
tree: edcc9dd539635e1320e424ed7e50ae12a9418405
  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.