2.13.x migration and source compatibility

Some additional feedback from the perspective of maintaining a cross-built library. Scodec is currently cross-built for 2.10, 2.11, and 2.12. Scodec uses CanBuildFrom in a few places in order to abstract over the type of collection that’s built.

The scala-collection-compat library lets us maintain a single code base and cross-build for 2.11, 2.12, and 2.13, but doing so breaks binary compatibility with previously released versions. Here’s what this looks like for scodec: https://github.com/scodec/scodec/pull/119/files

Keeping binary compatibility can be accomplished by maintaining separate source files for 2.13 like Kenji did here: https://github.com/xuwei-k/scodec/commit/84e5f307bd1f36a2d0f3e4690a3331e8356a6091 This is pretty tricky though, and results in the 2.13 version of scodec having it’s own CanBuildFrom.

Any advice appreciated.

1 Like