Project

General

Profile

OBS Maintenance » History » Version 20

osmith, 05/09/2023 11:01 AM
replace outdated "Debian dir doesn't work for multiple debian versions" with new instructions of how to run a script before building the source package

1 3 osmith
h1. OBS Maintenance
2
3 2 osmith
{{>toc}}
4 1 osmith
5
6 14 laforge
The Osmocom [[binary packages]] are built with [[OBS]] (Open Build Service) hosted on "obs.osmocom.org":https://obs.osmocom.org. In order to do that, the jenkins jobs "Osmocom_OBS_latest":https://jenkins.osmocom.org/jenkins/job/Osmocom_OBS_latest_obs.osmocom.org/ / "_nightly":https://jenkins.osmocom.org/jenkins/job/Osmocom_OBS_nightly_obs.osmocom.org/ ("config":https://gitea.osmocom.org/osmocom/osmo-ci/src/branch/master/jobs/osmocom-obs.yml) checkout the source repositories and build debian *source* packages, then upload these to OBS.
7 1 osmith
8
h2. Install osc
9
10
Get the command-line client for managing OBS. When using for the first time, it will ask for the credentials.
11
12
<pre>
13
$ sudo apt install osc
14
$ osc ls
15
</pre>
16
17 15 osmith
h2. Upgrading specific packages
18
19
h3. eclipse-titan
20
21
See the article [[upgrading eclipse-titan in the Osmocom OBS]].
22
23
h3. nftables / libnftnl
24
25 19 osmith
Eventually the nftables version >= 1.0.2 that osmo-upf requires should make it into the distributions we support, at which point we can remove the nftables and libnftnl packages. Until then we build these packages in OBS, this section describes how to upgrad them.
26
27
h4. rpm
28
29 15 osmith
As of writing, the nftables and libnftnl packages from the Osmocom OBS are linked to openSUSE.org:security:netfilter. When the package gets upgraded there, the build will fail in the Osmocom OBS with:
30
31
<pre>
32
[   29s] error: Bad source: /home/abuild/rpmbuild/SOURCES/libnftnl-1.2.4.tar.bz2: No such file or directory
33
</pre>
34
35
That is because the source tarballs get upgraded, but the spec file has differences and so it does not get upgraded automatically.
36
37
Diff the "upstream spec file":https://build.opensuse.org/package/view_file/security:netfilter/libnftnl/libnftnl.spec?expand=1 against the one in the Osmocom OBS and apply the changes, then it should work again.
38
39 16 osmith
<pre>
40
$ $EDITOR /tmp/upstream.spec  # put the upstream spec file here
41
$ mkdir /tmp/obs
42
$ cd /tmp/obs
43
$ osc co osmocom:nightly libnftnl
44
$ cd osmocom:nightly/libnftnl
45
$ diff libnftnl.spec /tmp/upstream.spec
46
$ $EDITOR libnftnl.spec  # apply changes
47
$ diff libnftnl.spec /tmp/upstream.spec  # verify
48
$ osc commit
49
$ rm -rf /tmp/obs
50
</pre>
51 1 osmith
52 16 osmith
Wait until the package has built, then copy it to the other feeds:
53
<pre>
54
$ osc copypac osmocom:nightly libnftnl osmocom:latest
55
$ osc copypac osmocom:nightly libnftnl osmocom:master
56
</pre>
57 1 osmith
58 19 osmith
h4. deb
59
60
<pre>
61
$ mkdir /tmp/obs
62
$ cd /tmp/obs
63
$ osc co osmocom:nightly libnftnl-deb
64
$ cd osmocom:nightly/libnftnl-deb
65
$ osc del *
66
</pre>
67
68
Download the debian "source package files":https://packages.debian.org/source/sid/libnftnl into the directory and add them.
69
70
<pre>
71
$ osc add *
72
$ osc commit -m "upgrade to 1.25"
73
$ rm -rf /tmp/obs
74
</pre>
75
76
Wait until the package has built, then copy it to the other feeds (see rpm).
77 15 osmith
78 1 osmith
h2. Workflow for testing OBS configurations
79
80 4 osmith
OBS has a "project configuration":https://en.opensuse.org/openSUSE:Build_Service_prjconf, which may need to be adjusted to state preferred dependencies for example. Before we apply project configurations to the official Osmocom OBS projects, we can test them in our own OBS project. Copy the relevant package first (adjust the username accordingly in all following examples):
81 1 osmith
82
<pre>
83 11 laforge
$ osc copypac osmocom:nightly osmo-gsm-manuals home:osmith42
84 1 osmith
</pre>
85
86
Visit the site in your browser:
87 10 osmith
* https://obs.osmocom.org/package/show/home:osmith42/osmo-gsm-manuals
88 1 osmith
89
Set up build targets:
90 10 osmith
* https://obs.osmocom.org/project/add_repository_from_default_list/home:osmith42
91 1 osmith
92
The package should get added to the queue already.
93
94
Open your project config next to the osmocom:nightly one:
95 10 osmith
* https://obs.osmocom.org/project/prjconf/home:osmith42
96 11 laforge
* https://obs.osmocom.org/project/prjconf/osmocom:nightly
97 1 osmith
98
First copy everything from the Osmocom project over to your own project. Then make changes to your config, until the builds are working as expected (dependency problems are resolved etc.). Whenever you change the config, OBS will immediately re-evaluate the build dependencies, no need to upload the source packages again.
99
100
When everything works as expected, copy the config changes you have made to the Osmocom project (nightly and latest).
101
102 12 laforge
Note that changing osmocom's project config did not seem to have any effect. It seems that we really must change both @osmocom:nightly@ and @osmocom:latest@ instead.
103 1 osmith
104
h2. Workflow for modifying packages
105
106
h3. (Optional) modify the debian dir
107
108
* clone the source git repository
109
* make changes to the debian dir
110
* commit your changes
111
* push to a "user/..." branch
112
113
h3. Build source packages and upload to your own OBS project
114
115
* clone osmo-ci.git
116 13 laforge
* open "osmo-nightly-packages.sh":https://gitea.osmocom.org/osmocom/osmo-ci/src/branch/master/scripts/osmocom-nightly-packages.sh
117 1 osmith
* if you intend to make changes to the script, do them and commit the changes
118
* change "PROJ":https://git.osmocom.org/osmo-ci/tree/scripts/osmocom-nightly-packages.sh?id=dc5fc51c1fa76e64db774ecb9e71fc25ad6c46cd#n10 to home:USERNAME
119
* if you made changes to the debian dir, insert your branch name after the related "checkout line":https://git.osmocom.org/osmo-ci/tree/scripts/osmocom-nightly-packages.sh?id=dc5fc51c1fa76e64db774ecb9e71fc25ad6c46cd#n172 (e.g. <code>checkout osmo-gsm-manuals osmith/some-random-change</code>)
120
* run osmocom-nightly-packages.sh
121
* check in your browser if all packages have been built by OBS as expected (iterate until you get everything right)
122
123
When everything works fine, contribute your patches with [[Gerrit]] as usually.
124
125
h2. Troubleshooting
126
127 20 osmith
h3. A script must run before building the source package (to download dependencies etc.)
128 1 osmith
129 20 osmith
Add a <code>prepare_project_</code> function to <code>scripts/obs/lib/srcpkg.py</code> in <code>osmo-ci.git</code>. See the existing functions there for reference.
130
131 1 osmith
132
h3. Package is not resolvable
133
134
<pre>
135
have choice for jadetex needed by docbook-utils: jadetex texlive-formats-extra
136
</pre>
137
138
You'll need to adjust the OBS project configuration (mind the testing workflow above):
139
<pre>
140
Prefer: texlive-htmlxml
141
</pre>
142
143 8 osmith
h3. Reproduce the nightly builds locally
144
145
<pre>
146
$ osc co
147
$ osc build
148
</pre>
149 1 osmith
150 9 osmith
h2. E-Mail Notifications of build failures
151
152
Build failure notifications are sent to the "gerrit-log mailing list":https://lists.osmocom.org/mailman/listinfo/gerrit-log
153
154 1 osmith
h2. See also
155
156
* https://en.opensuse.org/Portal:Build_Service
157
* https://en.opensuse.org/openSUSE:Build_Service_prjconf
Add picture from clipboard (Maximum size: 48.8 MB)