cargo_build_scripts can be run from custom directories (#2152)

While running from CARGO_MANIFEST_DIR is the simplest thing for
compatibility, there are cases where a cargo build script may be easier
to run from the exec root as most bazel actions do (e.g. where a C++
toolchain specifies in-repo include paths).

This mirrors the `rundir` attribute of `go_test`, which has similar
concerns:
https://github.com/bazelbuild/rules_go/blob/master/docs/go/core/rules.md#go_test-rundir
229 files changed
tree: 942d071f01437defe696aacb8fd3612bfcef1d5a
  1. .bazelci/
  2. .github/
  3. bindgen/
  4. cargo/
  5. crate_universe/
  6. docs/
  7. examples/
  8. proto/
  9. rust/
  10. test/
  11. tools/
  12. util/
  13. wasm_bindgen/
  14. .bazelignore
  15. .bazelrc
  16. .clang-format
  17. .gitattributes
  18. .gitignore
  19. .rustfmt.toml
  20. ARCHITECTURE.md
  21. AUTHORS
  22. BUILD.bazel
  23. CODEOWNERS
  24. COMPATIBILITY.md
  25. CONTRIBUTING.md
  26. CONTRIBUTORS
  27. LICENSE.txt
  28. MODULE.bazel
  29. README.md
  30. version.bzl
  31. WORKSPACE.bazel
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.