mobanisto / pinpit-gradle-plugin

Platform Independent Native Packaging and Installer Toolkit
Apache License 2.0
50 stars 1 forks source link

Fails on :downloadWix #36

Open Syer10 opened 10 months ago

Syer10 commented 10 months ago

Compose version 1.5.11

2: Task failed with an exception.
-----------
* What went wrong:
Failed to query the value of property 'buildFlowServiceProperty'.
> Could not isolate value org.jetbrains.kotlin.gradle.plugin.statistics.BuildFlowService$Parameters_Decorated@474023ef of type BuildFlowService.Parameters
   > A problem occurred configuring project ':app'.
      > Failed to cast object task ':downloadWix' of type org.jetbrains.compose.internal.de.undercouch.gradle.tasks.download.Download_Decorated to target type de.mobanisto.pinpit.de.undercouch.gradle.tasks.download.Download

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

* Exception is:
org.gradle.api.internal.provider.AbstractProperty$PropertyQueryException: Failed to query the value of property 'buildFlowServiceProperty'.
    at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:145)
    at org.gradle.api.internal.provider.AbstractProperty.calculateOwnValue(AbstractProperty.java:136)
    at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateOwnPresentValue(AbstractMinimalProvider.java:73)
    at org.gradle.api.internal.provider.AbstractMinimalProvider.get(AbstractMinimalProvider.java:93)
    at org.jetbrains.kotlin.gradle.plugin.BuildFinishFlowAction.execute(StatisticsBuildFlowManager.kt:75)
    at org.jetbrains.kotlin.gradle.plugin.BuildFinishFlowAction.execute(StatisticsBuildFlowManager.kt:61)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.gradle.internal.snapshot.impl.IsolationException: Could not isolate value org.jetbrains.kotlin.gradle.plugin.statistics.BuildFlowService$Parameters_Decorated@474023ef of type BuildFlowService.Parameters
    at org.gradle.internal.snapshot.impl.DefaultIsolatableFactory.isolate(DefaultIsolatableFactory.java:51)
    at org.gradle.api.services.internal.RegisteredBuildServiceProvider.instantiate(RegisteredBuildServiceProvider.java:127)
    at org.gradle.api.services.internal.RegisteredBuildServiceProvider.getInstance(RegisteredBuildServiceProvider.java:118)
    at org.gradle.api.services.internal.RegisteredBuildServiceProvider.calculateOwnValue(RegisteredBuildServiceProvider.java:111)
    at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:108)
    at org.gradle.api.internal.provider.DefaultProperty.calculateValueFrom(DefaultProperty.java:128)
    at org.gradle.api.internal.provider.DefaultProperty.calculateValueFrom(DefaultProperty.java:26)
    at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:142)
    ... 120 more
Caused by: org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
    at org.gradle.configuration.project.LifecycleProjectEvaluator.wrapException(LifecycleProjectEvaluator.java:84)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:77)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.access$400(LifecycleProjectEvaluator.java:55)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate.run(LifecycleProjectEvaluator.java:255)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.doExecute(ProjectImportAction.java:117)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:91)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:39)
    at org.gradle.tooling.internal.consumer.connection.InternalBuildActionAdapter.execute(InternalBuildActionAdapter.java:64)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
Caused by: java.lang.ClassCastException: Failed to cast object task ':downloadWix' of type org.jetbrains.compose.internal.de.undercouch.gradle.tasks.download.Download_Decorated to target type de.mobanisto.pinpit.de.undercouch.gradle.tasks.download.Download
    at org.gradle.internal.Cast.cast(Cast.java:41)
    at org.gradle.internal.Transformers$CastingTransformer.transform(Transformers.java:63)
    at org.gradle.api.internal.tasks.DefaultTaskContainer.maybeCreate(DefaultTaskContainer.java:264)
    at org.gradle.api.internal.tasks.DefaultTaskContainer.maybeCreate(DefaultTaskContainer.java:76)
    at de.mobanisto.pinpit.desktop.application.tasks.windows.WixToolsetKt.configureWix(wixToolset.kt:42)
    at de.mobanisto.pinpit.desktop.application.internal.ConfigureJvmApplicationKt.configureJvmApplication(configureJvmApplication.kt:79)
    at de.mobanisto.pinpit.desktop.application.internal.ConfigureDesktopKt.configureDesktop(configureDesktop.kt:16)
    at de.mobanisto.pinpit.PinpitPlugin.apply$lambda-3(PinpitPlugin.kt:24)
    at org.gradle.api.internal.project.DefaultProject.stepEvaluationListener(DefaultProject.java:1486)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate.run(LifecycleProjectEvaluator.java:253)
    ... 166 more

==============================================================================

CONFIGURE FAILED in 2s
sebkur commented 10 months ago

Strange.

Is the code that produces this available publicly?

Which Gradle version are you using?

sebkur commented 10 months ago

also, which OS?

Syer10 commented 10 months ago

Its not available publicly, I am running on my Windows machine.

It seems like a straightforward error though, its trying to cast org.jetbrains.compose.internal.de.undercouch.gradle.tasks.download.Download_Decorated to de.mobanisto.pinpit.de.undercouch.gradle.tasks.download.Download.

Its probably some internal api that was changed in recent Compose Multiplatform versions

Syer10 commented 10 months ago

Pinpit 0.7.0 Kotlin 1.9.21 Compose 1.5.11 Gradle 8.2.1

sebkur commented 10 months ago

Hmm, I don't see relevant changes in https://github.com/JetBrains/compose-multiplatform/commits/master/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/wixToolset.kt

However, I'm wondering why I didn't run into this before. It's probably a bit broken that pinpit defines the same tasks downloadWix and unzipWix same as the compose plugin does. Then if the compose plugin defined the task already, it is not created again, but the existing task is being casted, failing. I'm now guessing you have the compose plugin's compose.desktop.application.nativeDistributions block in your gradle build file. I generally don't have them in my projects as pinpit basically replaced the compose plugin's native distribution. Could you try if disabling that and see if it helps? Do you still need that other distribution or are you just in a phase of trying things out?

Syer10 commented 10 months ago

I don't actually image

This project is in a monorepo, and some other compose projects use the default compose builds, that might have something to do with it.

sebkur commented 10 months ago

I added this to one of my example projects and unfortunately wasn't able to reproduce yet. Could be the added complexity of multiple projects within a single repo.

Maybe an easy solution would be to just have a different names for the tasks, just to be sure to avoid such clashes.

sebkur commented 10 months ago

Could you try packaging again with version 0.8.0?

Syer10 commented 10 months ago

It works, thanks!