Debian Codegraph @

Documentation/versioning.md

raw
1 # Overall Package Version
2
3 This version number is set in the top level CMakeLists.txt:
4
5 ```sh
6 set(PACKAGE_VERSION "11")
7 ```
8
9 For upstream releases this is a single integer showing the release
10 ordering. We do not attempt to encode any 'ABI' information in this version.
11
12 Branched stabled releases can append an additional counter e.g. `11.2`.
13
14 Unofficial releases should include a distributor tag, e.g. '11.vendor2'.
15
16 When the PACKAGE_VERSION is changed, the packaging files should be updated:
17
18 ```diff
19 diff --git a/CMakeLists.txt b/CMakeLists.txt
20 index a2464ec5..cf237904 100644
21 --- a/CMakeLists.txt
22 +++ b/CMakeLists.txt
23 @@ -44,7 +44,7 @@ endif()
24 set(PACKAGE_NAME "RDMA")
25
26 # See Documentation/versioning.md
27 -set(PACKAGE_VERSION "15")
28 +set(PACKAGE_VERSION "16")
29 # When this is changed the values in these files need changing too:
30 # debian/libibverbs1.symbols
31 # libibverbs/libibverbs.map
32 diff --git a/redhat/rdma-core.spec b/redhat/rdma-core.spec
33 index cc0c3ba0..62334730 100644
34 --- a/redhat/rdma-core.spec
35 +++ b/redhat/rdma-core.spec
36 @@ -1,5 +1,5 @@
37 Name: rdma-core
38 -Version: 15
39 +Version: 16
40 Release: 1%{?dist}
41 Summary: RDMA core userspace libraries and daemons
42
43 diff --git a/suse/rdma-core.spec b/suse/rdma-core.spec
44 index 76ca7286..a19f9e01 100644
45 --- a/suse/rdma-core.spec
46 +++ b/suse/rdma-core.spec
47 @@ -19,7 +19,7 @@
48 %bcond_without systemd
49 %define git_ver %{nil}
50 Name: rdma-core
51 -Version: 15
52 +Version: 16
53 Release: 0
54 Summary: RDMA core userspace libraries and daemons
55 License: GPL-2.0 or BSD-2-Clause
56
57 ```
58
59 # Shared Library Versions
60
61 The shared libraries use the typical semantic versioning scheme, e.g.
62 *libibumad* has a version like `3.1.11`.
63
64 The version number is broken up into three fields:
65 - '3' is called the SONAME and is embedded into the ELF:
66 ```sh
67 $ readelf -ds build/lib/libibumad.so.3.1.11
68 0x000000000000000e (SONAME) Library soname: [libibumad.so.3]
69 ```
70
71 We do not expect this value to ever change for our libraries. It indicates
72 the overall ABI; changing it means the library will not dynamically link
73 to old programs anymore.
74
75 - '1' is called the ABI level and is used within the ELF as the last component
76 symbol version tag. This version must be changed every time a new symbol
77 is introduced. It allows the user to see what version of the ABI the
78 library provides.
79
80 - '11' is the overall release number and is copied from `PACKAGE_VERSION` This
81 version increases with every package release, even if the library code did
82 not change. It allows the user to see what upstream source was used to build
83 the library.
84
85 This version is encoded into the filename `build/lib/libibumad.so.3.1.11` and
86 a symlink from `libibumad.so.3` to `build/lib/libibumad.so.3.1.11` is created.
87
88 ## Shared Library Symbol Versions
89
90 Symbol versions are a linker technique that lets the library author provide
91 two symbols with different ABIs that have the same API name. The linker
92 differentiates the two cases internally. This allows the library author to
93 change the ABI that the API uses. This project typically does not make use of
94 this feature.
95
96 As a secondary feature, the symbol version is also used by package managers
97 like RPM to manage the ABI level. To make this work properly the ABI level
98 must be correctly encoded into the symbol version.
99
100 ## Adding a new symbol
101
102 First, increase the ABI level of the library. It is safe to re-use the ABI
103 level for multiple new functions within a single release, but once a release
104 is tagged the ABI level becomes *immutable*. The maintainer can provide
105 guidance on what ABI level to use for each series.
106
107 ```diff
108 rdma_library(ibumad libibumad.map
109 # See Documentation/versioning.md
110 - 3 3.1.${PACKAGE_VERSION}
111 + 3 3.2.${PACKAGE_VERSION}
112 ```
113
114 Next, add your new symbol to the symbol version file:
115
116 ```diff
117 + IBUMAD_3.2 {
118 + global:
119 + umad_new_symbol;
120 + } IBUMAD_1.0;
121 ```
122
123 NOTE: Once a release is made the stanzas in the map file are *immutable* and
124 cannot be changed. Do not add your new symbol to old stanzas.
125
126 The new symbol should appear in the ELF:
127
128 ```sh
129 $ readelf -s build/lib/libibumad.so.3.1.11
130 35: 00000000000031e0 450 FUNC GLOBAL DEFAULT 12 umad_new_symbol@@IBUMAD_3.2
131 ```
132
133 Finally update the `debian/libibumad3.symbols` file.
134
135 ## Private symbols in libibverbs
136
137 Many symbols in libibverbs are private to rdma-core, they are being marked in
138 the map file using the IBVERBS_PRIVATE_ prefix.
139
140 For simplicity, there is only one version of the private symbol version
141 stanza, and it is bumped whenever any change (add/remove/modify) to any of the
142 private ABI is done. This makes it very clear if an incompatible provider is
143 being used with libibverbs.
144
145 Due to this there is no reason to provide compat symbol versions for the
146 private ABI.
147
148 When the private symbol version is bumped, the packaging files should be updated:
149
150 ```diff
151 diff --git a/debian/control b/debian/control
152 index 642a715e..8def05c9 100644
153 --- a/debian/control
154 +++ b/debian/control
155 @@ -138,7 +138,7 @@ Section: libs
156 Pre-Depends: ${misc:Pre-Depends}
157 Depends: adduser, ${misc:Depends}, ${shlibs:Depends}
158 Recommends: ibverbs-providers
159 -Breaks: ibverbs-providers (<< 16~)
160 +Breaks: ibverbs-providers (<< 17~)
161 Description: Library for direct userspace use of RDMA (InfiniBand/iWARP)
162 libibverbs is a library that allows userspace processes to use RDMA
163 "verbs" as described in the InfiniBand Architecture Specification and
164 ```
165
166 ### Use of private symbols between component packages
167
168 A distribution packaging system still must have the correct dependencies
169 between libraries within rdma-core that may use these private symbols.
170
171 For this reason, the private symbols can only be used by provider libraries and
172 the distribution must ensure that a matched set of provider libraries and
173 libibverbs are installed.