ccinfo: when providing ccinfo, optionally include libstd and alloc (#624)

* ccinfo: when providing ccinfo, optionally include libstd and alloc

The new attribute on RustToolchain is the label of a target that
provides __rust_realloc et al, which allows ld(1) to use the .rlib
files directly without needing to involve rustc in the linking
step. This means Rust and C++ can be mixed in a cc_binary freely
without needing any staticlib-type crates, which avoids problems if
you have a cc_binary -> rust_library -> cc_library -> rust_library
situation.

* Add verification that all files were properly partitioned

* Disable print

* stdlib_ordering: new tests to ensure check stdlib rlib ordering

* native_deps: give up on testing cc_binary using rust_library

This only works on clang today, and can only work on clang for the
near-term. It's not clear how to write a clang-only test in this case,
so we just give up for now.

"I promise it works!" etc

Co-authored-by: Augie Fackler <augie@google.com>
Co-authored-by: Marcel Hlopko <hlopko@google.com>
6 files changed
tree: b96f656208f26a467855a6081f441a70802bb10c
  1. .bazelci/
  2. bindgen/
  3. cargo/
  4. docs/
  5. examples/
  6. proto/
  7. rust/
  8. test/
  9. tools/
  10. util/
  11. wasm_bindgen/
  12. .bazelignore
  13. .gitignore
  14. ARCHITECTURE.md
  15. AUTHORS
  16. BUILD
  17. CODEOWNERS
  18. CONTRIBUTING.md
  19. CONTRIBUTORS
  20. LICENSE.txt
  21. README.md
  22. WORKSPACE
  23. workspace.bzl
README.md

Rust Rules

  • Postsubmit Build status
  • Postsubmit + Current Bazel Incompatible Flags Build status

Overview

This repository provides rules for building Rust projects with Bazel.

Community

Please refer to the full documentation.