Skip to content

Unable to upgrade past 0.11.0-125 #377

@breandan

Description

@breandan

I recently tried updating from 0.11.0-125 to 0.11.0-134, however compilation failed after doing so with the following error:

Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option 

In order to resolve it, I added the following snippet to my build.gradle.kts file:

kotlin { jvm { compilations.all { kotlinOptions { kotlinOptions.jvmTarget = "11" } } } } 

This compiled, but subsequently produced the following error when running ./gradlew allTests:

RenderingTests[jvm] > random matrix is rendered to bmp()[jvm] FAILED org.jetbrains.kotlinx.jupyter.exceptions.ReplLibraryException: The problem is found in one of the loaded libraries: check library imports, dependencies and repositories at app//org.jetbrains.kotlinx.jupyter.exceptions.ReplLibraryExceptionKt.rethrowAsLibraryException(ReplLibraryException.kt:29) at app//org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$ExecutionContext.addLibraries(CellExecutorImpl.kt:145) at app//org.jetbrains.kotlinx.jupyter.libraries.LibrariesScanner.addLibrariesFromClassLoader(LibrariesScanner.kt:59) at app//org.jetbrains.kotlinx.jupyter.libraries.LibrariesScanner.addLibrariesFromClassLoader$default(LibrariesScanner.kt:49) at app//org.jetbrains.kotlinx.jupyter.testkit.ReplProvider$Companion$initializeWithCurrentClasspath$1.invoke(ReplProvider.kt:49) at app//org.jetbrains.kotlinx.jupyter.testkit.ReplProvider$Companion$initializeWithCurrentClasspath$1.invoke(ReplProvider.kt:49) at app//org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl.execute(CellExecutorImpl.kt:119) at app//org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.eval(repl.kt:490) at app//org.jetbrains.kotlinx.jupyter.testkit.ReplProvider$Companion.initializeWithCurrentClasspath(ReplProvider.kt:49) at app//org.jetbrains.kotlinx.jupyter.testkit.ReplProvider$Companion.withoutLibraryResolution$lambda-1(ReplProvider.kt:17) at app//org.jetbrains.kotlinx.jupyter.testkit.JupyterReplTestCase.<init>(JupyterReplTestCase.kt:15) at app//org.jetbrains.kotlinx.jupyter.testkit.JupyterReplTestCase.<init>(JupyterReplTestCase.kt:12) at app//ai.hypergraph.kaliningraph.notebook.RenderingTests.<init>(NotebookTest.kt:11) Caused by: org.jetbrains.kotlinx.jupyter.exceptions.ReplCompilerException: Unable to initialize repl compiler: DEBUG Using JVM IR backend ERROR MainCommandLineProcessor::pluginOptions accessed before thread local parameters have been set: java.lang.IllegalStateException: MainCommandLineProcessor::pluginOptions accessed before thread local parameters have been set at app//org.jetbrains.kotlinx.jupyter.repl.impl.JupyterCompilerImpl.compileSync(JupyterCompilerImpl.kt:174) at app//org.jetbrains.kotlinx.jupyter.repl.impl.InternalEvaluatorImpl.eval(InternalEvaluatorImpl.kt:99) at app//org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$execute$1$result$1.invoke(CellExecutorImpl.kt:71) at app//org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$execute$1$result$1.invoke(CellExecutorImpl.kt:69) at app//org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.withHost(repl.kt:635) at app//org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl.execute(CellExecutorImpl.kt:69) at app//org.jetbrains.kotlinx.jupyter.repl.CellExecutor$DefaultImpls.execute$default(CellExecutor.kt:15) at app//org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$ExecutionContext.execute(CellExecutorImpl.kt:204) at app//org.jetbrains.kotlinx.jupyter.api.libraries.CodeExecution$toExecutionCallback$1.invoke(CodeExecution.kt:20) at app//org.jetbrains.kotlinx.jupyter.api.libraries.CodeExecution$toExecutionCallback$1.invoke(CodeExecution.kt:16) at app//org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$ExecutionContext.execute(CellExecutorImpl.kt:226) at app//org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$ExecutionContext.runChild(CellExecutorImpl.kt:136) at app//org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$ExecutionContext.runChild(CellExecutorImpl.kt:132) at app//org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$ExecutionContext.access$runChild(CellExecutorImpl.kt:122) at app//org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$ExecutionContext$addLibraries$1.invoke(CellExecutorImpl.kt:146) at app//org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$ExecutionContext$addLibraries$1.invoke(CellExecutorImpl.kt:145) at app//org.jetbrains.kotlinx.jupyter.exceptions.ReplLibraryExceptionKt.rethrowAsLibraryException(ReplLibraryException.kt:27) ... 12 more Caused by: java.lang.IllegalStateException: Unable to initialize repl compiler: DEBUG Using JVM IR backend ERROR MainCommandLineProcessor::pluginOptions accessed before thread local parameters have been set: java.lang.IllegalStateException: MainCommandLineProcessor::pluginOptions accessed before thread local parameters have been set at org.jetbrains.kotlin.scripting.compiler.plugin.impl.KJvmReplCompilerBase$Companion.createCompilationState(KJvmReplCompilerBase.kt:337) at org.jetbrains.kotlin.scripting.ide_services.compiler.KJvmReplCompilerWithIdeServices$1.invoke(KJvmReplCompilerWithIdeServices.kt:30) at org.jetbrains.kotlin.scripting.ide_services.compiler.KJvmReplCompilerWithIdeServices$1.invoke(KJvmReplCompilerWithIdeServices.kt:29) at org.jetbrains.kotlin.scripting.compiler.plugin.repl.JvmReplCompilerState.initializeCompilation(jvmReplCompilation.kt:61) at org.jetbrains.kotlin.scripting.compiler.plugin.repl.JvmReplCompilerState.getCompilationState(jvmReplCompilation.kt:47) at org.jetbrains.kotlin.scripting.compiler.plugin.impl.KJvmReplCompilerBase.compile$suspendImpl(KJvmReplCompilerBase.kt:74) at org.jetbrains.kotlin.scripting.compiler.plugin.impl.KJvmReplCompilerBase.compile(KJvmReplCompilerBase.kt) at kotlin.script.experimental.api.ReplCompiler$DefaultImpls.compile(replCompilation.kt:49) at org.jetbrains.kotlin.scripting.compiler.plugin.impl.KJvmReplCompilerBase.compile(KJvmReplCompilerBase.kt:54) at org.jetbrains.kotlinx.jupyter.repl.impl.JupyterCompilerImpl$compileSync$resultWithDiagnostics$1.invokeSuspend(JupyterCompilerImpl.kt:173) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284) at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85) at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59) at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38) at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) at org.jetbrains.kotlinx.jupyter.repl.impl.JupyterCompilerImpl.compileSync(JupyterCompilerImpl.kt:173) ... 28 more 

After encountering this error, I decided to add the following line to the build.gradle.kts file:

 jvm { compilations.all { kotlinOptions { kotlinOptions.jvmTarget = "11" useOldBackend = true } } } 

However I then encountered the following issue:

w: Language version is automatically inferred to 1.5 when using the old JVM backend. Consider specifying -language-version explicitly, or remove -Xuse-old-backend 

This resulted in the second error reappearing. Currently it is unclear how to proceed, any advice would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugInstallation and functionality issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions