OSRB approval is required for third-party crates. To get approval, you will need to follow the instructions under the “Process for 3rd Party Hosted Code” section in this document.
Third-party crates depended on by rustc_binary
and rustc_library
targets are stored in //third-party/rust_crates/vendor
. This set of crates is based on the dependencies listed in //third_party/rust_crates/Cargo.toml
, and is updated by running fx update-rustc-third-party
, which will update the precise versions of the crates used in the Cargo.lock
file and download any necessary crates into the vendor
dir.
If a crate is not available in the vendor directory, it can to be added with the following steps:
third_party/rust_crates/Cargo.toml
.scripts/fx update-rustc-third-party
. This will download all crates listed in rust_crates/Cargo.toml
as well as their dependencies and place them in the vendor
directory.git add
the Cargo.toml
, Cargo.lock
and vendor
directory.If the project requires importing a new third-party crate to handle functionality related to Unicode and internationalization, prefer crates from the UNIC project when available.
The following non-UNIC crates are already vendored and are grandfathered, but we will aim to migrate to UNIC equivalents when possible.
We should encourage upstream dependencies to migrate to UNIC as well.
UNIC crates have distinct advantages over other crates:
UNIC crates are developed in a single repo, with shared common code and a single version scheme.
UNIC crates are generated from a consistent set of Unicode data files.
The UNIC project is aiming for comprehensive feature coverage, to be like ICU for Rust. If the project succeeds, our dependencies on unrelated Unicode crates should be reduced over time.