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

[1.x] Refine early return condition in invalidateAfterInternalCompilation #1397

Merged
merged 4 commits into from
Sep 28, 2024

Conversation

Friendseeker
Copy link
Member

@Friendseeker Friendseeker commented Sep 17, 2024

Issue

In #1396, the project takes 4 cycles to compile when transitive step is set to 3, yet the project only takes 3 cycles when transitive step is above 3.

This indicates transitive invalidation interferes with cycle stopping condition. Even though everything is complied by cycle 3, when invalidateTransitively flag is set, we enter cycle 4 regardless.

Solution

In invalidateAfterInternalCompilation, we should use a non-transitive version of firstClassInvalidation to compute newInvalidations, while using a transitive version of firstClassInvalidation to compute all invalidations when invalidateTransitively flag is set.

Testing

A scripted test is added. Without the PR it takes 5 iterations. With the PR it takes 4 iterations.

@Friendseeker Friendseeker changed the title Refine early return condition in invalidateAfterInternalCompilation [1.10.x] Refine early return condition in invalidateAfterInternalCompilation Sep 19, 2024
@Friendseeker Friendseeker marked this pull request as ready for review September 23, 2024 03:58
Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Friendseeker Friendseeker changed the title [1.10.x] Refine early return condition in invalidateAfterInternalCompilation [1.x] Refine early return condition in invalidateAfterInternalCompilation Sep 24, 2024
@eed3si9n eed3si9n merged commit 59505ce into sbt:1.10.x Sep 28, 2024
8 checks passed
@Friendseeker Friendseeker deleted the transitive-invalidation-fast-pass-2 branch September 28, 2024 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants