Skip to content

Commit

Permalink
Revert #1284 Include mutual dependency in initial invalidation (#1462)
Browse files Browse the repository at this point in the history
Ref #1284
Fixes #1461
Fixes #1420
Also fixes com-lihaoyi/mill#3748 downstream

Not sure if there's a better way to fix this? Just opening this to spark discussion

The original bugs are fine, but the solution seems incorrect, and is both overly conservative (invalidating everything based on whitespace?) and not conservative enough (doesn't handle cycles with length > 2?).
  • Loading branch information
lihaoyi authored Oct 17, 2024
1 parent f358b72 commit a290041
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -534,14 +534,7 @@ private[inc] abstract class IncrementalCommon(
val removedClasses = classNames(removedSrcs)
val dependentOnRemovedClasses = removedClasses.flatMap(previous.memberRef.internal.reverse)
val modifiedClasses = classNames(modifiedSrcs)
val mutualDependentOnModifiedClasses = {
val dependentOnModifiedClasses = modifiedClasses.flatMap(previous.memberRef.internal.reverse)
dependentOnModifiedClasses.filter(dependent =>
previous.memberRef.internal.reverse(dependent).exists(modifiedClasses)
)
}
val invalidatedClasses =
removedClasses ++ dependentOnRemovedClasses ++ modifiedClasses ++ mutualDependentOnModifiedClasses
val invalidatedClasses = removedClasses ++ dependentOnRemovedClasses ++ modifiedClasses

val byProduct = changes.removedProducts.flatMap(previous.produced)
val byLibraryDep = changes.libraryDeps.flatMap(previous.usesLibrary)
Expand Down

0 comments on commit a290041

Please sign in to comment.