Skip to content

Unexpected ABI break: Koin.runOnKoinStarted 4.1 -> 4.2 #2391

Description

@ctuncan

Describe the bug
Due to the refactors in this commit the symbol for Koin.runOnKoinStarted changed from org.koin.core.KoinWaitExtKt.runOnKoinStarted to org.koin.core.KoinWaitExt_jvmKt.runOnKoinStarted

This is a source compatible change, but not a binary compatible change.
This change appears to be intended to make waitAllStartJobs available to common code.
This ABI break does not appear to be intentional.

This means that any libraries that called this method must be updated in order for an application to update to the newest version of Koin, or they get the following error:
NoSuchMethodError: org.koin.core.KoinWaitExtKt.runOnKoinStarted(...)

To Reproduce

  1. Library A is compiled against Koin 4.1 & calls runOnKoinStarted
  2. Application B upgrades to Koin 4.2

Expected behavior
There is no crash!

Koin module and version:
koin-core-coroutines:4.1.1
koin-core-coroutines:4.2.0

Solution?
I am unsure if the following works when the two files are spread across source-sets.
But you should be able to mark each file with @file:JvmName("KoinWaitExtKt") and @file:JvmMultifileClass

Of course, ABI breakages are extra-painful, as fixing it post-release is inherently another breaking change.
(Unless you keep both symbols in place)

As such, I'm more interested in if you have considered applying the binary compatibility validator plugin.
Either the standalone version, or the built in version.

This will avoid accidental ABI breakage, and ensure that it only happens intentionally!
Hopefully avoiding this issue in the future.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions