Generating gn
Build Rules
Once youâve downloaded the crate, generate the BUILD.gn
files like this:
vpython3 tools/crates/run_gnrt.py -- gen
Now run git status
. You should find:
- At least one new crate source code in
third_party/rust/chromium_crates_io/vendor
- At least one new
BUILD.gn
inthird_party/rust/<crate name>/v<major semver version>
- An appropriate
README.chromium
The âmajor semver versionâ is a Rust âsemverâ version number.
Take a close look, especially at the things generated in third_party/rust
.
Talk a little about semver â and specifically the way that in Chromium itâs to allow multiple incompatible versions of a crate, which is discouraged but sometimes necessary in the Cargo ecosystem.