Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B buck
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 201
    • Issues 201
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • buck
  • Issues
  • #1386
Closed
Open
Issue created Jun 20, 2017 by Administrator@rootContributor

Kotlin rules cannot be compiled against abi jars

Created by: kageiit

f43e2d20 introduced a regression that puts abi jars on the kotlinc classpath instead of full jars. kotlinc does not like this and errors out on compilation when using methods from the kotlin standard library with the following stacktrace

Caused by: java.lang.IllegalStateException: Couldn't obtain compiled function body for public inline fun <T> mutableListOf(): kotlin.collections.MutableList<T> defined in kotlin.collections[DeserializedSimpleFunctionDescriptor@727380c2]
	at org.jetbrains.kotlin.codegen.inline.InlineCodegen$1.invoke(InlineCodegen.java:280)
	at org.jetbrains.kotlin.codegen.inline.InlineCodegen$1.invoke(InlineCodegen.java:275)
	at org.jetbrains.kotlin.codegen.inline.InlineCacheKt.getOrPut(InlineCache.kt:34)
	at org.jetbrains.kotlin.codegen.inline.InlineCodegen.createMethodNode(InlineCodegen.java:274)
	at org.jetbrains.kotlin.codegen.inline.InlineCodegen.genCallInner(InlineCodegen.java:180)
	... 69 more

    val words = mutableListOf<String>()
                ^

A repro case is available here: https://github.com/uber/okbuck/tree/gk_kotlin_abi Command to run: ./buckw build //libraries/kotlinlibrary/... After removing the compile_against_abis = true change in .buckconfig in the repro, everything works as expected

Seems like this option is not safe for kotlin modules yet. The kotlin compiler is actually introspecting the classes to extract out and inline the method into the compiled code. If we compile against the abi jars, the compiled method body will not be found. I think as part of refactoring and reusing base jvm descriptions etc for f43e2d20 , it inadvertently introduced kotlinc to be able to pickup abi jars for compilation

cc @dsyang @runningcode @brettwooldridge

Assignee
Assign to
Time tracking