Closed dalewking closed 1 year ago
I tried to re-invoke with -d argument to get more info and now it works
Actually it may have been that I also tried a kscript -c
to get it working
OK the issue is that it isn't working with Kotlin 1.9. Switching to Kotlin 1.8.20 allows it to work, but it is necessary to clear the cache after switching versions.
Same thing here. We just upgraded our cli tools to 1.9 and kscript dies on the same error.
I will have a look at it.
Same here.
Exception in thread "main" java.lang.ClassNotFoundException: kscript.scriplet.Android_lint
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at Main_Android_lint$Companion.main(Main_Android_lint.kt:5)
at Main_Android_lint.main(Main_Android_lint.kt)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.jetbrains.kotlin.runner.AbstractRunner.run(runners.kt:70)
at org.jetbrains.kotlin.runner.Main.run(Main.kt:188)
at org.jetbrains.kotlin.runner.Main.main(Main.kt:198)
We've updated Kotlin version up to 1.9.0 on developer machines and all the scripts got broken, as a result, all local script calls crashed. Fortunately, on CI it still works as the Docker container has pinned runtime versions. If you need any help - don't hesitate to ask, as we are heavily relying on kscript in our project to reproduce CI steps locally we consider this issue critical.
I am working on this. The root cause seems to be that Kotlin 1.9 disallows .kts files in the source roots. Anyway, I recommend pinning the Kotlin version on CI/CD - fixing bugs quickly won't always be possible.
Thank you. Very much appreciated your effort there.
I have just released kscript 4.2.3-RC.1 Please check if everything works as expected in your code - there are changes in the core engine of kscript, so I would like to ensure that nothing is broken after fixing the problem.
sdk install kscript 4.2.3-RC.1
@cgruber , @dalewking , @iamironz - can you confirm that the issue is fixed?
Works fine for me, thank you so much!
The final resolution is even simpler, without changing much in the kscript core. I have just released kscript 4.2.3 with Kotlin 1.9.0 compatibility.
Trying kscript for the first time and installed kotlin and kscript with sdkman on Mac and simple execution fails:
Tried with Kotlin 1.9.0 and 1.8.20 since I thought new kotlin version may have been the issue