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

Test with KGP 2.1.0-RC #3898

Draft
wants to merge 4 commits into
base: compiler-2.1.0
Choose a base branch
from
Draft

Test with KGP 2.1.0-RC #3898

wants to merge 4 commits into from

Conversation

whyoleg
Copy link
Collaborator

@whyoleg whyoleg commented Nov 1, 2024

compilation is failing with:

[KOTLIN] e: org.jetbrains.kotlin.backend.common.CompilationException: Back-end: Please report this problem https://kotl.in/issue
dokka/dokka-runners/dokka-gradle-plugin/src/main/kotlin/engine/parameters/DokkaModuleDescriptionKxs.kt:26:1
Problem with `@Serializable
@DokkaInternalApi
data class DokkaModuleDescriptionKxs
...
Details: kotlinx.serialization compiler plugin internal error: unable to transform declaration, see cause
...
Caused by: java.lang.NoSuchMethodError: 'org.jetbrains.kotlin.ir.expressions.impl.IrWhenImpl org.jetbrains.kotlin.ir.builders.ExpressionHelpersKt.irIfThen$default(org.jetbrains.kotlin.ir.builders.IrBuilderWithScope, org.jetbrains.kotlin.ir.types.IrType, org.jetbrains.kotlin.ir.expressions.IrExpression, org.jetbrains.kotlin.ir.expressions.IrExpression, org.jetbrains.kotlin.ir.expressions.IrStatementOrigin, int, java.lang.Object)'
...

Probably there is some issue with kotlinx.serialization compiler plugin usage when using kotlin.compiler.runViaBuildToolsApi.
KGP version = 2.1.0-RC-330
Kotlin compiler version used to compile code = 2.0.20
I've tried to set all different versions of kotlinx.serialization plugins, but none of them work.

Not sure where the issue comes from, but probably the easiest way will be to drop kotlinx.serialization usage from DGPv2 so that there will be less moving parts :)
It's possible to replace it:

  1. or with just runtime kotlinx.serialization usage via JsonObject
  2. or kotlinx.serialization can be fully dropped as it's used only for single class which could be easily replaced with just a txt file with 4 lines :)

Note: last commit adds a workaround: d43e162

with applied workaround, there are several failed DGPv2 functional tests

@adam-enko
Copy link
Member

DGPv2 uses kotlinx.serialization for encoding the parameters for the HTML and Versioning Dokka plugins, but yes, I agree it could be removed. It'd help keep the buildscripts cleaner.

@whyoleg
Copy link
Collaborator Author

whyoleg commented Nov 4, 2024

I've extracted removing compiler plugin into separate PR (#3899).
Also, @adam-enko, it would be nice if you could take a look on the reason of test failures in this PR. E.g here is the build scan from this GA build. Tests failed for dokka-gradle-plugin only.
Not urgent, but would be nice to know the reason

@adam-enko
Copy link
Member

adam-enko commented Nov 4, 2024

I've extracted removing compiler plugin into separate PR (#3899). Also, @adam-enko, it would be nice if you could take a look on the reason of test failures in this PR. E.g here is the build scan from this GA build. Tests failed for dokka-gradle-plugin only. Not urgent, but would be nice to know the reason

  1. Some tests are failing because there's extraneous logging in build scripts

    https://ge.jetbrains.com/s/i4sh5osvgysfi/tests/task/:dokka-gradle-plugin:testFunctional/details/org.jetbrains.dokka.gradle.DokkaGeneratorLoggingTest/DokkaGenerator%20logging:%20at%20lifecycle%20log%20level%20expect%20only%20error%20and%20warn%20logs?top-execution=1

    The test uses a custom Dokka plugin to cause Dokka to log info/warn/error logs, but it's compiled with an incompatible Kotlin version (the embedded Kotlin version).

    https://github.com/Kotlin/dokka/blob/master/dokka-runners/dokka-gradle-plugin/src/testFunctional/kotlin/DokkaGeneratorLoggingTest.kt#L152

  2. Some tests are failing because AGP

    Caused by: org.gradle.api.InvalidUserCodeException: Kotlin Gradle Plugin <-> Android Gradle Plugin compatibility issue:	
    The applied Android Gradle Plugin version (7.1.3) is lower than the minimum supported 7.3.1.
    

    https://ge.jetbrains.com/s/i4sh5osvgysfi/tests/task/:dokka-gradle-plugin:test/details/org.jetbrains.dokka.gradle.AndroidAutoConfigurationTest/at%20least%20one%20dokka%20task%20created()?top-execution=1

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.

2 participants