tree: 6417cd00dfbb4dc8c00a84d262dcba628a0530e3 [path history] [tgz]
  1. env/
  2. rust/
  3. .bazelignore
  4. .bazelrc
  5. .bazelversion
  6. .envrc
  7. .gitignore
  8. BUILD.bazel
  9. Cargo.lock
  10. Cargo.toml
  11. cargo_test.sh
  12. hello
  13. MODULE.bazel
  14. README.md
  15. rustc_test.sh
  16. rustfmt_test.sh
  17. WORKSPACE.bazel
  18. 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.