Open alexkirsz opened 2 months ago
A big part of that time is lost in execute_cargo_tree, where for each target triple (of which there are 34 by default) triggers a cargo tree
call, and all or part of these calls are queued up because they require exclusive access to the package cache.
The simplest solution for us at this point is to specify supported_platform_triples
to the ones we're actually interested in building on. This reduces the time it takes to re-run on an unchanged project from 29s down to 12s.
Considering a single cargo tree calls takes 1s to complete, it would be great to find a way to run all these computations in parallel.
However, even with a single platform specified, it still takes a total of 9 seconds, so there's more to be optimized elsewhere as well.
Hey folks,
We have a large monorepo comprising of 357 crates. We recently switched to
bzlmod
to avoid very frequent issues withCargo.bazel.lock
merge conflicts, and in that regard the transition went great.However, we're now seeing the
Fetching module extension crate in @@rules_rust~//crate_universe:extension.bzl; starting
step taking from a minimum of 20s to upwards of two minutes. This runs on anybazel build
orbazel mod deps --lockfile_mode=update
provided one or moreCargo.toml
declared in themanifests
key of.from_cargo
istouch
ed, which occurs very frequently.Is there a way we could speed up this step in our configuration?
This is our
MODULE.bazel
file: