gitignore: Initial add

Change-Id: I9a72bfee0ea9a86968edbccca26bebe086c594b9
Reviewed-on: https://pigweed-review.googlesource.com/c/third_party/rust_crates/+/138451
Reviewed-by: Erik Gilling <konkers@google.com>
1 file changed
tree: 076298954d0f959ec3d1bfe6c8563d7d9356a6e4
  1. crates/
  2. crates_std/
  3. create_aliases/
  4. stub_crates/
  5. .gitignore
  6. aliases-config.toml
  7. aliases.bzl
  8. BUILD.bazel
  9. README.md
  10. 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.

std and no_std

This repository provides two separate sets of crates. One for std environments and one for no_std environments. The set that is used is determined by the //:std_enabled constraint setting and defaults to std. To use no_std add @rust_crates//:no_std to your platform definition.

Adding and Updating the Crates

The list of vendored crates is defined by the dependencies listed in //stub_crates/crates/Cargo.toml and //stub_crates/crates_std/Cargo.toml. The contents of the //crates and //crates_std directories are generated by the //:crates_vendor and //:crates_vendor_std targets. The aliases in the //: namespace are generated by the create_aliases tool. To update the vendored crates, build files, and aliases to match run:

bazel run //:crates_vendor -- --repin
bazel run //:crates_vendor_std -- --repin
(cd create_aliases ; \
  cargo run -- --config ../aliases-config.toml ../stub_crates/*/Cargo.toml) \
  > aliases.bzl

Licenses can be checked with cargo license -d in the appropriate stub_crate.

Markdown Formatting

We keep this, and all Markdown files in this repository, in a consistent Markdown format using mdformat. To install and format, use the following commands:

pip install mdformat-gfm
mdformat README.md

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, on Debian based systems:

sudo apt install lld