-
Notifications
You must be signed in to change notification settings - Fork 66
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
Adds the binary compatibility validator plugin #938
Conversation
…ctions, which is fine, and GenericColumn, from the compiler plugin
@@ -5,6 +5,7 @@ plugins { | |||
alias(kover) | |||
alias(ktlint) | |||
alias(jupyter.api) | |||
alias(binary.compatibility.validator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's disable for a while
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From other hand, it's just a check and could help to discover stuff, which should be documented!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't hurt to add it, right? It will just inform you when you make a binary breaking change, after which you can call apiDump
, commit the result and the error goes away. But most importantly it makes you aware of the changes that we'll need to inform our users about for the next release.
Fixes #634 by adding https://github.com/Kotlin/binary-compatibility-validator
See the individual commits for all checks. I started by adding the
.api
files built using the 0.14.1 release branch, to see whether we already made changes to the API.This correctly showed me:
GenericColumn
from Revert insertGenericTreeImpl #923, which probably won't cause issues as it was just used from the compiler pluginThe plugin automatically runs when
check
orbuild
runs, so that's nice :) I added it only to the public modules, skipping the examples, plugins, etc.When updating the public API we'll need to try to keep binary compatibility as best as possible, resorting to deprecating old functions instead of just removing/changing them. And if we introduce a breaking change, we'll need to inform the users in the release notes and run
apiDump
to overwrite the .api files.A non-breaking change would be a
+
in the API check, this means we simply add another function or overload. A breaking change would be a-
. Those will causeNoSuchMethodError
s when called from an older version:For more information, check https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html
Hint: Sometimes
DeprecationLevel.HIDDEN
can help to remove a function from the API while keeping it in the bytecode. The Api checker plugin still shows it as a-
, but it can still be called from a compiled library, avoiding aNoShuchMethodError
.