tree: 03e857e8078fd7761365060306552b922931a1d1
  1. crates_no_std/
  2. crates_std/
  3. rust_crates/
  4. src/
  5. .gitignore
  6. BUILD.bazel
  7. Cargo.toml
  8. config.toml
  9. README.md
third_party/crates_io/README.md

Third Party Rust Crates

TODO: https://pwbug.dev/392963279 - Integrate these docs with the rest of Pigweed's docs

This directory is where third party crate dependencies are managed. There are two sets of crates: ./crates_no_std and ./crates_std. These are cargo based “null” Rust libraries that exist solely to express which crates to expose to Bazel. ./rust_crates is a Bazel repository that exposes these crates to Bazel.

Adding a third party crate

  1. Add the crate to either or both of ./crates_no_std and ./crates_std by running cargo add <crate_name> --features <additional_features> in the appropriate directory.
  2. Update ./rust_crates/aliases.bzl by running cargo run -- --config config.toml > rust_crates/aliases.bzl in this directory.