File: README.md

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (58 lines) | stat: -rw-r--r-- 2,140 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Rust third-party code

This directory contains all third-party Rust code, and sometimes thin wrappers
around it for C++ intertop.

## Crates.io

Crates that come from [crates.io](https://crates.io) are found in
`//third_party/rust/chromium_crates_io`, and are all vendored into the
Chromium git repository. They are managed through Cargo rules and with
the `gnrt` tool. See [`//docs/rust.md`](../../docs/rust.md) for how to
bring in new third-party libraries or update them.

The GN rules and README.chromium files for these crates are written by
the `gnrt` tool and should not be edited by hand.

### Directory structure

We store GN rules for each third-party crate in a directory of the same name.
Under that directory a folder named based on the crate epoch version is
created. This limits first-party usage of a crate to only one version within
each epoch.
If the crate's version has a major version greater-than 0, then that is used
as its version folder, such as `v1`. Otherwise, the name includes all
leading zeros in the version, such as `v0_3`.

For example, GN rules for the `tutelage` crate at version **1.4.3** would be
stored at
```sh
//third_party/rust/tutelage/v1
```

Whereas GN rules for the verion **0.2.8** version would be stored at
```sh
//third_party/rust/tutelage/v0_2
```

## Other sources

Third-party Rust libraries that are not distributed through [crates.io](
https://crates.io) are uncommon. But they may live under
`//third_party/rust/crate_name` or `//third_party/project_name` directly,
as a git submodule, with GN rules written for them by hand
(such GN rules would most likely use either the `cargo_crate("foo")` or the
`rust_static_library("foo")` template from Chromium's `//build/rust/*.gni`).

## OWNERS

We do not require OWNERS in each crate's directory at this time, but this
will be revisited in the future.

## Review process

Rust libraries must go through the [3rd-party review process](
../../docs/adding_to_third_party.md).
See the [review of the `toml` crate](
https://groups.google.com/u/1/a/chromium.org/g/security/c/K686pSg-gZc/m/Pn2QzqahAwAJ)
for an example of a Rust security review.