Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update kotlin version #939

Closed
wants to merge 3 commits into from
Closed

Update kotlin version #939

wants to merge 3 commits into from

Conversation

oowekyala
Copy link
Collaborator

I was having trouble building, the kotlin compilation was failing with this error:

> Task :org.lflang:compileKotlin FAILED
e: java.lang.NoClassDefFoundError: Could not initialize class org.jetbrains.kotlin.com.intellij.pom.java.LanguageLevel
        at org.jetbrains.kotlin.com.intellij.core.CoreLanguageLevelProjectExtension.<init>(CoreLanguageLevelProjectExtension.java:26)
        at org.jetbrains.kotlin.com.intellij.core.JavaCoreProjectEnvironment.<init>(JavaCoreProjectEnvironment.java:42)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreProjectEnvironment.<init>(KotlinCoreProjectEnvironment.kt:26)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$ProjectEnvironment.<init>(KotlinCoreEnvironment.kt:121)
        at org.jetbrains.ko

After some digging I found that our gradle wrapper uses kotlin 1.5.31:

$ ./gradlew --version
------------------------------------------------------------
Gradle 7.3.3
------------------------------------------------------------

Build time:   2021-12-22 12:37:54 UTC
Revision:     6f556c80f945dc54b50e0be633da6c62dbe8dc71

Kotlin:       1.5.31
Groovy:       3.0.9
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          17.0.2 (Azul Systems, Inc. 17.0.2+8-LTS)
OS:           Linux 5.13.0-27-generic amd64

This PR updates the kotlin version we use to be in sync with that of gradle, which resolves the error for me.

Copy link
Collaborator

@cmnrd cmnrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated this branch to use the kotlin version specified in gradle.properties.

Unfortunately, with Kotlin 1.5.31 the issue #935 appears again (this is the reason why we downgraded to 1.4.30). Essentially, if you run build-lfc twice, it will produce a jar without Kotlin classes (for whatever reason...). Maybe you can try again with Kotlin version 1.4.30 and setting the plugin version explicitly as in this change? Also, let me know if you have any ideas regarding the cause of #935.

@oowekyala
Copy link
Collaborator Author

@cmnrd Thanks for the review and context. I can't reproduce the build failures I was experiencing... Maybe it was because of my jdk version 17, though today it works fine... 🤷 I guess we can just close this.

I'm not sure what to do about the issue you're referring to (is it really #935?), but it sounds like a caching problem maybe?

@oowekyala oowekyala closed this Feb 8, 2022
@petervdonovan
Copy link
Collaborator

I'm not sure what to do about the issue you're referring to

(I think he probably meant #928 and #930.)

@cmnrd
Copy link
Collaborator

cmnrd commented Feb 9, 2022

Yes, that's what I meant. Not sure what happened there with the numbers 😆

@cmnrd cmnrd deleted the update-kotlin-version branch February 9, 2022 17:30
oowekyala added a commit to oowekyala/intellij-javacc that referenced this pull request Mar 24, 2022
make the kotlin version the wrapper match ours
to avoid lf-lang/lingua-franca#939
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants