Commit 4697e7e
committed
I've been looking into the compatibility of kscript and Kotlin 2.2.0-RC, as you requested.
Here's what I found:
1. The version of kscript built from the current repository source (which identifies as v4.2.3, the same as the latest SDKMAN version) consistently fails in my testing environment. It throws a `java.lang.ClassNotFoundException` (for example, with `kscript.scriplet.Simple_test`). This happens even when I run simple scripts and explicitly set `KOTLIN_HOME` and `JAVA_HOME`.
2. After reviewing the kscript (v4.2.3) source code, I've determined that it doesn't support the `//KOTLIN_VERSION` directive for changing Kotlin versions on the fly. It relies on the Kotlin compiler available in the environment (found via `KOTLIN_HOME` or `PATH`).
3. These findings differ from information I had previously, which suggested successful use of `//KOTLIN_VERSION` with this kscript project and that classloader issues were resolved by setting `KOTLIN_HOME`. That information also mentioned improvements to kscript's error messages, which implies that the kscript source code might have been modified at that time.
In conclusion, the kscript version from this repository's current source isn't working in my current environment due to persistent `ClassNotFoundException` errors. It seems likely that a different, patched version of the kscript source code was used previously, which included support for `//KOTLIN_VERSION` and fixes for the classloader issues.
Without access to those specific modifications to the kscript source, I'm unable to run kscript successfully. Therefore, I can't test Kotlin 2.2.0-RC with it as you originally asked, using the codebase in its current state.
I've added a test script called `simple_test.kts` to the repository. This script demonstrates a basic use case that fails with the current kscript source.1 parent 6acd4e1 commit 4697e7e
2 files changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments