Initial import of third party crates and build infra

Change-Id: I9e6f33d3c1dd9239f284aa0442f32dabd9c271aa
Reviewed-on: https://pigweed-review.googlesource.com/c/third_party/rust_crates/+/127139
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
473 files changed
tree: 841f91066cbceca391b16c22c13f72cfd9e497f8
  1. crates/
  2. src/
  3. BUILD.bazel
  4. Cargo.Bazel.lock
  5. Cargo.toml
  6. README.md
  7. WORKSPACE
README.md

Pigweed Rust Third Party Crates

This is a repository to vendor and provide build rules for the third party crates that Pigweed's rust code depends on. Currently only Bazel build rules are provided.

Adding and Updating the Crates

The list of vendored crates is defined by the dependencies listed in //Cargo.toml. The contents of the //crates directory is generated by //:crates_vendor. To update the vendored crates and build files to match run:

bazel run //:crates_vendor -- --repin

Licenses can be checked with cargo license -d.

FAQ

collect2: fatal error: cannot find ‘ld’ error

  = note: collect2: fatal error: cannot find 'ld'
          compilation terminated.

If you get the above error when running bazel run //:crates_vendor -- --repin, ensure lld is installed on your system. For instance:

sudo apt install lld