Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can minor version update be used to minor update transitive dependencies?

Lets say I create a binary compatible update of my library foo from version 1.0.0 to 1.0.1. Library foo is published via Maven.

Can I use this minor version update to bump at the same time the minor versions of the dependencies of foo? For example, version 1.0.0 was using scalaVersion := "2.10.1". Can I change that to scalaVersion := "2.10.3" in foo 1.0.1, or will that cause trouble?

Assume that I use foo in another project as

"mygroup" %% "foo" % "1.0.+"
like image 750
0__ Avatar asked Jan 30 '14 10:01

0__


People also ask

How do you update transitive dependency version in flutter?

8 transitive dev_dependencies: all up-to-date 1 upgradable dependency is locked (in pubspec. lock) to an older version. To update it, use `dart pub upgrade`. 1 dependency is constrained to a version that is older than a resolvable version.

Can minor versions have breaking changes?

Major versions contain breaking changes. Minor versions add new features or deprecate existing features without breaking changes. Patch versions fix defects or optimize existing features without breaking changes.

How do you find transitive dependency?

If A, B, and C are attributes of relation R, such that A → B, and B → C, then C is transitively dependent on A, unless either B or C is a candidate key or part of a candidate key. Equivalently, a transitive dependency exists when a nonprime attribute determines another nonprime attribute.


2 Answers

There are several considerations involved, but generally yes, you can change the versions of dependencies if they are binary compatible. The Scala team aims for 2.10.x releases to be binary compatible. You can compile against Scala 2.10.1 and use 2.10.3 at runtime.

You can generally do the reverse for the Scala library as long as you use methods and types that are present in both. Most libraries aren't concerned with this direction, though. Other caveats on binary compatibility:

  • Different libraries have different policies on what version bumps mean.
  • Libraries may or may not have automation to check binary compatibility.
  • Automation like MiMa (used by Scala) does not catch all kinds of incompatibilities. For example, MiMa only catches "syntactic" incompatibilities (ones that throw LinkageErrors at runtime).
  • Binary compatibility does not imply source compatibility.

It is not generally recommended to use dynamic revisions like "1.0.+", however. They make reproducing builds harder as well as affecting resolution speed.

like image 62
Mark Harrah Avatar answered Sep 22 '22 10:09

Mark Harrah


Generally modern software follows semantic versioning

Given a version number MAJOR.MINOR.PATCH, increment the:

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" is to be compatible with any "2.10.x" version.

Usually we should not care about .PATCH part, except for cases when a bug affecting our code was fixed. And I guess that is the case.

like image 33
Paul Verest Avatar answered Sep 21 '22 10:09

Paul Verest