Treat rustfmt as optional (#1164)

All the code above this call treats rustfmt as optional, but then when
we make the BUILD for the rust toolchain, we unconditionally point at
the presumed rustfmt label.

At
https://github.com/bazelbuild/rules_rust/blob/59fab4e79f62bfa13551ac851a40696c24c0c3a4/rust/toolchain.bzl#L331-L335
we conditionally create a symlink based on whether the attribute is set,
but because we unconditionally set the attribute, this causes a hard
error failing to symlink to a non-existent file.

Instead, treat rustfmt as optional in this function too, so that the
code above and below properly convey the optionality to each other.
1 file changed
tree: 6cb8e99fa1f70a6b1055bc2fef5190aec426bb2d
  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. .gitignore
  17. ARCHITECTURE.md
  18. AUTHORS
  19. BUILD.bazel
  20. CODEOWNERS
  21. COMPATIBILITY.md
  22. CONTRIBUTING.md
  23. CONTRIBUTORS
  24. LICENSE.txt
  25. README.md
  26. WORKSPACE.bazel
  27. workspace.bzl
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.