Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bazel: Update rules_rust, switching external crate management mode
The primary change here is updating rules_rust. In the process, we also switch from using crates_universe to the new crates_repository functionality. This is a newer, more structured approach to managing external crates. The most visible differences are: - We now specify crates using `{"crate_name": crate.spec(version = "=1.2.3")}`, rather than `[crate.spec(name = "crate_name", version = "=1.2.3")]` when we specify the crates we use in rust.bzl. - We now specify crates using `"@crates//:crate_name"`, rather than `crate("crate_name")` when we specify dependencies in BUILD files. - There is now support for disabling default features, rather than having to do that manually. - There is now a lockfile for external crates, including their cryptographic checksum. For now this has to be updated by using the `CARGO_BAZEL_REPIN=true` environment variable, but in due course we may fix that in update-deps. In the process, we've also updated a few crates. The only one with breaking changes was updating chacha20 to 0.9.0. This also moves most of the crates that previously were fetched using http_archive (allowing us to customise the BUILD file), rather than using crates_universe, to now being fetched as normal with the other crates in crates_repository. This simplifies the dependency management somewhat. The only two crates still being fetched using http_archive are compiler-builtins (since we don't build it using rules_rust) and bootloader (since we both customise the BUILD file considerably and also patch some files). A big thank-you is due to @UebelAndre for their patience in helping me diagnose an issue I had while upgrading. This was due to me having the `default` feature enabled in smoltcp and wondering why disabling default features wasn't working. See bazelbuild/rules_rust#1168 for the details. Signed-off-by: SlyMarbo <the.sly.marbo@googlemail.com>
- Loading branch information