version - Does semantic versioning apply to source or binary compatibility? -
this question applies language written in 1 language ("source"), e.g. c or java, , distributed in ("binary"), e.g. machine code or java byte code, using dynamic linking.
suppose user using version of library. release newer version b.
if can compile code without change against b , correctly run b, change b said source compatible.
if can compile code against , correctly run b, change b said binary compatible. situation common when using transitive dependency graphs without isolated module loading (e.g. osgi). x compiled against versions of y , z, , y compiled against different version of z. @ runtime, y's calls z may not correct , may crash.
it possible changes source compatible, binary incompatible. possible changes source incompatible , binary compatible.
which compatibility use semantic versioning? use source compatibility differentiate between major , minor/patch updates, or use binary compatibility differentiate between major , minor/patch updates?
my current motivation scala library. scala binary compatibility can difficult analyze , requires understand of compiler details. source compatibility , binary incompatible common.
this isn't bizarre edge case; problem can appear in compiled, dynamically linked language.
a few months later, think have conclusion.
semantic versioning should consider both, , follow "most changed" one.
- breaking source compilation incompatible change users of library.
- breaking runtime execution incompatible change users of library.
if either source compatibility or binary compatibility changes, should -- according semantic versioning -- new major version.
in case scala, binary compatibility can rather difficult determine. there several jar api diffing tools, e.g. jdiff.
Comments
Post a Comment