You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of the properties like gradle.build.host and all the other gradle.build properties make builds less reproducible as the latter may differ in the pipeline, especially host one.
The example scenario.
You have a set of tasks:
compileKotlin
generateGitProperties
processResources
compileTestKotlin
And you run it inside a pipeline with virtual envs as a runtime environment, in this case you might use a different host (runner) from job-to-job
Most probably you will have jobs designed in a next way:
pipeline build job:
compileKotlin
...
generateGitProperties
...
processResources
pipeline test job:
compileKotlin
...
generateGitProperties
...
processResources
compileTestKotlin <- this job depends on main sourseSet compilation, hence on generateGitProperties
test
Problem
Whenever the task generateGitProperties is not UP-TO-DATE it will rerun and will generate a newgit.properties having a different host inside the file. This will enforce to rerun processResources and compileTestKotlin and test where two latter tasks are heavy cacheable tasks and not expected to rerun sometimes
In other words:
Some git properties make a cascade break of up-to-date logic of many tasks and don't let it use Gradle binary cache
Workaround
Two options:
Exclude the host (or any other property) in your root build.gradle
> Task :compileTestKotlin
Build cache key for task ':compileTestKotlin' is fcf471630902ca48ab6be93e4c0b7a2f
Task ':compileTestKotlin' is not up-to-date because:
Input property 'classpathSnapshotProperties.classpath' file /Users/artemptushkin/...build/resources/main/git.properties has changed.
Proposal
Short term. Define a property for gitProperties to exclude some git properties as ...keys.findAll is not a very convenient way
Long-term. There is a high chance that another git property will break someone and this will be not clear why. I do think it's possible to tweak this somehow else but maybe we should log something here?
The text was updated successfully, but these errors were encountered:
artemptushkin
changed the title
Some properties make builds not up-to-da-date when it's expected to be
Some properties make builds not incremental when it's expected to be
Sep 14, 2022
artemptushkin
changed the title
Some properties make builds not incremental when it's expected to be
Some properties make builds non incremental when it's expected to be
Sep 14, 2022
Some of the properties like
gradle.build.host
and all the othergradle.build
properties make builds less reproducible as the latter may differ in the pipeline, especially host one.The example scenario.
You have a set of tasks:
And you run it inside a pipeline with virtual envs as a runtime environment, in this case you might use a different host (runner) from job-to-job
Most probably you will have jobs designed in a next way:
...
...
...
...
generateGitProperties
Problem
Whenever the task
generateGitProperties
is not UP-TO-DATE it will rerun and will generate a newgit.properties
having a different host inside the file. This will enforce to rerunprocessResources
andcompileTestKotlin
andtest
where two latter tasks are heavy cacheable tasks and not expected to rerun sometimesIn other words:
Some git properties make a cascade break of
up-to-date
logic of many tasks and don't let it use Gradle binary cacheWorkaround
Two options:
In the GitLab pipeline I have the next workaround to make incremental build works
Update:
Having any property actually causes compileTestKotlin to rerun, here is the prove
Running
./gradlew test
Output:
Proposal
Short term. Define a property for
gitProperties
to exclude some git properties as...keys.findAll
is not a very convenient wayLong-term. There is a high chance that another git property will break someone and this will be not clear why. I do think it's possible to tweak this somehow else but maybe we should log something here?
The text was updated successfully, but these errors were encountered: