t

    Tom Dyas

    5 months ago
    I’m trying to integrate
    kotlinc
    compiler plugins into the Pants build tool’s experimental Kotlin backend. I am getting an
    AbstractMethodError
    in an integration test using the
    allopen
    plugin. Details in thread.
    This is the exception message.
    The test command is
    ./pants test src/python/pants/backend/kotlin/compile/kotlinc_test.py -- -vv -k test_compile_with_kotlinc_plugin
    The integration is not using a Kotlin distribution, but rather is resolving jars with Coursier. In this test, the allopen plugin came from resolving
    org.jetbrains.kotlin:kotlin-allopen:1.6.20
    and then passing the resulting jars via
    -Xplugin
    The compiler’s classpath was obtained by resolving
    org.jetbrains.kotlin:kotlin-compiler:1.6.20
    and
    org.jetbrains.kotlin:kotlin-scripting-compler:1.6.20
    Is the approach of using Coursier-resolved jars a problem?
    tapchicoma

    tapchicoma

    5 months ago
    tl;dr Kotlin relocates intellij dependencies for embeddable compiler artifact
    and parameter type for
    registerProjectComponent
    changes
    Check this line
    t

    Tom Dyas

    5 months ago
    hmm. So I just switched the Pants kotlin backend to use
    kotlin-compiler-embeddable
    for the compiler classpath and now the test passes. That jar shading is confusing!
    and thanks for the advice!
    tapchicoma

    tapchicoma

    5 months ago
    you could follow this issue, though not sure when or will it be resolved
    t

    Tom Dyas

    5 months ago
    Are there any downsides to using the
    -embeddable
    artifacts?
    tapchicoma

    tapchicoma

    5 months ago
    right now - no
    t

    Tom Dyas

    5 months ago
    I’ll switch Pants to use the
    -embeddable
    artifacts then.