question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to upgrade past 0.11.0-125

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ileasilecommented, Jul 25, 2022
0reactions
ileasilecommented, Jul 25, 2022

It’s not an internal error, it’s just a compilation error (see the last Caused by). If you haven’t commented out the tests that use kotlin-compile-testing plugin, it’s expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to update pip3 even though I try to update it
1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
Read more >
upgrade from 22.2 to 22.2.1. fails with ImportError for ... - GitHub
Description When trying to upgrade from 22.2 to 22.2.1, the install fails because of an ImportError. The setuptools version is 63.2.0.
Read more >
Upgrading to Newer Releases — Flask Documentation (1.1.x)
The update script provided should be able to upgrade your applications automatically, but there might be some cases where it fails to upgrade....
Read more >
python - Unable to upgrade pip - Ask Ubuntu
I am new to Linux and Ubuntu. I was trying to upgrade pip but ran into this... $ sudo pip install --upgrade pip...
Read more >
Not able to install latest version of scikit-learn - Super User
When updating an existing, installed Python package with pip install , you should typically include the --upgrade (-U) option e.g.:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found