Background
IntelliJ Platform Gradle Plugin 2.19.0 changed two defaults:
- kotlin.stdlib.default.dependency now defaults to false.
- New default sandbox exclusions drop libraries the IDE already provides.
As a result, kotlin-stdlib was no longer bundled in the plugin. Our code is compiled with Kotlin 2.4.20, but it then ran against 2024.2's older bundled stdlib. 65 tests failed
with:
java.lang.NoSuchMethodError: 'kotlin.sequences.Sequence kotlin.sequences.SequencesKt.sequenceOf(java.lang.Object)'
at ...grammar.SequenceCombinator.parse(SequenceCombinator.kt:61)
Current workaround (in fix/intellij-platform-2.19.0)
These two lines are in gradle.properties. They are also in ci/release-branch-automation.Jenkinsfile, because that job regenerates gradle.properties.
kotlin.stdlib.default.dependency=true
org.jetbrains.intellij.platform.useDefaultSandboxExclusions=false
This brings back the 2.18.1 behaviour: kotlin-stdlib-2.4.20.jar is bundled. It also turns off the new exclusions for every other library the platform already provides, not just
the stdlib.
Why this should be removed
JetBrains advises against bundling the stdlib. The IDE always loads some kotlin.* classes from the platform, such as coroutines and function types, so a bundled stdlib gives
you a mix of two versions. Bundling also hid the fact that we use stdlib functions newer than our since-build (242) supports.
Proposed fix
A quick spike showed that Kotlin 2.4.20 compiles the codebase with apiVersion/languageVersion = 2.0. The tests weren't run in that configuration.
Longer term
Kotlin 2.4 already warns: "Language version 2.0 is deprecated and its support will be removed in a future version of Kotlin." Once a Kotlin release drops 2.0, 242.x has two
choices:
- Stay on the last Kotlin compiler that still supports 2.0.
- Raise the since-build, for example by finally forking a newer release branch such as 262.x. A newer IDE ships a newer Kotlin, so the pin can move up.
Related: #537 (dependabot bump to 2.19.0).
Background
IntelliJ Platform Gradle Plugin 2.19.0 changed two defaults:
As a result, kotlin-stdlib was no longer bundled in the plugin. Our code is compiled with Kotlin 2.4.20, but it then ran against 2024.2's older bundled stdlib. 65 tests failed
with:
java.lang.NoSuchMethodError: 'kotlin.sequences.Sequence kotlin.sequences.SequencesKt.sequenceOf(java.lang.Object)'
at ...grammar.SequenceCombinator.parse(SequenceCombinator.kt:61)
Current workaround (in fix/intellij-platform-2.19.0)
These two lines are in gradle.properties. They are also in ci/release-branch-automation.Jenkinsfile, because that job regenerates gradle.properties.
kotlin.stdlib.default.dependency=true
org.jetbrains.intellij.platform.useDefaultSandboxExclusions=false
This brings back the 2.18.1 behaviour: kotlin-stdlib-2.4.20.jar is bundled. It also turns off the new exclusions for every other library the platform already provides, not just
the stdlib.
Why this should be removed
JetBrains advises against bundling the stdlib. The IDE always loads some kotlin.* classes from the platform, such as coroutines and function types, so a bundled stdlib gives
you a mix of two versions. Bundling also hid the fact that we use stdlib functions newer than our since-build (242) supports.
Proposed fix
A quick spike showed that Kotlin 2.4.20 compiles the codebase with apiVersion/languageVersion = 2.0. The tests weren't run in that configuration.
Longer term
Kotlin 2.4 already warns: "Language version 2.0 is deprecated and its support will be removed in a future version of Kotlin." Once a Kotlin release drops 2.0, 242.x has two
choices:
Related: #537 (dependabot bump to 2.19.0).