Skip to content

Fixes Configuration caching issues#29

Merged
vRallev merged 1 commit intosquare:mainfrom
stephanenicolas:sni/fix-instant-execution-issues
Jul 16, 2020
Merged

Fixes Configuration caching issues#29
vRallev merged 1 commit intosquare:mainfrom
stephanenicolas:sni/fix-instant-execution-issues

Conversation

@stephanenicolas
Copy link
Copy Markdown
Contributor

Using versions: [Kotlin:1.4-M3, Gradle:6.5, AGP 4.1 beta 04], I could detect some issues when running instant execution:

428 problems were found reusing the configuration cache, 4 of which seem unique.
- field '$disableIncrementalCompilationTaskProvider' from type 'com.squareup.hephaestus.plugin.HephaestusPlugin$disableIncrementalKotlinCompilation$disableIncrementalCompilationAction$1$1': cannot deserialize object of type 'org.gradle.api.Task' as these are not supported with the configuration cache.
  See https://docs.gradle.org/6.6-rc-1/userguide/configuration_cache.html#config_cache:requirements:task_access
- field '$disableIncrementalCompilationTaskProvider' from type 'com.squareup.hephaestus.plugin.HephaestusPlugin$disableIncrementalKotlinCompilation$disableIncrementalCompilationAction$1$1': value 'undefined' is not assignable to 'org.gradle.api.tasks.TaskProvider'
- field '$project' from type 'com.squareup.hephaestus.plugin.HephaestusPlugin$disableIncrementalKotlinCompilation$disableIncrementalCompilationAction$1': cannot deserialize object of type 'org.gradle.api.Project' as these are not supported with the configuration cache.
  See https://docs.gradle.org/6.6-rc-1/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- field '$project' from type 'com.squareup.hephaestus.plugin.HephaestusPlugin$disablePreciseJavaTracking$1': cannot deserialize object of type 'org.gradle.api.Project' as these are not supported with the configuration cache.
  See https://docs.gradle.org/6.6-rc-1/userguide/configuration_cache.html#config_cache:requirements:disallowed_types

This PR fixes the various issues. Thx to @bamboo for the guidance

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Stephane Nicolas seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@stephanenicolas
Copy link
Copy Markdown
Contributor Author

stephanenicolas commented Jul 16, 2020

It passed and I don't see the error anymore.

@stephanenicolas stephanenicolas force-pushed the sni/fix-instant-execution-issues branch from 909a346 to f9d6c8f Compare July 16, 2020 19:40
import org.gradle.api.services.BuildServiceParameters.None

/** This signal is used to share state between the task above and Kotlin compile tasks. */
open abstract class IncrementalSignal : BuildService<None> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

An abstract class is automatically open. open is redundant.

)
// We avoid a reference to the project in the doFirst.
val projectPath = project.path
val incremental = incrementalSignal.get().incremental[projectPath]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You call this too early. It has to happen in the doFirst, because otherwise the task that toggles this flag didn't run, yet.

@vRallev vRallev self-requested a review July 16, 2020 20:22
compileTask.doFirst {
// If the signal is set, then the plugin classpath changed. Apply the setting that
// DisableIncrementalCompilationTask requested.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Move this empty line above the comment.

@stephanenicolas stephanenicolas force-pushed the sni/fix-instant-execution-issues branch from f9d6c8f to ba7caac Compare July 16, 2020 22:25
@stephanenicolas stephanenicolas force-pushed the sni/fix-instant-execution-issues branch from ba7caac to 5fc83d1 Compare July 16, 2020 22:26
@vRallev
Copy link
Copy Markdown
Collaborator

vRallev commented Jul 16, 2020

Tested and confirmed locally that incremental builds still work as expected.

@vRallev vRallev merged commit 7a7e591 into square:main Jul 16, 2020
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.

3 participants