Hey :slightly_smiling_face: When using the `Script...
# scripting
Hey 🙂 When using the
I’m running into a this error:
Copy code
Using old JVM backend
java.lang.IllegalStateException: The provided plugin org.jetbrains.kotlin.samWithReceiver.SamWithReceiverComponentRegistrar is not compatible with this version of compiler
(Script is placed in
) Does anyone have an idea? JDK is 11.0.10 and Kotlin 1.5.10. https://scans.gradle.com/s/rdbi5m2x3g27o/failure#1
Also happening with kotlin
I was able to get it running by downgrading to gradle 6.7.1. It looks they added a dependency to the sam-receiver in v6.8.
So is this now a bug in gradle or in the scripting library 😄?
As far as I remember, gradle used sam-with-receiver plugin almost from the beginning, so the issue is definitely not a new dependency. But could you please give some more details how and where you're using the scripting compiler? Is it a part of your gradle plugin?
Hey @ilya.chernikov, thanks for responding! I created a minimal reproducible case here [1]. I think the problem might be related that I use the compiler in the
. Any idea for a work around or should I report it somewhere? [1] https://github.com/neugartf/ScriptJVMCompiler_SAM_Clash
Hi @neugartf Thanks for the repro! I checked it quickly, seems the problem is in the interference of the Kotlin compiler infrastructure embedded into Gradle, and the one that scripting compiler trying to create when compiling your script. The
stuff is executed inside Gradle, as far as I know, without much isolation (by design, to ensure that it can access necessary Gradle infrastructure without issues), so you cannot use any version of the kotlin libs there. But I tried to set it to 1.4.32 (used in the Gradle 7.1 you're using in the repro project), and it doesn't help, so the problem are deeper. I created an issue to track the problem - https://youtrack.jetbrains.com/issue/KT-47453 Meanwhile your only option so far is to run these scrips out of process, I guess.
🙇 1
Thanks for answering this and all your work here!