Merge ~slyon/ubuntu/+source/systemd:lunar/no-i386-binaries into ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-lunar

Proposed by Lukas Märdian
Status: Needs review
Proposed branch: ~slyon/ubuntu/+source/systemd:lunar/no-i386-binaries
Merge into: ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-lunar
Diff against target: 306 lines (+60/-35)
2 files modified
debian/control (+22/-22)
debian/rules (+38/-13)
Reviewer Review Type Date Requested Status
Luca Boccassi (community) Approve
Nick Rosbrook Pending
Review via email: mp+441353@code.launchpad.net

Description of the change

RFC: reduction of i386 build to a lib-only version

systemd has grown support in its buildsystem (meson) to filter non-executable targets, this should allow us to reduce the footprint of our i386 build. Ubuntu's i386 port is a partial architecture only, and we don't need systemd's executables on this arch, but rather just the (public) libraries, which might be needed by certain consumers.

Context and initial work by @bluca can be found here: https://salsa.debian.org/systemd-team/systemd/-/merge_requests/158

This is a RFC to discuss the next steps on this approach within Ubuntu.

Notes:
* My final commit on the branch ("d/rules: Fix missing files on i386 dh_install") still seems a bit hacky and we should try to avoid this.
* We should analyze the build-depends and filter the ones we don't need for this build, using "[!i386]"

To post a comment you must log in.
Revision history for this message
Lukas Märdian (slyon) wrote :

There's a Bileto PPA, which I want to use to run some autopkgtests for all architectures & reverse-depends:
https://bileto.ubuntu.com/#/ticket/4635
https://bileto.ubuntu.com/excuses/4635/lunar.html
https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/4635/+packages

Revision history for this message
Luca Boccassi (bluca) wrote :

yeah the last change could use some cleanups, for example just do "rm -f" when deleting stuff, rather than || true

Revision history for this message
Lukas Märdian (slyon) wrote :

I pushed the "rm -f" cleanup where possible.

Revision history for this message
Luca Boccassi (bluca) :
Revision history for this message
Lukas Märdian (slyon) wrote :

I've uploaded a new build to the ppa:ci-train-ppa-service/4635 for Mantic.

The ppc64el build fails in the same way the current version in Lunar fails on Mantic (so this seems unrelated):
https://launchpad.net/~slyon/+archive/ubuntu/testing/+sourcepub/14739488/+listing-archive-extra

Some autopkgtests can be found here:
https://autopkgtest.ubuntu.com/results/autopkgtest-mantic-ci-train-ppa-service-4635/?format=plain

i386 reverse depends spot checks are looking good:
(libsystemd0) dbus-broker PASS
(libudev1) bluez PASS

Normal systemd autopkgtests fail the "tests-in-lxd" case, the same way they fail in Mantic, currently (due to missing LXC Mantic images).

The "networkd-test.py" case is known flaky, but it might be worth doing some extra investigation before merging this, as it seems to fail in the PPA but not Mantic, currently (seems unrelated, though):

```
======================================================================
FAIL: test_transient_hostname (__main__.DnsmasqClientTest.test_transient_hostname)
networkd sets transient hostname from DHCP
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/autopkgtest.2wtzSH/build.l2N/src/test/networkd-test.py", line 795, in test_transient_hostname
    self.fail('Transient hostname not found in hostnamectl:\n{}'.format(out.decode()))
AssertionError: Transient hostname not found in hostnamectl:
   Static hostname: (unset)
Transient hostname: autopkgtest
         Icon name: computer-vm
           Chassis: vm 🖴
        Machine ID: f09e8df852cd4964a73ee33c74bb3374
           Boot ID: d4d6db2e77834ef5bb15f4b52ce200b1
    Virtualization: kvm
  Operating System: Ubuntu Mantic Minotaur (development branch)
            Kernel: Linux 6.2.0-21-generic
      Architecture: x86-64
   Hardware Vendor: OpenStack Foundation
    Hardware Model: OpenStack Nova
  Firmware Version: 1.13.0-1ubuntu1.1

======================================================================
FAIL: test_dhcp_timezone (__main__.NetworkdClientTest.test_dhcp_timezone)
networkd sets time zone from DHCP
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/autopkgtest.2wtzSH/build.l2N/src/test/networkd-test.py", line 1015, in test_dhcp_timezone
    self.assertEqual(get_tz(), 'Pacific/Honolulu')
AssertionError: 'Etc/UTC' != 'Pacific/Honolulu'
- Etc/UTC
+ Pacific/Honolulu

----------------------------------------------------------------------
Ran 35 tests in 161.043s

FAILED (failures=2, skipped=3)
autopkgtest [07:16:54]: test networkd-test.py: -----------------------]
autopkgtest [07:16:54]: test networkd-test.py: - - - - - - - - - - results - - - - - - - - - -
networkd-test.py FAIL non-zero exit status 1
```

Revision history for this message
Luca Boccassi (bluca) wrote :

Looks good to me. After Bookworm has shipped, I'm happy to have the d/rules changes merged in Salsa, if you update the MR. Bonus points if you also add a gitlab CI job that exercises this build type, so that we don't accidentally regress.

review: Approve
Revision history for this message
Nick Rosbrook (enr0n) wrote :

FWIW I believe the networkd-test.py failure is caused by building with a newer policykit-1 (like 122-3build1 in -proposed), but running autopkgtest with the older version in -release (0.105-33).

Unmerged commits

d3e31a3... by Lukas Märdian

d/rules: Fix missing files on i386 dh_install

91fa910... by Lukas Märdian

d/control: avoid building i386 binaries

79fadd0... by Lukas Märdian

d/rules: unify ifeq syntax

a11bc13... by Luca Boccassi

d/rules: on Ubuntu/i386 only build and install libraries and EFI binaries

Allow Ubuntu to drop most i386 packages, and only build and install the
public libraries (multiarch builds/installs) and the EFI binaries (for
machines running amd64 CPUs on i386 UEFI).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/control b/debian/control
2index c84c218..f6d06cb 100644
3--- a/debian/control
4+++ b/debian/control
5@@ -75,7 +75,7 @@ Build-Depends: debhelper-compat (= 13),
6 fdisk <!nocheck>,
7
8 Package: systemd
9-Architecture: linux-any
10+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
11 Multi-Arch: foreign
12 Priority: important
13 Recommends: default-dbus-system-bus | dbus-system-bus,
14@@ -122,7 +122,7 @@ Description: system and service manager
15 boot with init=/lib/systemd/systemd or install systemd-sysv in addition.
16
17 Package: systemd-sysv
18-Architecture: linux-any
19+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
20 Multi-Arch: foreign
21 Priority: important
22 Conflicts: sysvinit-core,
23@@ -142,7 +142,7 @@ Description: system and service manager - SysV compatibility symlinks
24
25 Package: systemd-container
26 Build-Profiles: <!stage1>
27-Architecture: linux-any
28+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
29 Multi-Arch: foreign
30 Depends: ${shlibs:Depends},
31 ${misc:Depends},
32@@ -158,7 +158,7 @@ Description: systemd container/nspawn tools
33
34 Package: systemd-journal-remote
35 Build-Profiles: <!stage1>
36-Architecture: linux-any
37+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
38 Multi-Arch: foreign
39 Depends: ${shlibs:Depends},
40 ${misc:Depends},
41@@ -171,7 +171,7 @@ Description: tools for sending and receiving remote journal logs
42
43 Package: systemd-coredump
44 Build-Profiles: <!stage1>
45-Architecture: linux-any
46+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
47 Multi-Arch: foreign
48 Depends: ${shlibs:Depends},
49 ${misc:Depends},
50@@ -186,7 +186,7 @@ Description: tools for storing and retrieving coredumps
51 * coredumpctl
52
53 Package: systemd-timesyncd
54-Architecture: linux-any
55+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
56 Multi-Arch: foreign
57 Priority: standard
58 Depends: ${shlibs:Depends},
59@@ -202,7 +202,7 @@ Description: minimalistic service to synchronize local time with NTP servers
60 synchronize the local system clock with a remote Network Time Protocol server.
61
62 Package: systemd-tests
63-Architecture: linux-any
64+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
65 Depends: ${shlibs:Depends},
66 ${misc:Depends},
67 systemd (= ${binary:Version}),
68@@ -213,7 +213,7 @@ Description: tests for systemd
69 for autopkgtest and not meant to be installed on regular user systems.
70
71 Package: libpam-systemd
72-Architecture: linux-any
73+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
74 Multi-Arch: same
75 Priority: standard
76 Pre-Depends: ${misc:Pre-Depends}
77@@ -234,7 +234,7 @@ Description: system and service manager - PAM module
78 Packages that depend on logind functionality need to depend on libpam-systemd.
79
80 Package: libnss-myhostname
81-Architecture: linux-any
82+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
83 Multi-Arch: same
84 Pre-Depends: ${misc:Pre-Depends}
85 Depends: ${shlibs:Depends},
86@@ -253,7 +253,7 @@ Description: nss module providing fallback resolution for the current hostname
87 Installing this package automatically adds myhostname to /etc/nsswitch.conf.
88
89 Package: libnss-mymachines
90-Architecture: linux-any
91+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
92 Multi-Arch: same
93 Pre-Depends: ${misc:Pre-Depends}
94 Depends: ${shlibs:Depends},
95@@ -268,7 +268,7 @@ Description: nss module to resolve hostnames for local container instances
96 Installing this package automatically adds mymachines to /etc/nsswitch.conf.
97
98 Package: libnss-resolve
99-Architecture: linux-any
100+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
101 Multi-Arch: same
102 Pre-Depends: ${misc:Pre-Depends}
103 Depends: ${shlibs:Depends},
104@@ -282,7 +282,7 @@ Description: nss module to resolve names via systemd-resolved
105 Installing this package automatically adds resolve to /etc/nsswitch.conf.
106
107 Package: libnss-systemd
108-Architecture: linux-any
109+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
110 Multi-Arch: same
111 Priority: standard
112 Pre-Depends: ${misc:Pre-Depends}
113@@ -322,7 +322,7 @@ Description: systemd utility library - development files
114 use libsystemd.
115
116 Package: libsystemd-shared
117-Architecture: linux-any
118+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
119 Multi-Arch: same
120 Section: libs
121 Pre-Depends: ${misc:Pre-Depends}
122@@ -335,7 +335,7 @@ Description: systemd shared private library
123
124 Package: udev
125 Priority: important
126-Architecture: linux-any
127+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
128 Multi-Arch: foreign
129 Pre-Depends: ${misc:Pre-Depends}
130 Depends: ${shlibs:Depends},
131@@ -378,7 +378,7 @@ Package: udev-udeb
132 Build-Profiles: <!noudeb>
133 Package-Type: udeb
134 Section: debian-installer
135-Architecture: linux-any
136+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
137 Depends: ${shlibs:Depends},
138 ${misc:Depends},
139 util-linux-udeb
140@@ -401,7 +401,7 @@ Description: libudev shared library
141 This is a minimal version, only for use in the installation system.
142
143 Package: systemd-standalone-sysusers
144-Architecture: linux-any
145+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
146 Conflicts: systemd-sysusers,
147 systemd (<< 249.3-3)
148 Replaces: systemd-sysusers,
149@@ -415,7 +415,7 @@ Description: standalone sysusers binary for use in non-systemd systems
150 non-systemd systems.
151
152 Package: systemd-standalone-tmpfiles
153-Architecture: linux-any
154+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
155 Conflicts: systemd-tmpfiles,
156 systemd (<< 249.3-3)
157 Replaces: systemd-tmpfiles,
158@@ -429,7 +429,7 @@ Description: standalone tmpfiles binary for use in non-systemd systems
159 non-systemd systems.
160
161 Package: systemd-oomd
162-Architecture: linux-any
163+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
164 Depends: ${shlibs:Depends},
165 ${misc:Depends},
166 Breaks: systemd (<< 250.2-2~)
167@@ -441,7 +441,7 @@ Description: userspace out-of-memory (OOM) killer
168
169 Package: systemd-userdbd
170 Build-Profiles: <!stage1>
171-Architecture: linux-any
172+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
173 Depends: ${shlibs:Depends},
174 ${misc:Depends},
175 systemd (= ${binary:Version}),
176@@ -454,7 +454,7 @@ Description: dynamic user/group manager
177
178 Package: systemd-homed
179 Build-Profiles: <!stage1>
180-Architecture: linux-any
181+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
182 Pre-Depends: ${misc:Pre-Depends},
183 init-system-helpers (>= 1.64~),
184 Depends: ${shlibs:Depends},
185@@ -468,7 +468,7 @@ Description: home area manager
186 directories on user login, tools and documentation.
187
188 Package: systemd-boot
189-Architecture: amd64 i386 arm64 armhf riscv64
190+Architecture: amd64 arm64 armhf riscv64
191 Depends: ${shlibs:Depends},
192 ${misc:Depends},
193 systemd-boot-efi (= ${binary:Version}),
194@@ -502,7 +502,7 @@ Description: simple UEFI boot manager - EFI binaries
195 Package: systemd-resolved
196 Multi-Arch: foreign
197 Priority: important
198-Architecture: linux-any
199+Architecture: amd64 arm64 armhf ppc64el s390x riscv64
200 Pre-Depends: ${misc:Pre-Depends}
201 Depends: ${shlibs:Depends},
202 ${misc:Depends},
203diff --git a/debian/rules b/debian/rules
204index ce2c49f..a3dd3fe 100755
205--- a/debian/rules
206+++ b/debian/rules
207@@ -12,6 +12,19 @@ ifeq ($(DEB_VENDOR),Ubuntu)
208 DEFAULT_NTP_SERVERS = ntp.ubuntu.com
209 SUPPORT_URL = http://www.ubuntu.com/support
210 CONFFLAGS_DISTRO =
211+
212+# On Ubuntu build and install only the libraries and EFI binaries for i386
213+ifeq ($(DEB_HOST_ARCH),i386)
214+# to stop dh_installdoc/dh_manpages/dh_auto_test from running
215+export DEB_BUILD_PROFILES += nodoc nocheck
216+override_dh_auto_build:
217+ dh_auto_build -- systemd-stub systemd-boot libsystemd libudev devel
218+
219+# TODO: in compat 14 we can use dh_auto_install -- --no-rebuild --tags systemd-stub,systemd-boot,libsystemd,libudev,devel
220+override_dh_auto_install:
221+ cd obj-$(DEB_HOST_GNU_TYPE); meson install --no-rebuild --tags systemd-stub,systemd-boot,libsystemd,libudev,devel --destdir ../debian/tmp/
222+endif
223+
224 else
225 DEFAULT_NTP_SERVERS = 0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
226 SUPPORT_URL = https://www.debian.org/support
227@@ -193,7 +206,9 @@ execute_before_dh_install:
228 rm -f debian/tmp/usr/lib/*.d/README
229 rm -f debian/tmp/usr/lib/sysctl.d/50-default.conf
230 rm -f debian/tmp/etc/X11/xinit/xinitrc.d/50-systemd-user.sh
231- rmdir -p --ignore-fail-on-non-empty debian/tmp/etc/X11/xinit/xinitrc.d/
232+ if [ -d debian/tmp/etc/X11/xinit/xinitrc.d/ ]; then \
233+ rmdir -p --ignore-fail-on-non-empty debian/tmp/etc/X11/xinit/xinitrc.d/; \
234+ fi
235 # those files should probably be shipped in a -dev package, remove for now
236 rm -rf debian/tmp/usr/share/dbus-1/interfaces/
237 # remove files related to factory-reset feature
238@@ -204,21 +219,26 @@ execute_before_dh_install:
239 -name etc.conf \) -print -delete
240 rm -rf debian/tmp/usr/share/factory/
241 # replace upstream sysusers.d/basic.conf with proper users for Debian
242- debian/extra/make-sysusers-basic > debian/tmp/usr/lib/sysusers.d/basic.conf
243+ if [ -d debian/tmp/usr/lib/sysusers.d/ ]; then \
244+ debian/extra/make-sysusers-basic > debian/tmp/usr/lib/sysusers.d/basic.conf; \
245+ fi
246 # remove obsolete compat symlink
247 rm -f debian/tmp/usr/bin/systemd-resolve
248
249 execute_after_dh_install:
250 # install standalone binaries
251 for pkg in sysusers tmpfiles; do \
252+ test -f debian/systemd/bin/systemd-$$pkg.standalone || continue; \
253 mkdir -p debian/systemd-standalone-$$pkg/bin; \
254 mv debian/systemd/bin/systemd-$$pkg.standalone debian/systemd-standalone-$$pkg/bin/systemd-$$pkg; \
255 done
256
257 # we don't want /tmp to be a tmpfs by default
258- mv debian/systemd/lib/systemd/system/tmp.mount debian/systemd/usr/share/systemd/
259- printf '\n[Install]\nWantedBy=local-fs.target\n' >> debian/systemd/usr/share/systemd/tmp.mount
260- rm debian/systemd/lib/systemd/system/local-fs.target.wants/tmp.mount
261+ if [ -d debian/systemd/usr/share/systemd/ ]; then \
262+ mv debian/systemd/lib/systemd/system/tmp.mount debian/systemd/usr/share/systemd/; \
263+ printf '\n[Install]\nWantedBy=local-fs.target\n' >> debian/systemd/usr/share/systemd/tmp.mount; \
264+ fi
265+ rm -f debian/systemd/lib/systemd/system/local-fs.target.wants/tmp.mount
266
267 # files shipped by cryptsetup
268 ifeq (, $(filter stage1, $(DEB_BUILD_PROFILES)))
269@@ -226,17 +246,21 @@ ifeq (, $(filter stage1, $(DEB_BUILD_PROFILES)))
270 endif
271
272 # files shipped by systemd
273- rm debian/udev/lib/udev/rules.d/70-uaccess.rules
274- rm debian/udev/lib/udev/rules.d/73-seat-late.rules
275- rm debian/udev/lib/udev/rules.d/71-seat.rules
276- rm debian/udev/lib/udev/rules.d/99-systemd.rules
277+ rm -f debian/udev/lib/udev/rules.d/70-uaccess.rules
278+ rm -f debian/udev/lib/udev/rules.d/73-seat-late.rules
279+ rm -f debian/udev/lib/udev/rules.d/71-seat.rules
280+ rm -f debian/udev/lib/udev/rules.d/99-systemd.rules
281
282 # Ubuntu specific files
283 ifeq ($(DEB_VENDOR),Ubuntu)
284- install -D --mode=644 debian/extra/udev.py debian/udev/usr/share/apport/package-hooks/udev.py
285- install -D --mode=644 debian/extra/systemd.py debian/systemd/usr/share/apport/package-hooks/systemd.py
286- install --mode=644 debian/extra/rules-ubuntu/*.rules debian/udev/lib/udev/rules.d/
287- cp -a debian/extra/units-ubuntu/* debian/systemd/lib/systemd/system/
288+ if [ -d debian/udev/ ]; then \
289+ install -D --mode=644 debian/extra/udev.py debian/udev/usr/share/apport/package-hooks/udev.py; \
290+ install --mode=644 debian/extra/rules-ubuntu/*.rules debian/udev/lib/udev/rules.d/; \
291+ fi
292+ if [ -d debian/systemd/ ]; then \
293+ install -D --mode=644 debian/extra/systemd.py debian/systemd/usr/share/apport/package-hooks/systemd.py; \
294+ cp -a debian/extra/units-ubuntu/* debian/systemd/lib/systemd/system/; \
295+ fi
296 endif
297
298 # Remove unneeded file that produces errors in debugedit (LP: #1950445)
299@@ -250,6 +274,7 @@ execute_after_dh_installman:
300 # run after dh_installman, which runs after dh_install, to include manpages
301 echo "Removing duplicate files in systemd package:"
302 set -e; for pkg in $(shell dh_listpackages -Nudev-udeb -Nlibudev1-udeb -Nsystemd -Nsystemd-standalone-sysusers -Nsystemd-standalone-tmpfiles); do \
303+ (test -d debian/$$pkg/ && test -d debian/systemd/) || continue; \
304 echo "... from $$pkg..."; \
305 (cd debian/$$pkg; find -type f -o -type l) | (cd debian/systemd; xargs rm -f --verbose); \
306 (cd debian/$$pkg; find -mindepth 1 -type d | sort -r) | (cd debian/systemd; xargs rmdir --ignore-fail-on-non-empty --verbose || true); \

Subscribers

People subscribed via source and target branches