feat: `crates_universe` Intra workspace Dependency Resolution
Currently rules_rust requires that intra-workspace dependencies are manually specified in the deps sections of rust_library and rust_binary targets. Third party dependencies can be automatically detected using crates_universe.
I have a large cargo workspace with ~4500 intra-workspace dependencies that I plan to continue supporting compiling with cargo. Therefore I don't want to have to keep all of the intra-workspace dependencies up to date in both the Cargo.toml and bazel BUILD files.
This PR adds a disabled by default option to allow all_crate_deps to also include intra-workspace dependencies in the rendering config. Once enabled you can use all_crate_deps in your build files to add both third-party and first party dependencies.
Known Limitations
- If you have first and third-party crates with the same name and version, your workspace will fail to render.
Notes
- I originally attempted to do this by making it an option in
all_crate_deps, but that relies on thealiaseshaving been generated during the rendering, and therefore prevents the feature from being entirely disabled. One of my goals was that the feature can be fully disabled, such that the checksums do not change.
This is awesome! What ive been looking for!