[ADD] host deps: the tools six packages needed and nobody declared
--nodeps means every makedepend must be named here by hand. Seven builds
stopped on one, each naming a different tool: itstool, convert, fig2dev,
asciidoctor, libnsl, python -m build, libbpf, history.
The list was also a lie by omission. libreadline-dev, libncurses-dev,
zlib1g-dev, python3-dev, doxygen, xsltproc, docbook-xsl, elinks and
libcap2-bin were on this VM by hand and never declared. They made the
builds pass here and would fail on a fresh Ubuntu, for reasons that have
nothing to do with s390x.
history.pc is generated rather than copied: our own readline package
ships a correct one, but its libdir names /usr/lib, which on a multiarch
host holds no libhistory. The .pc has to describe THIS host.
Three hooks for what apt cannot buy. systemd asks for an EFI arch s390x
does not have -- and says "python3 is missing modules: elftools", which
sends you to apt for four lines before admitting the real reason.
--- FR ---
--nodeps veut dire que chaque makedepend doit être nommé ici à la main.
Sept compilations se sont arrêtées sur l'une d'elles, chacune désignant
un outil différent : itstool, convert, fig2dev, asciidoctor, libnsl,
python -m build, libbpf, history.
La liste mentait aussi par omission. libreadline-dev, libncurses-dev,
zlib1g-dev, python3-dev, doxygen, xsltproc, docbook-xsl, elinks et
libcap2-bin étaient posés à la main sur cette VM, jamais déclarés. Ils
faisaient passer les compilations ici et auraient échoué sur un Ubuntu
neuf, pour des raisons étrangères à s390x.
history.pc est généré et non copié : notre propre paquet readline en
livre un correct, mais son libdir nomme /usr/lib, qui sur un hôte
multiarch ne contient aucun libhistory. Le .pc doit décrire CET hôte-ci.
Trois crochets pour ce qu'apt n'achète pas. systemd réclame une
architecture EFI que s390x n'a pas — et annonce « python3 is missing
modules: elftools », ce qui envoie chez apt pour quatre lignes avant
d'avouer la vraie raison.
Assisted-by: Claude Opus 5
2026-08-17 01:33:41 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
# systemd: two build options Arch can hold and s390x cannot.
|
|
|
|
|
#
|
|
|
|
|
# Neither is a missing host package -- both are hard errors raised by meson
|
|
|
|
|
# because the PKGBUILD ASKS for something that does not exist on this
|
|
|
|
|
# architecture, so no amount of apt-get makes them go away. The libraries
|
|
|
|
|
# systemd wants (libbpf, clang, libfdisk, libkmod, ...) ARE host packages and
|
|
|
|
|
# belong in install_host_deps, not here.
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
# 1. -Dbootloader=enabled: systemd-boot is EFI, and s390x has no EFI.
|
|
|
|
|
#
|
|
|
|
|
# The message you get is NOT about EFI:
|
|
|
|
|
#
|
|
|
|
|
# systemd/meson.build:1638:19: ERROR: python3 is missing modules: elftools
|
|
|
|
|
#
|
|
|
|
|
# because meson.build:1638 asks for pyelftools with
|
|
|
|
|
# `required : get_option('bootloader')`, and the PKGBUILD set that to enabled.
|
|
|
|
|
#
|
|
|
|
|
# THE TRAP is that this reads like a missing host package, and
|
|
|
|
|
# `apt install python3-pyelftools` looks like the fix. It is not. It buys four
|
|
|
|
|
# lines, and then meson.build:1642 says what is really wrong:
|
|
|
|
|
#
|
|
|
|
|
# ERROR: Feature bootloader cannot be enabled: unsupported EFI arch or
|
|
|
|
|
# EFI support is disabled
|
|
|
|
|
#
|
|
|
|
|
# (verified by planting a stub elftools module on PYTHONPATH; without it the
|
|
|
|
|
# EFI message is unreachable, which is why nobody ever sees it first.)
|
|
|
|
|
#
|
|
|
|
|
# meson.build:1627 maps a cpu family to an EFI machine type name -- aa64, arm,
|
|
|
|
|
# loongarch32/64, riscv32/64, x64, ia32 -- and s390x is not in that table, so
|
|
|
|
|
# efi_arch is ''. -Defi is still true; the architecture simply has no EFI.
|
|
|
|
|
# IBM Z boots from an IPL record, there is no ESP for systemd-boot to write
|
|
|
|
|
# into, and no configuration invents one.
|
|
|
|
|
#
|
|
|
|
|
# The cost is the systemd-boot artefacts. bootctl itself is still built and
|
|
|
|
|
# installed -- checked in the install plan -- package_systemd() names neither,
|
|
|
|
|
# and the arch.conf/loader.conf/splash-arch.bmp it ships are `install`ed from
|
|
|
|
|
# $srcdir rather than built. Packaging is untouched. Disabling also drops the
|
|
|
|
|
# pyelftools requirement in the same line.
|
|
|
|
|
sed -i 's/-Dbootloader=enabled/-Dbootloader=disabled/' PKGBUILD
|
|
|
|
|
grep -q -- '-Dbootloader=disabled' PKGBUILD || {
|
|
|
|
|
echo "systemd: bootloader option not rewritten" >&2; exit 1; }
|
|
|
|
|
echo "systemd: bootloader disabled (s390x has no EFI machine type)"
|
|
|
|
|
|
|
|
|
|
# 2. -Dvmlinux-h=provided: the file Arch points at is an Arch file.
|
|
|
|
|
#
|
|
|
|
|
# src/bpf/meson.build: error('Path to provided vmlinux.h does not exist.')
|
|
|
|
|
#
|
|
|
|
|
# Arch's linux-headers ships /usr/src/linux/vmlinux.h, the path hard-coded in
|
|
|
|
|
# the PKGBUILD. Ubuntu's linux-headers-* ship no vmlinux.h anywhere. This
|
|
|
|
|
# failure only appears AFTER libbpf and clang are installed, because the whole
|
|
|
|
|
# block is skipped while BPF_FRAMEWORK is off -- fixing libbpf uncovers it.
|
|
|
|
|
#
|
|
|
|
|
# systemd's own fallback dumps the header out of the running kernel's BTF,
|
|
|
|
|
# which is what 'generated' selects:
|
|
|
|
|
#
|
|
|
|
|
# bpftool btf dump file /sys/kernel/btf/vmlinux format c
|
|
|
|
|
#
|
|
|
|
|
# Checked on this host: exit 0, 122471 lines, and enum lsm_integrity_type is
|
|
|
|
|
# there at line 15931, so restrict-fsaccess.bpf.c builds rather than being
|
|
|
|
|
# quietly dropped.
|
|
|
|
|
#
|
|
|
|
|
# THE TRAP is that 'auto' would NOT have done this for us. The auto branch
|
|
|
|
|
# generates only when `host_machine.cpu_family() in ['x86_64', 'aarch64']`; on
|
|
|
|
|
# s390x it falls through to "neither provided nor generated" and silently
|
|
|
|
|
# drops the BPF programs that need the header. s390x has to say it out loud.
|
|
|
|
|
#
|
|
|
|
|
# Note the asymmetry this buys: on the 'provided' branch systemd probes the
|
|
|
|
|
# header with cc.compiles() before deciding what to build. On 'generated' it
|
|
|
|
|
# sets have_lsm_integrity_type = true outright. So the build now depends on
|
|
|
|
|
# the BTF of the kernel RUNNING when it starts -- fine on 6.17.0-41, and on an
|
|
|
|
|
# older kernel it turns into a compile error with no fallback.
|
|
|
|
|
#
|
|
|
|
|
# -Dvmlinux-h-path goes with it: 'generated' ignores the value, and leaving a
|
|
|
|
|
# path that resolves to nothing invites the next reader to "repair" it.
|
|
|
|
|
sed -i 's/-Dvmlinux-h=provided/-Dvmlinux-h=generated/' PKGBUILD
|
|
|
|
|
sed -i '/-Dvmlinux-h-path=/d' PKGBUILD
|
|
|
|
|
grep -q -- '-Dvmlinux-h=generated' PKGBUILD || {
|
|
|
|
|
echo "systemd: vmlinux.h still read from a provided path" >&2; exit 1; }
|
|
|
|
|
grep -q -- '-Dvmlinux-h-path' PKGBUILD && {
|
|
|
|
|
echo "systemd: stale vmlinux-h-path left in place" >&2; exit 1; }
|
|
|
|
|
echo "systemd: vmlinux.h generated from /sys/kernel/btf/vmlinux"
|
[FIX] host defaults: apt was deciding what got built
--auto-features enabled turns every auto feature into a requirement, so
installing a tool switches on code that never compiled here. Three of the
fifty host packages did exactly that, and only one failed for the reason
it named.
expat had built clean the day before. asciidoc pulled docbook-utils in as
an automatic dependency; it owns docbook2man, the third name in expat's
find_program list, so docs defaulted ON twenty-nine hours before anything
rebuilt. That tool is the SGML pipeline: on DocBook XML it writes nothing
and still exits 0, and the mv it feeds is what reported the failure. Arch
ships no xmlwf.1 either, so OFF is parity.
systemd's split-bin probes the BUILD host's /usr/sbin. Ubuntu's is a real
directory, so six binaries went where package() does not look -- and
arch-meson's --sbindir is ignored, systemd computes its own.
util-linux needed no option: poman-translate.sh greps po4a for the English
"Discard" and this host answers "Rejet de". The locale belongs to the host,
so it is pinned once on the makepkg line.
--- FR ---
--auto-features enabled fait de chaque fonction « auto » une exigence :
installer un outil active donc du code jamais compilé ici. Trois des
cinquante paquets hôte l'ont fait, et un seul a échoué pour la raison
qu'il annonçait.
expat compilait proprement la veille. asciidoc avait tiré docbook-utils en
dépendance automatique ; il fournit docbook2man, troisième nom de la liste
find_program d'expat, et la doc est passée à ON vingt-neuf heures avant
toute reconstruction. Cet outil est le pipeline SGML : sur du DocBook XML
il n'écrit rien et sort quand même 0, et le mv qu'il alimente est ce qui a
signalé la panne. Arch ne livre pas xmlwf.1 non plus : OFF, c'est la parité.
Le split-bin de systemd sonde le /usr/sbin de la machine de BUILD. Celui
d'Ubuntu est un vrai répertoire, donc six binaires sont partis là où
package() ne regarde pas — et le --sbindir d'arch-meson est ignoré, systemd
calcule le sien.
util-linux n'avait besoin d'aucune option : poman-translate.sh cherche le
« Discard » anglais de po4a, et cet hôte répond « Rejet de ». La locale
appartient à l'hôte : elle est épinglée une fois, sur la ligne makepkg.
Assisted-by: Claude Opus 5
2026-08-17 02:37:46 -04:00
|
|
|
|
|
|
|
|
# 3. -Dsplit-bin=auto: the question is answered by the HOST, not the target.
|
|
|
|
|
#
|
|
|
|
|
# systemd/meson.build:123
|
|
|
|
|
# sbindir = prefixdir / (split_bin ? 'sbin' : 'bin')
|
|
|
|
|
#
|
|
|
|
|
# split-bin is a combo defaulting to 'auto', and 'auto' probes whether
|
|
|
|
|
# /usr/sbin on the BUILD MACHINE is a symlink to bin. On Arch it is, so
|
|
|
|
|
# split_bin is false and everything lands in /usr/bin. Here /usr/sbin is a
|
|
|
|
|
# real directory, and meson-log.txt says so:
|
|
|
|
|
#
|
|
|
|
|
# split bin-sbin : true
|
|
|
|
|
#
|
|
|
|
|
# THE TRAP is that arch-meson ALREADY passes --sbindir bin, and
|
|
|
|
|
# `meson configure` dutifully reports sbindir = bin. It is ignored: systemd
|
|
|
|
|
# computes its own sbindir from split_bin and never reads meson's builtin. The
|
|
|
|
|
# option that looks like the fix is not the fix, and the one that is mentions
|
|
|
|
|
# neither sbin nor a directory in its name.
|
|
|
|
|
#
|
|
|
|
|
# Nothing fails in build(). It fails much later, in package_systemd(), on the
|
|
|
|
|
# first line that names a path:
|
|
|
|
|
#
|
|
|
|
|
# rm: cannot remove '<pkgdir>/usr/bin/halt': No such file or directory
|
|
|
|
|
#
|
|
|
|
|
# because halt, init, poweroff, reboot, shutdown and resolvconf all went to
|
|
|
|
|
# /usr/sbin -- along with mount.ddi, mount.mstack and mount.storage, which the
|
|
|
|
|
# PKGBUILD never mentions at all. The rm is only the first victim. Suppress it
|
|
|
|
|
# and the package ships /usr/sbin as a DIRECTORY, which collides on the target
|
|
|
|
|
# with the ["usr/sbin"]="bin" SYMLINK our own filesystem package declares.
|
|
|
|
|
#
|
|
|
|
|
# Measured on a configured copy: with split-bin=false there is no /usr/sbin in
|
|
|
|
|
# the install tree at all, and all six paths are where package() looks.
|
|
|
|
|
#
|
|
|
|
|
# Same species as arch-meson's --libdir -- an Ubuntu default standing in for
|
|
|
|
|
# an Arch one -- but it cannot live in arch-meson: split-bin is systemd's own
|
|
|
|
|
# option, not a meson builtin. --auto-features does not reach it either; it is
|
|
|
|
|
# a combo, not a feature.
|
|
|
|
|
test "$(grep -c -- '-Dcompat-sysv-interfaces=false' PKGBUILD)" -eq 1 || {
|
|
|
|
|
echo "systemd: expected exactly one _meson_options array" >&2; exit 1; }
|
|
|
|
|
test "$(grep -c -- '-Dsplit-bin' PKGBUILD)" -eq 0 || {
|
|
|
|
|
echo "systemd: PKGBUILD already sets split-bin, re-read it" >&2; exit 1; }
|
|
|
|
|
sed -i 's/^\( *\)-Dcompat-sysv-interfaces=false/\1-Dsplit-bin=false\n\1-Dcompat-sysv-interfaces=false/' PKGBUILD
|
|
|
|
|
grep -q -- '-Dsplit-bin=false' PKGBUILD || {
|
|
|
|
|
echo "systemd: split-bin still auto (would install into /usr/sbin)" >&2; exit 1; }
|
|
|
|
|
echo "systemd: split-bin=false (Ubuntu's /usr/sbin is not Arch's)"
|