Project

General

Profile

Make a new release » History » Version 61

pespin, 05/03/2018 12:22 PM
Refactor text and add information about version systems for libraries

1 22 msuraev
{{>toc}}
2
3 2 neels
h1. Make a new release
4 1 neels
5 13 msuraev
The efforts to automate the release process are tracked in https://projects.osmocom.org/issues/1861
6
7 17 msuraev
h2. When to make a new release
8 1 neels
9 16 msuraev
Various Osmocom projects depend on others.
10 1 neels
11 28 msuraev
*Proposed policy:*
12 16 msuraev
* master branch is expected to depend on latest master branches of depended-upon projects
13 24 msuraev
* make release of depended-upon projects if necessary before making non-library project release
14
* make sure that we have correct version dependencies before making non-library project release
15 1 neels
16 41 msuraev
Alternatively/additionally we can make timely releases of non-library projects (and corresponding depended-upon libraries):
17
* once per XX months?
18
* before every OsmoDevCon?
19 46 msuraev
* once YY items accumulated in TODO-RELEASE file(see [[Make_a_new_release#TODO-RELEASE-file-format-and-maintenance|TODO-RELEASE file format]])
20 41 msuraev
* when configuration/db format changes?
21
22
This would help to avoid batching too many changes together and to adhere to RERO better - see http://scalare.org/wp-content/uploads/2015/06/2015-Why-and-HowShould-OpenSource-ProjectsAdopt-Time-Based-Releases.pdf
23 20 msuraev
24 61 pespin
h2. Versioning considerations for libraries
25 1 neels
26 61 pespin
Every osmocom library is built using libtool's version-info system. This system format and algorithm to update the versions is documented in https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info.
27 1 neels
28 61 pespin
However, debian packaging system follows a different versioning convention, but conveniently the debian versioning system can be deduced from libtool's version-info. More information can be found in: https://autotools.io/libtool/version.html
29
Specially interesting is the warning section:
30
<pre>
31
 A common mistake is to assume that the three values passed to -version-info map directly into the three numbers at the end of the library name. This is not the case, and indeed, current, revision and age are applied differently depending on the operating system that one is using.
32
For Linux, for instance, while the last two values map directly from the command-line, the first is calculated by subtracting age from current. On the other hand, on modern FreeBSD, only one component is used in the library version, which corresponds to current. 
33
</pre>
34 1 neels
35 61 pespin
More related information on the version translation procedure can be found here:
36
https://github.com/haskell/cabal/issues/4052#issuecomment-258044949
37
https://stackoverflow.com/questions/36734105/how-is-the-version-number-in-library-names-generated
38 52 pespin
39 61 pespin
Summary: For libtool's system @current:revision:age@, it gets translated into version number @major.age.revision@, where @major=current-age@, reflecting the fact that ABIs can be backwards compatible. Debian uses @major@ to generate the package name.
40
41
h2. osmocom-release.mk
42
43
The @osmo-release.mk@ helper (installed by @libosmocore-dev@) available via @make release@ takes care of
44
45 35 msuraev
* version bump
46 57 pespin
* debian/changelog update
47
* commit
48 1 neels
* sign
49 57 pespin
* tag
50 1 neels
51
Feel free to send patches implementing further automation as you see fit.
52
53
You can alternatively run osmo-release.mk directly from your git repo in /foo/bar/libosmocore by using:
54
@PATH="$PATH:/foo/bar/libosmocore" make REL=minor release --include-dir="/foo/bar/libosmocore"@
55
56 61 pespin
h3. Dependencies
57 1 neels
58 61 pespin
The @osmo-release.mk@ requires several extra dependencies. Make sure you have them installed in your system:
59
* bumpversion
60
* git-buildpackage
61
* devscripts
62
63
h3. TODO-RELEASE file format and maintenance
64
65
* all the strings which contain @#@ considered comment and will be ignored
66
* actual entries consists of 3 tab-separated fields:
67
# library - name of the library affected (should correspond to @lib*.pc.in@ file in project's root directory)
68
# what - API or ABI change (used as a guidance to properly bump @*_LIBVERSION@)
69
# description - textual description (will end up in changelog)
70
71
When change affecting library's API/ABI is made then new entry should be added to TODO-RELEASE according to the format above. The file will be claned-up automatically by @make release@ command.
72
73
h2. How to make a new release
74
75
First we outline specific steps for different project types, then common part.
76
77
h3. Extra steps for Libraries
78
79
Some extra previous steps are required if the project installs a public shared library.
80
81 59 pespin
* modify @*_LIBVERSION@ in @src/Makefile.am@ as necessary according to TODO-RELEASE file
82 61 pespin
* if necessary ("current/age" component of @*_LIBVERSION@ was bumped) then rename @debian/lib*.install@ to match the change. See [[Make_a_new_release#Versioning-considerations-for-libraries|Versioning considerations for libraries]].
83 30 msuraev
* if necessary (any of @debian/lib*.install@ were renamed) then adjust @debian/control@ accordingly
84 32 msuraev
85 30 msuraev
The release helper is trying to be smart about it and prevent making new library release with non-empty TODO-RELEASE file if @*_LIBVERSION@ is not adjusted beforehand.
86
87 61 pespin
h3. Release steps
88 1 neels
89 44 msuraev
By default @make release@ prepares 'patch' release but you can manually specify any of 'major/minor/patch' as necessary - see http://semver.org/ for details.
90
91
* Add changelog entries for the new version in @TODO-RELEASE@, they will be populated into @debian/changelog@ by @osmo-release.sh@.
92
* @make REL=minor release@
93
* inspect the latest commit which was just created
94
* adjust it if necessary and re-sign (see [[Make_a_new_release#How-to-retag-a-new-release|Re-tag new release]])
95
* push commit for review using @git review -f@ (see [[Gerrit]] for alternatives)
96
* push the release tag by @git push gerrit --tags@
97
* consider preparing article for https://osmocom.org/news/ and sending announcement to appropriate ML for major release once release commit passed the review
98 45 msuraev
99
h2. Which new release to make
100
101
Use following guidelines when choosing release type:
102
* major - ?? TBD
103
* minor - ?? TBD
104 43 msuraev
* patch - ?? TBD
105 1 neels
106 43 msuraev
If unsure - ask in corresponding ML.
107
108
h2. Deprecation policy
109
110
Functions/interfaces marked as deprecated for X releases of type Y can be removed in next Z release.
111
112 55 pespin
TBD: what's appropriate value for X? which Y and Z (from major/minor/patch) should we use?
113 43 msuraev
114
h2. How to (re)tag a new release
115
116 47 msuraev
This might be necessary if previous release was made manually with some mistakes which have to be corrected and amended to the release commit.
117
118 36 msuraev
<pre>
119
git tag -s 0.4.0 -f -m "Release v0.4.0 on 2017-08-25."
120
</pre>
121 30 msuraev
122
This will automatically (re)sign the latest commit. You can specify which commit to sign explicitly.
123 3 neels
124 1 neels
Say, for example, the git hash is @012342abcdefg@ and the next open version is 0.1.3:
125 9 neels
<pre>
126 1 neels
git tag -s 0.1.3 012342abcdefg -m "release 0.1.3"
127
</pre>
128 8 neels
129 1 neels
(If @gpg@ complains, see [[Make a new release#GPG-Have-a-matching-user-id|GPG: Have a matching user id]].)
130 4 neels
131 1 neels
Verify that git picks up the new version tag:
132
<pre>
133
$ git describe
134
0.1.3-3-g1f95179
135
</pre>
136 11 neels
137 42 msuraev
N. B: *For your local build, _nothing will change_ until you delete the @.version@ file and completely rebuild:*
138 1 neels
139
<pre>
140 10 neels
rm .version
141
autoreconf -fi
142 1 neels
./configure
143
make
144
cat .version
145
</pre>
146
147
This should show the same as @git describe@.
148
149
When you're convinced that all is in order, push the new tag:
150
151
<pre>
152
git push origin 0.1.3
153
</pre>
154 14 neels
155 1 neels
If anything went wrong, you can delete the tag (locally) by
156 15 msuraev
<pre>
157 42 msuraev
git tag -d 0.1.3
158
</pre>
159
and, if you've already pushed it, by
160
<pre>
161
git push --delete origin 0.1.3
162
</pre>
163 1 neels
164
h2. GPG: Have a matching user id
165
166
By default, @git tag -s@ takes your author information to lookup the secret GPG key to sign a tag with.
167
If the author+email do not exactly match one of the key's @uid@s, you will get this error:
168
169
<pre>
170
gpg: signing failed: secret key not available
171
</pre>
172
173
Verify: say, your author+email info in your git config says "John Doe <john@doe.net>", try
174
<pre>
175
gpg --list-secret-keys "John Doe <john@doe.net>"
176
</pre>
177
If this fails, GPG won't find the right key automatically.
178
179
Ways to resolve:
180
181
* Use @git tag -u <key-id>@
182
* Edit your secret key to add a uid that matches your author information
183
<pre>
184
gpg --edit-key john@doe.net
185
gpg> adduid
186
# enter details to match the git author
187
gpg> save
188
</pre>
189 56 pespin
190
h2. Dependency graph
191
192
This section aims at providing a dependency graph of the osmocom cellular network infrastructure projects in case a cascade of releases is intended:
193
194
{{graphviz_link()
195
digraph G {
196
    libas1nc -> {osmo_iuh, osmo_msc, openbsc};
197
    libsmpp34 -> {osmo_msc, openbsc};
198
    libgtpnl -> {osmo_ggsn};
199
    libosmocore -> {libosmo_abis, libosmo_netif, libosmo_sccp, osmo_iuh, osmo_ggsn, osmo_sgsn, osmo_mgw, osmo_msc, osmo_hlr, osmo_bsc, osmo_bts, osmo_pcu, osmo_trx, openbsc};
200 60 pespin
    libosmo_abis -> {libosmo_netif, osmo_sgsn, osmo_msc, osmo_hlr, osmo_bsc, osmo_bts, openbsc};
201 56 pespin
    libosmo_netif -> {libosmo_sccp, osmo_iuh, osmo_sgsn, osmo_mgw, osmo_msc, osmo_bsc, openbsc};
202
    libosmo_sccp -> {osmo_iuh, osmo_sgsn, osmo_msc, osmo_bsc, openbsc};
203
    osmo_iuh -> {osmo_msc, openbsc};
204
    osmo_ggsn -> {osmo_sgsn};
205
    osmo_mgw -> {osmo_msc, osmo_bsc};
206
}
207
}}
Add picture from clipboard (Maximum size: 48.8 MB)