Halcyon fails to compile with Kotlin 2.2.21 (#113)
Andrzej Wójcik (Tigase) opened 2 weeks ago

Halcyon fails to compile with Kotlin 2.2.21 and it fails while compiled with 2.1.21 in Tygrys project that is using 2.2.21. It fails with IrErrorType or "unknown kind" error type during serialization/deserialization of klib files for or during iOS builds.

  • Andrzej Wójcik (Tigase) changed state to 'In Progress' 2 weeks ago
    Previous Value Current Value
    Open
    In Progress
  • Andrzej Wójcik (Tigase) commented 2 weeks ago

    The issue was access from Halcyon class in iOS code to the setter of state field in AbstractHalcyon class that had internal protection level. Neither Kotlin nor IDEA was reporting this issue - just compilation was failing.

    The cause was presented when I used Kotlin 2.3.0 and klib from it with Halcyon library built with Kotlin 2.1.21 to analyze IR dump using following command:

    ~/.konan/kotlin-native-prebuilt-macos-aarch64-2.3.0/bin/klib dump-ir 2.0.0-SNAPSHOT/halcyon-core-iosarm64-2.0.0-SNAPSHOT.klib | grep -B 10 -A 10 IrErrorType
    

    That resulted in output:

                        STRING_CONCATENATION type=kotlin.String
                          CONST String type=kotlin.String value="Called reconnect. immediately="
                          GET_VAR 'immediately: kotlin.Boolean declared in tigase.halcyon.core.Halcyon.reconnect' type=kotlin.Boolean origin=null
              WHEN type=kotlin.Unit origin=IF
                BRANCH
                  if: CALL 'kotlin/Boolean.not|not(){}[0]' type=kotlin.Boolean origin=null
                    ARG 1: GET_VAR 'immediately: kotlin.Boolean declared in tigase.halcyon.core.Halcyon.reconnect' type=kotlin.Boolean origin=null
                  then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
                    CALL 'platform.posix/usleep|usleep(kotlin.UInt){}[100]' type=kotlin.Int origin=null
                      ARG 1: CONST Int type=kotlin.UInt value=3000
              ERROR_CALL 'Unresolved reference: R|tigase/halcyon/core/AbstractHalcyon.state|' type=IrErrorType(null)
              CALL 'tigase.halcyon.core/Halcyon.startConnector|startConnector(){}[0]' type=kotlin.Unit origin=null
                ARG 1: GET_VAR '<this>: tigase.halcyon.core.Halcyon declared in tigase.halcyon.core.Halcyon.reconnect' type=tigase.halcyon.core.Halcyon origin=null
          FUN name:createConnector signature:tigase.halcyon.core/Halcyon.createConnector|createConnector(){}[0] visibility:protected modality:OPEN returnType:tigase.halcyon.core.connector.AbstractConnector
            VALUE_PARAMETER kind:DispatchReceiver name:<this> index:0 type:tigase.halcyon.core.Halcyon
            overridden:
              tigase.halcyon.core/AbstractHalcyon.createConnector|createConnector(){}[0]
            BLOCK_BODY
              RETURN type=kotlin.Nothing from='tigase.halcyon.core/Halcyon.createConnector|createConnector(){}[0]'
                CONSTRUCTOR_CALL 'tigase.halcyon.core.connector.socket/SocketConnector.<init>|<init>(tigase.halcyon.core.Halcyon){}[0]' type=tigase.halcyon.core.connector.socket.SocketConnector origin=null
                  ARG halcyon: GET_VAR '<this>: tigase.halcyon.core.Halcyon declared in tigase.halcyon.core.Halcyon.createConnector' type=tigase.halcyon.core.Halcyon origin=null
    

    which suggested when the cause of the issue is located.

  • Andrzej Wójcik (Tigase) commented 2 weeks ago

    Waiting for Tygrys compilation using new Halcyon version build to confirm

  • Andrzej Wójcik (Tigase) changed state to 'In QA' 2 weeks ago
    Previous Value Current Value
    In Progress
    In QA
issue 1 of 1
Type
Bug
Priority
Normal
Assignee
Version
none
Sprints
n/a
Customer
n/a
Iterations
Issue Votes (0)
Watchers (3)
Reference
tigase/_libraries/halcyon#113
Please wait...
Page is in error, reload to recover