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

Plugin fails on Android project when Gradle Instant Execution is enabled #396

Closed
eskatos opened this issue Apr 1, 2020 · 3 comments
Closed

Comments

@eskatos
Copy link
Contributor

eskatos commented Apr 1, 2020

Run a build on an android project that uses the protobug plugin with -Dorg.gradle.unsafe.instant-execution=true, it fails with the following report:

▼ task:subproject:generateDebugProto:clipboard: of type com.google.protobuf.gradle.GenerateProtoTask:clipboard:
 ▼ fieldactions:clipboard: of com.google.protobuf.gradle.GenerateProtoTask:clipboard:
  ▼ bean of type org.gradle.api.internal.AbstractTask$ClosureTaskAction:clipboard:
   ▼ fieldclosure:clipboard: of org.gradle.api.internal.AbstractTask$ClosureTaskAction:clipboard:
    ▼ bean of type com.google.protobuf.gradle.ToolsLocator$_registerDependencyWithTasks_closure2:clipboard:
     ▼ fielddep:clipboard: of com.google.protobuf.gradle.ToolsLocator$_registerDependencyWithTasks_closure2:clipboard:
      ▼ bean of type groovy.lang.Reference:clipboard:
       ▼ fieldvalue:clipboard: of groovy.lang.Reference:clipboard:
        ▼ bean of type org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency:clipboard:
         ▼ fieldattributesFactory:clipboard: of org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency:clipboard:
          ▼ bean of type org.gradle.api.internal.attributes.DefaultImmutableAttributesFactory:clipboard:
           ▼ fieldisolatableFactory:clipboard: of org.gradle.api.internal.attributes.DefaultImmutableAttributesFactory:clipboard:
            ▼ bean of type org.gradle.internal.snapshot.impl.DefaultValueSnapshotter

#381 fixed the plugin for Java/Kotlin only builds but there are more issues with Android builds.

@ejona86
Copy link
Collaborator

ejona86 commented Apr 1, 2020

That doesn't actually include any error. What is it saying is wrong?

@eskatos
Copy link
Contributor Author

eskatos commented Apr 16, 2020

Sorry my report wasn't clear. I'll try to clarify.

I just tried to run ProtobufAndroidPluginTest using latest Gradle nightly (6.5-20200415221304+0000) and latest AGP alpha (4.1.0-alpha05) with instant execution enabled and here is the report I get:

image

You can download and look at the report instant-execution-report.zip

The problems under Gradle runtime are from AGP itself and should be fixed soon.

Instant execution serializes and reuses the Gradle task graph. The two problems reported for the GenerateProtoTask points at state held by the task instances that are not supported by instant execution: SourceSet instances, and AGP Variant instances.

In order to fix the protobuf plugin so it supports instant execution on Android builds it needs to be reworked so that GenerateProtoTask doesn't hold references to those instances.

@voidzcy
Copy link
Collaborator

voidzcy commented Oct 21, 2020

The original issue should have been fixed by #408. The remaining problems with configuration cache (instant execution) are tracked by #409 and #419. So, closing this one.

@voidzcy voidzcy closed this as completed Oct 21, 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

No branches or pull requests

3 participants