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

[1.9.20-1.0.14] Error: Rewrite at slice LEXICAL_SCOPE key: ANNOTATION_ENTRY old value #1591

Closed
chrisbanes opened this issue Nov 3, 2023 · 15 comments · Fixed by #1606
Closed
Assignees

Comments

@chrisbanes
Copy link

error: java.lang.AssertionError: Rewrite at slice LEXICAL_SCOPE key: ANNOTATION_ENTRY old value:
org.jetbrains.kotlin.resolve.scopes.LexicalScope$Base@6f93355@116994901
new value: org.jetbrains.kotlin.resolve.scopes.LexicalScope$Base@3568912a@896045354

Seems to only happen on iOS (maybe all Kotlin Native).

Repro: chrisbanes/tivi#1620

@chrisbanes chrisbanes changed the title [1.0.14-19.2.0] Error: Rewrite at slice LEXICAL_SCOPE key: ANNOTATION_ENTRY old value [1.9.20-1.0.14] Error: Rewrite at slice LEXICAL_SCOPE key: ANNOTATION_ENTRY old value Nov 3, 2023
@rjaros
Copy link

rjaros commented Nov 3, 2023

I've got the same problem on Kotlin/JS.

@bitspittle
Copy link
Contributor

bitspittle commented Nov 3, 2023

Same issue on Linux with Kotlin/JS as well. Didn't happen in 1.0.13 but happens with 1.0.14.

Repro steps

Initial setup

  • git clone https://github.com/varabyte/kobweb
  • cd kobweb && git checkout 0.15.0
  • cd kobweb/playground # This is a nested Gradle project that includes the parent "kobweb" project

First, make sure compilation works:

  • ./gradlew :site:kobwebGenSiteEntry

Finally, see that 1.0.14 breaks things:

  • edit ../gradle/libs.versions.toml
  • Set ksp = 1.9.20-1.0.14
  • Rerun ./gradlew :site:kobwebGenSiteEntry
  •   e: java.lang.AssertionError: Rewrite at slice LEXICAL_SCOPE key: ANNOTATION_ENTRY old value: org.jetbrains.kotl
      in.resolve.scopes.LexicalScope$Base@17af8f98@397381528 new value: org.jetbrains.kotlin.resolve.scopes.LexicalSc
      ope$Base@325dbb8f@845003663                                                                                    
      <File name: KotlinLanguage.kt, Physical: true>                                                                 
      <ELEMENT>@Page("languages/kotlin")</ELEMENT>                                                                   
      @Composable                                                                                                    
      fun KotlinLanguagePage() {                                                                                     
          playground.components.layouts.PageLayout("KOTLIN") {                                                       
              org.jetbrains.compose.web.dom.P {                                                                      
                  org.jetbrains.compose.web.dom.Text("Concise. Cross‑platform. Fun.")                                
              }                                                                                                      
              org.jetbrains.compose.web.dom.P {                                                                      
                  com.varabyte.kobweb.silk.components.navigation.Link("https://kotlinlang.org", "https://kotlinlang.o
      rg")                                                                                                           
              }                                                                                                      
          }                                                                                                          
      }          
    

@taetae98coding
Copy link

I've got the same problem on Kotlin/JS.

me too.

@robertfmurdock
Copy link

robertfmurdock commented Nov 4, 2023

I'm also seeing this (observed in kotlin js).

@GuilhE
Copy link

GuilhE commented Nov 6, 2023

Me too, failing for iOS

@neetopia
Copy link
Collaborator

neetopia commented Nov 6, 2023

To facilitate investigation, are all issues happening on non jvm targets only?

@sumit-jha-Pw
Copy link

Yes @neetopia , getting issues while compiling IOS applications only.
Caused by: java.lang.Throwable: Rewrite at slice LEXICAL_SCOPE key: ANNOTATION_ENTRY old value: org.jetbrains.kotlin.resolve.scopes.LexicalScope$Base@6320831a@1663075098 new value: org.jetbrains.kotlin.resolve.scopes.LexicalScope$Base@16f23d31@384974129

@farhazulmullick-pw
Copy link

@neetopia I have got the same exact issue while compiling against iOS. Works smoothly with Android.

kotlin = "1.9.20"
ksp = "1.9.20-1.0.14"

@neetopia
Copy link
Collaborator

offending commit seems to be d1e080f, however this does not look to be a KMP specific commit, my guess is this commit exposed some underlying issues.

@GuilhE
Copy link

GuilhE commented Nov 16, 2023

offending commit seems to be d1e080f, however this does not look to be a KMP specific commit, my guess is this commit exposed some underlying issues.

Will it be available as 1.0.15 version? Any ETA? Thanks 🙏🏼

@neetopia
Copy link
Collaborator

it is expected to be shipped next week

@GuilhE
Copy link

GuilhE commented Nov 27, 2023

Any estimation?

@bitspittle
Copy link
Contributor

https://github.com/google/ksp/releases/tag/1.9.21-1.0.15 was released a few hours ago and I can confirm that it's working for me.

@GuilhE
Copy link

GuilhE commented Nov 28, 2023

I confirm too 👍🏼

@jschneider
Copy link

I still have the issue. But the error message changed slightly:

e: java.lang.AssertionError: Rewrite at slice LEXICAL_SCOPE key: ANNOTATION_ENTRY old value: org.jetbrains.kotlin.resolve.scopes.LexicalScope$Base@7537dc33@1966595123 new value: org.jetbrains.kotlin.resolve.scopes.LexicalScope$Base@1af47f86@452231046
<File name: MeisterCharts.kt, Physical: true>
/**
 * Creates the [BarChartStacked] as a child of [element].
 * @see [createBarChartStacked]h
 */
<ELEMENT>@JsExport</ELEMENT>
@JsName("createBarChartStackedFromElement")
@Suppress("unused")
fun createBarChartStackedFromElement(
  element: Element
): BarChartStacked {
  val barChartStacked = createBarChartStacked()
  element.appendChild(barChartStacked.holder)
  return barChartStacked
}
        at org.jetbrains.kotlin.com.intellij.openapi.diagnostic.DefaultLogger.error(DefaultLogger.java:54)
        at org.jetbrains.kotlin.com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
        at org.jetbrains.kotlin.util.slicedMap.Slices.logErrorAboutRewritingNonEqualObjects(Slices.java:158)
        at org.jetbrains.kotlin.util.slicedMap.Slices.access$000(Slices.java:30)
        at org.jetbrains.kotlin.util.slicedMap.Slices$1.processRewrite(Slices.java:42)
        at org.jetbrains.kotlin.util.slicedMap.SlicedMapImpl.put(SlicedMapImpl.java:65)
        at org.jetbrains.kotlin.resolve.BindingTraceContext.record(BindingTraceContext.java:150)
        at org.jetbrains.kotlin.storage.LockBasedLazyResolveStorageManager$LockProtectedTrace$record$1.invoke(LockBasedLazyResolveStorageManager.kt:70)
        at org.jetbrains.kotlin.storage.LockBasedLazyResolveStorageManager$LockProtectedTrace$record$1.invoke(LockBasedLazyResolveStorageManager.kt:70)
        at org.jetbrains.kotlin.storage.LockBasedStorageManager.compute(LockBasedStorageManager.java:290)
        at org.jetbrains.kotlin.storage.LockBasedLazyResolveStorageManager$LockProtectedTrace.record(LockBasedLazyResolveStorageManager.kt:70)
        at org.jetbrains.kotlin.resolve.calls.CallResolver.resolveCallForConstructor(CallResolver.java:380)
        at org.jetbrains.kotlin.resolve.calls.CallResolver.resolveFunctionCall(CallResolver.java:334)
        at org.jetbrains.kotlin.resolve.calls.CallResolver.resolveFunctionCall(CallResolver.java:303)
        at org.jetbrains.kotlin.resolve.AnnotationResolverImpl.resolveAnnotationCall(AnnotationResolverImpl.java:167)
        at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor$valueArgumentsWithSourceInfo$2.invoke(LazyAnnotations.kt:107)
        at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor$valueArgumentsWithSourceInfo$2.invoke(LazyAnnotations.kt:106)
        at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
        at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
        at org.jetbrains.kotlin.storage.StorageKt.getValue(storage.kt:42)
        at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor.getValueArgumentsWithSourceInfo(LazyAnnotations.kt:106)
        at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor.access$getValueArgumentsWithSourceInfo(LazyAnnotations.kt:76)
        at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor$allValueArguments$2.invoke(LazyAnnotations.kt:121)
        at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor$allValueArguments$2.invoke(LazyAnnotations.kt:120)
        at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
        at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
        at org.jetbrains.kotlin.storage.StorageKt.getValue(storage.kt:42)
        at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor.getAllValueArguments(LazyAnnotations.kt:120)
        at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor.forceResolveAllContents(LazyAnnotations.kt:138)
        at org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil.doForceResolveAllContents(ForceResolveUtil.java:78)
        at org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil.forceResolveAllContents(ForceResolveUtil.java:69)
        at org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil.doForceResolveAllContents(ForceResolveUtil.java:97)
        at org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil.forceResolveAllContents(ForceResolveUtil.java:42)
        at com.google.devtools.ksp.processing.impl.ResolverImpl.resolveDeclarationForLocal(ResolverImpl.kt:834)
        at com.google.devtools.ksp.processing.impl.ResolverImpl.resolveDeclaration(ResolverImpl.kt:494)
        at com.google.devtools.ksp.symbol.impl.kotlin.KSPropertyDeclarationImpl$propertyDescriptor$2.invoke(KSPropertyDeclarationImpl.kt:45)
        at com.google.devtools.ksp.symbol.impl.kotlin.KSPropertyDeclarationImpl$propertyDescriptor$2.invoke(KSPropertyDeclarationImpl.kt:44)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at com.google.devtools.ksp.symbol.impl.kotlin.KSPropertyDeclarationImpl.getPropertyDescriptor(KSPropertyDeclarationImpl.kt:44)
        at com.google.devtools.ksp.symbol.impl.kotlin.KSPropertyDeclarationImpl.access$getPropertyDescriptor(KSPropertyDeclarationImpl.kt:36)
        at com.google.devtools.ksp.symbol.impl.kotlin.KSPropertyDeclarationImpl$type$2$1.invoke(KSPropertyDeclarationImpl.kt:98)
        at com.google.devtools.ksp.symbol.impl.kotlin.KSPropertyDeclarationImpl$type$2$1.invoke(KSPropertyDeclarationImpl.kt:97)
        at com.google.devtools.ksp.symbol.impl.kotlin.KSTypeReferenceDeferredImpl$resolved$2.invoke(KSTypeReferenceDeferredImpl.kt:57)
        at com.google.devtools.ksp.symbol.impl.kotlin.KSTypeReferenceDeferredImpl$resolved$2.invoke(KSTypeReferenceDeferredImpl.kt:56)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at com.google.devtools.ksp.symbol.impl.kotlin.KSTypeReferenceDeferredImpl.getResolved(KSTypeReferenceDeferredImpl.kt:56)
        at com.google.devtools.ksp.symbol.impl.kotlin.KSTypeReferenceDeferredImpl.toString(KSTypeReferenceDeferredImpl.kt:67)
        at java.base/java.lang.String.valueOf(String.java:4225)
        at java.base/java.lang.StringBuilder.append(StringBuilder.java:173)
        at it.neckar.ksp.ts.LoggerVisitor.visitTypeReference(LoggerVisitor.kt:156)
        at it.neckar.ksp.ts.LoggerVisitor.visitTypeReference(LoggerVisitor.kt:34)
        at com.google.devtools.ksp.symbol.impl.kotlin.KSTypeReferenceDeferredImpl.accept(KSTypeReferenceDeferredImpl.kt:63)
        at com.google.devtools.ksp.visitor.KSTopDownVisitor.accept(KSTopDownVisitor.kt:34)
        at com.google.devtools.ksp.visitor.KSTopDownVisitor.visitPropertyDeclaration(KSTopDownVisitor.kt:37)
        at it.neckar.ksp.ts.LoggerVisitor.visitPropertyDeclaration(LoggerVisitor.kt:52)
        at it.neckar.ksp.ts.LoggerVisitor.visitPropertyDeclaration(LoggerVisitor.kt:34)
        at com.google.devtools.ksp.symbol.impl.kotlin.KSPropertyDeclarationImpl.accept(KSPropertyDeclarationImpl.kt:115)
        at com.google.devtools.ksp.visitor.KSTopDownVisitor.accept(KSTopDownVisitor.kt:28)
        at com.google.devtools.ksp.visitor.KSTopDownVisitor.visitDeclarationContainer(KSTopDownVisitor.kt:60)
        at it.neckar.ksp.ts.LoggerVisitor.visitDeclarationContainer(LoggerVisitor.kt:92)
        at it.neckar.ksp.ts.LoggerVisitor.visitDeclarationContainer(LoggerVisitor.kt:34)
        at com.google.devtools.ksp.visitor.KSDefaultVisitor.visitFunctionDeclaration(KSDefaultVisitor.kt:38)
        at com.google.devtools.ksp.visitor.KSTopDownVisitor.visitFunctionDeclaration(KSTopDownVisitor.kt:74)
        at it.neckar.ksp.ts.LoggerVisitor.visitFunctionDeclaration(LoggerVisitor.kt:107)
        at it.neckar.ksp.ts.LoggerVisitor.visitFunctionDeclaration(LoggerVisitor.kt:34)
        at com.google.devtools.ksp.symbol.impl.kotlin.KSFunctionDeclarationImpl.accept(KSFunctionDeclarationImpl.kt:118)
        at it.neckar.ksp.ts.TypeScriptGeneratorProcessor.process(TypeScriptGeneratorProcessor.kt:66)
        at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:306)
        at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:304)
        at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.handleException(KotlinSymbolProcessingExtension.kt:410)
        at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:304)
        at org.jetbrains.kotlin.js.analyze.AbstractTopDownAnalyzerFacadeForWeb.analyzeFilesWithGivenTrace(TopDownAnalyzerFacadeForJS.kt:142)
        at org.jetbrains.kotlin.js.analyze.AbstractTopDownAnalyzerFacadeForWeb.analyzeFiles(TopDownAnalyzerFacadeForJS.kt:94)
        at org.jetbrains.kotlin.ir.backend.js.ModulesStructure$runAnalysis$1.invoke(klib.kt:534)
        at org.jetbrains.kotlin.ir.backend.js.ModulesStructure$runAnalysis$1.invoke(klib.kt:533)
        at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:115)
        at org.jetbrains.kotlin.ir.backend.js.ModulesStructure.runAnalysis(klib.kt:533)
        at org.jetbrains.kotlin.ir.backend.js.PrepareAnalyzedSourceModuleKt.prepareAnalyzedSourceModule(prepareAnalyzedSourceModule.kt:30)
        at org.jetbrains.kotlin.ir.backend.js.PrepareAnalyzedSourceModuleKt.prepareAnalyzedSourceModule$default(prepareAnalyzedSourceModule.kt:17)
        at org.jetbrains.kotlin.cli.js.K2JsIrCompiler.processSourceModule(K2JsIrCompiler.kt:427)
        at org.jetbrains.kotlin.cli.js.K2JsIrCompiler.doExecute(K2JsIrCompiler.kt:273)
        at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:181)
        at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:72)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:104)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:48)
        at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1523)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:578)
        at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
        at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:598)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:844)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:721)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:720)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1589)

Everything builds fine with 1.9.20-1.0.13

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 a pull request may close this issue.

10 participants