feat: crates_universe
Intra workspace Dependency Resolution
#3308
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently
rules_rust
requires that intra-workspace dependencies are manually specified in thedeps
sections ofrust_library
andrust_binary
targets. Third party dependencies can be automatically detected usingcrates_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 bazelBUILD
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 useall_crate_deps
in your build files to add both third-party and first party dependencies.Known Limitations
Notes
all_crate_deps
, but that relies on thealiases
having 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.