tree: f74d5bef8e399646b8fe996dc33bd3c2eaccbb22 [path history] [tgz]
  1. env/
  2. rust/
  3. .bazelignore
  4. .bazelrc
  5. .envrc
  6. .gitignore
  7. BUILD.bazel
  8. Cargo.lock
  9. Cargo.toml
  10. cargo_test.sh
  11. MODULE.bazel
  12. README.md
  13. rustc_test.sh
  14. rustfmt_test.sh
  15. WORKSPACE.bazel
  16. WORKSPACE.bzlmod
examples/bazel_env/README.md

rules_rust with bazel_env

This example uses bazel_env.bzl to provide cargo, cargo-clippy, rustc and rustfmt from the bazel toolchains to the user. They will be available directly in the PATH when the user enters this directory and has direnv set up.

Advantages:

  • The user doesn't have to install the toolchains themselves.
  • The tool versions will always match exactly those that bazel uses.