Hi, I have a question about migrating a large Cargo project to Bazel.
We have a huge Cargo workspace with 100+ first-party crates and many third-party dependencies.
We're trying to add Bazel support to this project using crate_universe:
crates = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
crates.from_cargo(
name = "crates",
cargo_lockfile = "//:Cargo.lock",
manifests = ["//:Cargo.toml"],
)
use_repo(crates, "crates")
I've noticed that crate_universe can parse dependencies, download third-party crates, and generate BUILD files for them.
However, it doesn't seem to handle first-party crates in the same way.
For our 100+ first-party crates, what's the recommended approach? I'm considering three options:
- Modify crate_universe logic: Extend it to also generate local repositories and BUILD files for first-party crates
- Manually maintain BUILD.bazel files: Keep BUILD.bazel files alongside each first-party crate's Cargo.toml
- Use Gazelle: Automatically generate BUILD files and commit them to the repository
Which approach would you recommend for this use case?
Are there any best practices or examples for handling large monorepos with many first-party crates?
Thanks!
Hi, I have a question about migrating a large Cargo project to Bazel.
We have a huge Cargo workspace with 100+ first-party crates and many third-party dependencies.
We're trying to add Bazel support to this project using crate_universe:
I've noticed that crate_universe can parse dependencies, download third-party crates, and generate BUILD files for them.
However, it doesn't seem to handle first-party crates in the same way.
For our 100+ first-party crates, what's the recommended approach? I'm considering three options:
Which approach would you recommend for this use case?
Are there any best practices or examples for handling large monorepos with many first-party crates?
Thanks!