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
Add internal properties to disable caching of non-task outputs #28827
base: master
Are you sure you want to change the base?
Conversation
068c76d
to
efd3260
Compare
@bot-gradle test this |
I've triggered the following builds for you. Click here to see all build failures. |
efd3260
to
3abbd21
Compare
@asodja Do you think we need integration tests for these experimental properties? My preference is to keep it minimal. |
@@ -291,6 +294,10 @@ public void markLegacySnapshottingInputsFinished(CachingState cachingState) { | |||
|
|||
@Override | |||
public Optional<CachingDisabledReason> shouldDisableCaching(@Nullable OverlappingOutputs detectedOverlappingOutputs) { | |||
if (System.getProperty(CACHING_DISABLED_PROPERTY) != null) { |
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.
❓ Should we also check if value is true or false?
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 had that at first, but instead I decided to make it a no-value property.
Usage is ./gradlew -Dorg.gradle.experimental.transform-caching-disabled task
.
@@ -61,6 +67,15 @@ public BuildScriptCompilationAndInstrumentation( | |||
this.transformFactory = transformFactory; | |||
} | |||
|
|||
@Override | |||
public Optional<CachingDisabledReason> shouldDisableCaching(@Nullable OverlappingOutputs detectedOverlappingOutputs) { | |||
if (System.getProperty(CACHING_DISABLED_PROPERTY) != null) { |
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.
❓ Also here, should we also check if value is true or false?
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.
The plan is to support usage like gradle -Dorg.gradle.experimental.script-caching-disabled foo
(without requiring a value).
For transforms, I've updated this to allow a comma-separated list of transforms to disbaled, with empty string meaning disable all transforms. I suggest we keep this logic for scripts.
Since this is an experimental property, I'm not overly concerned with usability.
I think it's fine. I guess we have coverage that build cache works without a flag, at least for artifact transform? FYI: I will leave @lptr to review and approve this PR, since he said he will also look in to the spec. |
979df49
to
5c763b4
Compare
Adds properties that can be used to experimentally disable caching of: - Kotlin and Groovy script compilation: `-Dorg.gradle.experimental.script-caching-disabled` - Artifact Transform execution: `-Dorg.gradle.experimental.transform-caching-disabled` These properties exist solely for the purpose of investigating the impact of build-cache on non-task outputs. They are not intended to be supported long term and will be removed (or replaced) in a future Gradle version without deprecation.
It will be useful to assess the build-cache impact on specific artifact transforms. Such measurements may be useful to inform developers of 3rd party plugins as to whether caching is useful for their transform implementations. Signed-off-by: daz <daz@gradle.com>
5c763b4
to
68477b3
Compare
@bot-gradle test rfm |
I've triggered the following builds for you. Click here to see all build failures. |
c81475e
to
4c1bbd7
Compare
Adds properties that can be used to experimentally disable caching of:
-Dorg.gradle.experimental.script-caching-disabled
-Dorg.gradle.internal.transform-caching-disabled
It is also possible to disable caching for select artifact transforms:
-Dorg.gradle.internal.transform-caching-disabled=org.example.Transform1,org.example.Transform2
These properties exist solely for the purpose of investigating the impact of build-cache on non-task outputs. They are not intended to be supported long term and will be removed (or replaced) in a future Gradle version without deprecation.