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
Fix issue with file hash cache during runtime classpath normalization #16145
Conversation
a67f468
to
4d16964
Compare
4d16964
to
5e66924
Compare
5e66924
to
8c6c440
Compare
8c6c440
to
a4b8590
Compare
@@ -80,6 +85,7 @@ class ConfigureRuntimeClasspathNormalizationIntegrationTest extends AbstractInte | |||
'nested in dir jars' | 'ignoredResourceInNestedInDirJar' | 'notIgnoredResourceInNestedInDirJar' | Api.ANNOTATION | |||
} | |||
|
|||
@ToBeFixedForConfigurationCache(because = "classpath normalization") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This always should have been failing with config cache because we use classpath normalization in the test. But there was an issue with how we were formatting the manifest which was causing it to pass incorrectly in that case. Fixing the manifest caused the test to fail (as it should) so we need the annotation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we point those tests to #13706, so it is clear there is an issue on the configuration cache side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep - done.
...groovy/org/gradle/normalization/ConfigureRuntimeClasspathNormalizationIntegrationTest.groovy
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the change looks good. Does the new test fail without the fix of the production code? Can we do something to make sure we don't run into the same problem again?
@@ -80,6 +85,7 @@ class ConfigureRuntimeClasspathNormalizationIntegrationTest extends AbstractInte | |||
'nested in dir jars' | 'ignoredResourceInNestedInDirJar' | 'notIgnoredResourceInNestedInDirJar' | Api.ANNOTATION | |||
} | |||
|
|||
@ToBeFixedForConfigurationCache(because = "classpath normalization") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we point those tests to #13706, so it is clear there is an issue on the configuration cache side?
@@ -235,8 +241,8 @@ class ConfigureRuntimeClasspathNormalizationIntegrationTest extends AbstractInte | |||
change | config | api | |||
'ignore file' | "ignore '**/some-other-file.txt'" | Api.RUNTIME | |||
'ignore file' | "ignore '**/some-other-file.txt'" | Api.ANNOTATION | |||
'ignore manifest attribute' | "metaInf { ignoreAttribute 'Implementation-version' }" | Api.RUNTIME | |||
'ignore manifest attribute' | "metaInf { ignoreAttribute 'Implementation-version' }" | Api.ANNOTATION | |||
'ignore manifest attribute' | "metaInf { ignoreAttribute '${IMPLEMENTATION_VERSION}' }" | Api.RUNTIME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the |
now not aligned any more?
...groovy/org/gradle/normalization/ConfigureRuntimeClasspathNormalizationIntegrationTest.groovy
Show resolved
Hide resolved
@wolfs Yes, this test fails without the fix. It should, at the least, guard against regressions for the normalization settings we test against. I'm not 100% convinced it's the best way to test for this problem, but I couldn't figure out a better way to test for it. |
@bot-gradle test RfM please |
OK, I've already triggered ReadyForMerge build for you. |
Normalization rules were not being properly captured when calculating the cache key for file hashes during runtime classpath normalization. This was causing incorrect build cache misses under the right sequence of events. Fixes #16144
197df78
to
1ae5eca
Compare
@bot-gradle test RfM please |
OK, I've already triggered ReadyForMerge build for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
We encountered this issue, thanks a lot for fixing. Can't wait to test it |
Fix issue with file hash cache during runtime classpath normalization
@Sinapse87 Please try out |
Normalization rules were not being properly captured when calculating the cache key for file hashes during runtime classpath normalization. This was causing incorrect build cache misses under the right sequence of events.
Fixes #16144