This CL ensures that:
* Changes to `imports.lock` are ignored via `.gitignore` (and that when
this file doesn't exist, then `cargo vet` still works because now we
will create an empty file in this case).
* Changes to `config.toml` are reverted (when the only difference is in
the comments) or warned about (for non-trivial changes)
This CL also opportunistically updates `docs/rust.md` instructions about
how to install `cargo-vet`:
* It adds a TODO to avoid the need to manually install `cargo-vet`
* It specifies an explicit version (0.9.1 seems to work well)
* It uses `--locked` to ensure `cargo-vet`'s dependencies cannot
be tampered with (i.e. that we only need to trust the publishers
of `cargo-vet` + `crates.io` + `rust-toolchain`)
Bug: 41494083
Change-Id: I7056537ecfb34197f5102df93dddbe152838a073
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5368308
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1271735}
This script sets up a PATH to the toolchain in
//third_party/rust-toolchain/bin for both cargo and rustc, and then
invokes `cargo` with the arguments given to it.
The run_gnrt.py script can now use this one to invoke cargo, and gnrt
no longer needs arguments for how to find rustc and cargo, since they
can be found through the path.
Bug: 1314345
Change-Id: Idda514d4c6933b9a6fe2e1783064fc5e8dfd9fd2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5174250
Reviewed-by: Collin Baker <collinbaker@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1246633}
* Fix up the contents of audits.toml to be valid
* Add the imports.lock file which must be present
* Make the config.toml for vet become generated by `gnrt vendor`.
* Forward criteria from the google audit repo into ours so we can
use them.
By generating the config.toml we can specify what policy we want
applied to each crate based on its group and shipped flags in the
gnrt_config.toml.
`cargo vet` does not yet pass, since we are missing audits for almost
all of our 3p crates at their given versions. Since we have reviewed
them, audits should be added next.
Bug: 1314345
Change-Id: I1b6ebdd26220f6d4cbadcf70bbc631d97db31091
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5170447
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243478}
apply_patches.sh no longer exists since this is now handled by
gnrt vendor. All of the necessary docs are already present so this
just removes the out of date part.
Change-Id: Id42e7afe7e043705a99bb3a9b89dab57a5d36add
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5116813
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Nabil Wadih <nwadih@google.com>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1237732}
For any new download, apply any patches in the patches/ directory for
that crate.
Also rebase the cxx patches which are not fixed when the vendor/
directory was introduced.
Bug: 1502569
Change-Id: Iff58026976678170adcc348cb0ba93230c6aaa3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5049667
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Adrian Taylor <adetaylor@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1228469}
- Move the cargo/rustc path options out of the actions so that
run_gnrt.py can always pass them and use the tools from the
Chromium toolchain.
- Add a workaround to run_gnrt.py for Mac ARM since we don't ship cargo
in the Chromium toolchain there yet.
- Plumb these tools around separately.
- Use `git add -f` to include some missed files in `vendor/`
- Add this to the instructions.
- Revamp instructions to use `gnrt add` and `gnrt update`.
- Talk about the gnrt_config.toml and groups in the instructions.
- A bit of cleanup refactoring.
Bug: 1502569, 1503710, 1503697
Change-Id: I0bf50b54e05b45babd1cef4c3e768a9db7a0c61d
Cq-Include-Trybots: luci.chromium.try:android-rust-arm32-rel,android-rust-arm64-dbg,android-rust-arm64-rel,linux-rust-x64-dbg,linux-rust-x64-rel,mac-rust-x64-dbg,win-rust-x64-dbg,win-rust-x64-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5041754
Reviewed-by: Adrian Taylor <adetaylor@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1227381}
This moves us from downloading with gnrt to doing versioning with
Cargo. gnrt uses Cargo's version decisions and then downloads all
crates that Cargo wants to depend on.
gnrt vendor updates README.chromium files with the updated versions,
licenses, and revision data.
This updates a bunch of crates that were out of date in ways that
Cargo did not like.
Bug: 1494118, 1475603, 1502569
Change-Id: Ie1c660c1c4459905b6bbd727a88cfa97ce8c8556
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5029701
Reviewed-by: Adrian Taylor <adetaylor@google.com>
Owners-Override: danakj <danakj@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1226139}
Move docs for working with 3p crates up to docs/rust.md. Document
that Rust is production ready and not experimental, and link to
what is approved by ATLs.
Bug: 1292073
Change-Id: Ic1d77d8f366bc7e6c1ff8b6f356097e0ec3309ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4929121
Reviewed-by: Adrian Taylor <adetaylor@google.com>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1209386}