Hey everyone! I'm interested to learn how the Kotl...
# kontributors
p
Hey everyone! I'm interested to learn how the Kotlin compiler works and eventually in contributing to the project. Right now I'm trying to read and learn as much as possible. I have cloned the repo and followed the steps described in https://github.com/JetBrains/kotlin/tree/master#building. I run
openjdk 17.0.9
and set
kotlin.build.isObsoleteJdkOverrideEnabled=true
in my
local.properties
. I tried running one of the important gradle tasks as follow:
./gradlew -Porg.gradle.java.installations.auto-detect=false compilerTest
this fails with reason:
Copy code
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':kotlin-stdlib-jdk8:compileModuleTestKotlin'.
> Inconsistent JVM-target compatibility detected for tasks 'compileModuleTestJava' (9) and 'compileModuleTestKotlin' (11).
I am not sure what's going wrong as I have not made any changes to the repo, and I followed the steps from the README. Could someone perhaps help me out? Thanks!
Could it be that I need JDK6 of JDK7 because the task seems to hit
kotlin-stdlib
?
d
Compilation of stdlib depends on jdk 8 and 9 Just run dist task without any additional gradle properties, and gradle automatically download all required jdks using toolchains
👍 1
I also don't recommend to run compilerTest task as it will run for a very long time Instead it's better to open the project in ide and run specific tests you are interested in
p
Thank you very much! I'll try to run the
dist
task and figure things out from within the IDE.
Hmm now something with the toolchain seems to fail when running:
./gradlew dist
:
Copy code
Invalid Java installation found at '/home/xxx/.gradle/jdks/zing20/zing20.09.1.0-1-jdk7.0.272-linux_x64' (provisioned toolchain). It will be re-checked in the next build. This might have performance impact if it keeps failing. Run the 'javaToolchains' task for more details.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':kotlin-stdlib:compileMainJdk7KotlinJvm'.
> Unable to download toolchain matching the requirements ({languageVersion=7, vendor=any, implementation=vendor-specific}) from '<https://api.foojay.io/disco/v3.0/ids/45dfb704e8dcceab434285501d74cd33/redirect>'.
   > Provisioned toolchain '/home/xxx/.gradle/jdks/zing20/zing20.09.1.0-1-jdk7.0.272-linux_x64' could not be probed: Command returned unexpected result code: 139
I see that specific jdk downloaded to my
~/.gradle/jdks
folder, but it's not extracted from the .tar.gz. Also ran the
javaToolchains
task, this also shows no jdk7 installation found.
Given that toolchains are something provided by Gradle, would this be something to report/ask to Gradle?
d
Actually it's very strange, because
kotlin.build.isObsoleteJdkOverrideEnabled=true
should disable downloading of JDK 7 (together with JDK 6) Where did you locate your
local.properties
file? It should be in the root of the project, near
gradle.properties
p
My bad @dmitriy.novozhilov. I removed my
local.properties
when I tried to run
dist
task. Because of https://kotlinlang.slack.com/archives/C0BUHC9HD/p1703191129233299?thread_ts=1703189917.604479&amp;cid=C0BUHC9HD:
Just run dist task without any additional gradle properties
I thought you meant to also run without the
local.properties
. I will give it a try when putting back my properties file. Thanks again for the help, and happy holidays!
thank you color 1