Skip to content

Commit

Permalink
A few minor tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
adetaylor committed Nov 20, 2023
1 parent 9264916 commit 25775be
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/chromium/adding-third-party-crates/checking-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Please also add an `OWNERS` file there.
You should land all this, along with your `Cargo.toml` and `gnrt_config.toml` changes, into
the Chromium repo.

**Important**: you need to use `git add -f` because otherwise `.gitignore` files
may result in some files being skipped.

As you do so, you might find presubmit checks fail because of non-inclusive
language. This is because Rust crate data tends to include names of git branches,
and many projects still use non-inclusive terminology there. So you may need
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ you wish to enable in the crate.

You should specify the [semver version][2] of the crate that you want (look it
up on [crates.io][3]!). For example, if the most recent published version of the
crate `foo` is `1.2.3``, you'd specify
crate `foo` is `1.2.3`, you'd specify

```
foo = "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Alongside `Cargo.toml` is [`gnrt_config.toml`][0]. This contains Chromium-specific
extensions to crate handling.

If you add a new crate, you'll definitely need to specify at least the `group`.
If you add a new crate, you should specify at least the `group`.
This is one of:

```toml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generating gn build rules
# Generating `gn` build rules

A tool called `gnrt` knows how to generate Chromium build rules for the
crate you just added.
Expand All @@ -18,11 +18,12 @@ vpython3 tools/crates/run_gnrt.py -- vendor
This `vendor` command may download:
* Your crate
* Direct and transitive dependencies
* Updates or new versions of other crates
* New versions of other crates, as required by `cargo` to resolve
the complete set of crates required by Chromium.

If a crate in `//third_party/rust/chromium_crates_io/patches` was updated as
part of vendoring, then reapply patches to it by running
`cd //third_party/rust/chromium_crates_io; ./apply_patches.sh`.
`cd third_party/rust/chromium_crates_io; ./apply_patches.sh`.

Once you've downloaded the crate, generate the `BUILD.gn` files like this:

Expand Down
5 changes: 3 additions & 2 deletions src/chromium/adding-third-party-crates/resolving-problems.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ by upgrading some other crate.
If your build fails, it may be because of a `build.rs`: programs which do arbitrary
things at build time. This is fundamentally at odds with the design of `gn`
and `ninja` which aim for static, deterministic, build rules to maximize
parallelism and repeatability of builds. If your crate or its dependencies
have a `build.rs` you may need to take steps:
parallelism and repeatability of builds.

Some `build.rs` actions are automatically supported; others require action:

| build script effect | Supported by our gn templates | Work required by you |
|-----|-----|-----|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ Now rerun [`gnrt.py -- gen`][2] to regenerate `BUILD.gn` files to inform ninja
that this particular output file is input to subsequent build steps.


[1]: configuring-gnrt-config-toml.md
[1]: ../configuring-gnrt-config-toml.md
[2]: ../generating-gn-build-rules.md

0 comments on commit 25775be

Please sign in to comment.