resolve build dependencies independently [WIP] #7761
Closed
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.
motivation
the unification of build dependencies with runtime dependencies creates a lot of counterintuitive behavior (#5237 and #4866 are two areas where this has been a long-standing issue). the most straightforward approach to fixing this, as far as i can tell, is to not unify build dependencies with runtime dependencies.
approach
unfortunately, everything about cargo is built around a monolithic dependency resolution DAG.
there are a lot of ways that this could be implemented, but what i've (tentatively) chosen is to add a field
build_graphs: HashMap<PackageId, Resolve>
to the existingResolve
, and when a package with at least one build dependency is encountered, the resolution process recurses to generate the build dependency DAG for that package. this approach seems good to me - it preserves existing code's assumption that all dependency resolution information is in theResolve
, and it allows for reuse of most of the existing dependency resolution code - but i'm certainly open to suggestions if there's a better approach.status
right now, the resolver tests are broken and i don't understand enough about proptest to fix them, and a few dozen integration tests are failing for reasons that i don't quite understand. my intuition is that there's some gap in the translation from the cargo-internal
Resolve
to the rustc-attachedUnitGraph
, but i need to do more poking around to be confident of that.pending actions i could use some help with: