Skip to content

Commit

Permalink
[bazel] speed up rules_rust fetch by limit supported target triples
Browse files Browse the repository at this point in the history
Signed-off-by: Gary Guo <[email protected]>
  • Loading branch information
nbdd0121 committed Jan 16, 2025
1 parent a654d29 commit d515da6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions third_party/rust/rust.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ crate.from_cargo(
name = "crate_index",
cargo_lockfile = "//third_party/rust:Cargo.lock",
manifests = ["//third_party/rust:Cargo.toml"],
# By default rules_rust will analyze dependencies for all supported target triples, which is very slow.
# Restrict to ones that we're interested in. See https://github.com/bazelbuild/rules_rust/issues/2876
supported_platform_triples = [
"x86_64-unknown-linux-gnu",
],
)
crate.annotation(
crate = "libudev-sys",
Expand Down Expand Up @@ -124,6 +129,9 @@ crate.from_cargo(
name = "mdbook_index",
cargo_lockfile = "//third_party/mdbook:Cargo.lock",
manifests = ["//third_party/mdbook:Cargo.toml"],
supported_platform_triples = [
"x86_64-unknown-linux-gnu",
],
)
crate.annotation(
crate = "mdbook",
Expand Down
6 changes: 6 additions & 0 deletions third_party/tock/tock.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ crate.from_cargo(
name = "tock_index",
cargo_lockfile = "//third_party/tock:Cargo.lock",
manifests = ["//third_party/tock:Cargo.toml"],
supported_platform_triples = [
"riscv32imc-unknown-none-elf",
],
)
use_repo(crate, "tock_index")

Expand All @@ -17,6 +20,9 @@ crate.from_cargo(
name = "elf2tab_index",
cargo_lockfile = "@elf2tab//:Cargo.lock",
manifests = ["@elf2tab//:Cargo.toml"],
supported_platform_triples = [
"x86_64-unknown-linux-gnu",
],
)
use_repo(crate, "elf2tab_index")

Expand Down

0 comments on commit d515da6

Please sign in to comment.