Zhi Han
Zhi Han

Reputation: 133

Sbt plugin binary incompatibility

I am using the sbtantlr plugin and adapting it to use antlr v3.5. It used to work fine with scala 2.9.2.

Today I upgraded my scala to 2.10.0.

And I compiled the plugin in 2.10.0 and put the plugin 'sbtantlr.jar' in the 'lib' directory of my main scala project.

SBT stopped working with this error message:

Binary incompatibility in plugins detected.

I revert the compiler version to 2.9.2 and it works fine.

Is it because SBT (the official binary release) was built with 2.9? Where can I find the information?

Upvotes: 1

Views: 1511

Answers (2)

Daniel C. Sobral
Daniel C. Sobral

Reputation: 297265

To add more information to what Yann said, Scala only guarantees compatibility between minor versions. That is, code compiled with any 2.8.x version is compatible with code compiled with any other 2.8.x version, but no code compiled with 2.8.x is compatible with code compiled by a 2.9.x version.

Now, SBT is a Scala application, and both the plugins and build configuration are libraries to it. SBT 0.12.x was compiled with Scala 2.9.x, so all plugins and project build configuration must also be compiled with Scala 2.9.x.

The project itself can be compiled with any version, as SBT does not need to interact with it.

Upvotes: 2

Yann Ramin
Yann Ramin

Reputation: 33197

Yes, sbt 0.12.x are built with 2.9x and all plugins need to match the binary Scala version.

Upvotes: 4

Related Questions