//third_party/rust
//third_party/rust/OWNERS
review crates in this directory (e.g. when importing a new crate, or when updating an existing crate to a new version).
This document provides a checklist that
These are very high level guidelines that explicitly avoid trying to codify what exactly to look for and how to do the reviews, because ultimately we trust the reviewer’s judgement here.
ATL+Director approval: Is it an import of a new crate? If so, then check if 1) ATL approval has been obtained and 2) a Chrome Director has been CC-ed on a post to the rust-fyi@ group (step 3 from go/chrome-rust [Google-internal]), and 3) OWNERS
file for the new crate is present (unless it is a foundational, shared-ownership crate).
//third_party/rust/OWNERS
doesn’t accidentally bypass the requirement for a generic third-party review by //third_party/OWNERS
.unsafe
code: Does the crate use unsafe
Rust? If so, then check that the unsafe
code is small, encapsulated, and documented as explained in the rule-of-2.md
doc.
//third_party/rust/OWNERS
looks at each unsafe
block of code.unsafe
.unsafe
block explains reviewer's thinking why the safety requirements are met.unsafe
blockProc macros and build.rs
: Does the crate execute any code at build time? If so, then check if the build is still deterministic and hermetic.
cc
wouldn’t work with Chromium’s build system at all.Other concerns: Do you have any (generic or specific) concerns or doubts about some aspects of the crate? If so, please don’t hesitate to escalate and discuss with others, and then LGTM (or not) based on the discussion.
unsafe
questions: Unsafe Rust Crabal chatroom [Google-internal]The review can be quite minimal or lightweight if Chromium already has a trust relationship with the crate authors. For example, we already trust:
libc
, hashbrown
, and similar crates authored by https://github.com/rust-langwindows-sys
, windows_aarch64_msvc
and similar crates that are authored by Microsoft and expose OS APIs to RustIf needed the review can be scoped down by using ban_features
in gnrt_config.toml
to ensure that a given crate feature is disabled.
There is no need to review tests, benchmarks, nor examples.
To quickly check if a crate uses unsafe
Rust, one can look at the value of allow_unsafe
in the crate's BUILD.gn
file (see an example here.
Tools that may be helpful during a review:
tools/crates/grep_for_vet_relevant_keywords.sh
git mv old_dir new_dir
) as the baseline. (This should become easier once we fix https://crbug.com/396397336.)gnrt
already checks for known/approved licenses when generating README.chromium
. If an import requires updating gnrt/lib/readme.rs
to account for new license kinds, then //tools/crates/gnrt/lib/readme.rs-third-party-license-review.md
can say how to review the changes.