Can a minor version update be used for minor transition dependency updates?

Let's say I'm creating a binary compatible update to my foo library from version 1.0.0 to 1.0.1 . The foo library is published through Maven.

Can I use this minor version update to simultaneously affect minor versions of foo dependencies? For example, version 1.0.0 used scalaVersion := "2.10.1" . Can I change this to scalaVersion := "2.10.3" in foo 1.0.1, or will this cause problems?

Suppose I use foo in another project as

 "mygroup" %% "foo" % "1.0.+" 
+6
source share
2 answers

There are several considerations, but usually yes, you can change the dependency versions if they are compatible with binary files. The Scala team aims to ensure that versions 2.10.x are compatible with binary files. You can compile with Scala 2.10.1 and use 2.10.3 at runtime.

You can usually backtrack the Scala library as long as you use the methods and types present in both. However, most libraries are not interested in this direction. Other binary compatibility disclaimers:

  • Different libraries have different policies regarding what versions mean.
  • Libraries may or may not have automation to check binary compatibility.
  • Automation, such as MiMa (used by Scala), does not catch all kinds of incompatibilities. For example, MiMa only catches "syntactic" incompatibilities (those that throw a LinkageError at run time).
  • Binary compatibility does not imply source compatibility.

Usually it is not recommended to use dynamic changes, for example "1.0. +". They make assembly more complex and also affect resolution.

+6
source

Typically, modern software follows semantic version control

Given the version number of MAJOR.MINOR.PATCH, increase the value:

 MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes. 

So "2.10.3" should be compatible with any version of "2.10.x" .

Usually we should not care about the .PATCH part, unless the bug affecting our code has been fixed. And I guess that is so.

+2
source

All Articles