Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency graph resolution: Equivalent excludes can cause un-necessary graph mutations #23521

Closed
ljacomet opened this issue Jan 13, 2023 · 0 comments
Assignees
Labels
Milestone

Comments

@ljacomet
Copy link
Member

Following the fix for #17964, another subtle bug has been introduced when graphs have large excludes and a heavy use of dependency substitutions.

In some cases, changes in the ExcludeSpec will incorrectly be interpreted as impacting the graph, while the dependency nodes remain strictly the same.

The root cause is that the DependencyState type is expected to be deduplicated and its equals is limited to object identity.

However in NodeState.maybeSubstitute, the substituted DependencyState is not cached. A cache needs to be added there, building on the cache for SubstitutionResult, so that for a source DependencyState, a given result, the same modified DependencyState is returned.

@jbartok jbartok added in:dependency-resolution engine metadata and removed to-triage labels Jan 18, 2023
@jbartok jbartok added this to the 8.1 RC1 milestone Jan 18, 2023
ljacomet added a commit that referenced this issue Jan 27, 2023
Failing to do that was breaking the contract of DependencyState
deduplication.

Issue #23521
@ljacomet ljacomet assigned ljacomet and eskatos and unassigned eskatos Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants