@@ -48,9 +48,6 @@ published should not limit its evolution in the future.
48
48
49
49
- Drew Crawford is concerned about inlineable code breaking modularity;
50
50
you can't just release a new dylib to fix a bug.
51
- - David Owens wants it to be clearer that this document doesn't really
52
- cover behavior changes and proper semantic versioning, just binary
53
- compatibility.
54
51
55
52
56
53
Introduction
@@ -69,6 +66,23 @@ This document will frequently refer to a *library* which vends public APIs, and
69
66
a single *client * that uses them. The same principles apply even when multiple
70
67
libraries and multiple clients are involved.
71
68
69
+ This document is primarily concerned with `binary compatibility `, i.e. what
70
+ changes can safely be made to a library between releases that will not break
71
+ memory-safety or type-safety, or cause clients to fail to run at all. A
72
+ secondary concern is identifying `binary-compatible source-breaking changes
73
+ <binary-compatible source-breaking change> `, where clients compiled against the
74
+ previous version of a library are likely to behave differently than clients
75
+ compiled against the new version of the library.
76
+
77
+ .. note ::
78
+
79
+ These rules do not (and cannot) guarantee that a change is *semantically *
80
+ backwards-compatible or forwards-compatible. *Any * change to a library's
81
+ existing API that affects its observable behavior may affect clients. It is
82
+ the responsibility of a library author to be sure that the changes they are
83
+ making are *semantically * correct, preserving the preconditions,
84
+ postconditions, and invariants of previously-published APIs.
85
+
72
86
This model is largely not of interest to libraries that are bundled with their
73
87
clients (distribution via source, static library, or embedded/sandboxed dynamic
74
88
library, as used by the `Swift Package Manager `_). Because a client always uses
@@ -177,11 +191,6 @@ library (barring their own availability checks), since the entire library is
177
191
shipped as a unit. That is, even if a particular API was introduced in v1.0,
178
192
its (non-public) implementation may refer to APIs introduced in later versions.
179
193
180
- Swift libraries are strongly encouraged to use `semantic versioning `_, but this
181
- is not enforced by the language.
182
-
183
- .. _semantic versioning : http://semver.org
184
-
185
194
Certain uses of ``internal `` entities require them to be part of a library's
186
195
binary interface, which means they need to be versioned as well. See
187
196
`Versioning Internal Declarations `_ below.
0 commit comments