Make lto toolchain options public and don't link proc-macros with LTO (#3147)

I would like to make lto setting public in toolchain so that when we are
providing custom toolchains it would be easier to make configurations
for LTO with `select` statements.

The logic which determines the flags based on cargo outputs.

Proc-macro crates can not be linked with lto and we should not emit
bitcode either. This fixes #3143

---------

Co-authored-by: Daniel Wagner-Hall <dwagnerhall@apple.com>
4 files changed
tree: b7debadedd28462928b889eb44b34af4d5eb3780
  1. .bazelci/
  2. .bcr/
  3. .github/
  4. cargo/
  5. crate_universe/
  6. docs/
  7. examples/
  8. extensions/
  9. ffi/
  10. nix/
  11. rust/
  12. test/
  13. tools/
  14. util/
  15. .bazelignore
  16. .bazelrc
  17. .bazelversion
  18. .clang-format
  19. .clippy.toml
  20. .envrc
  21. .gitattributes
  22. .gitignore
  23. .prettierrc.toml
  24. .rustfmt.toml
  25. ARCHITECTURE.md
  26. AUTHORS
  27. BUILD.bazel
  28. CODEOWNERS
  29. COMPATIBILITY.md
  30. CONTRIBUTING.md
  31. CONTRIBUTORS
  32. LICENSE.txt
  33. MODULE.bazel
  34. README.md
  35. version.bzl
  36. WORKSPACE.bazel
  37. WORKSPACE.bzlmod
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.