tree: d308ed766c09aa7e450f570d0946b48b3abd0b7c [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. hello
  12. MODULE.bazel
  13. README.md
  14. rustc_test.sh
  15. rustfmt_test.sh
  16. WORKSPACE.bazel
  17. 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.