1
0
mirror of https://github.com/systemd/systemd synced 2025-10-06 00:13:24 +02:00

mkosi: Stop passing package environment variables to tools image

The tools image is not guaranteed to be the same distribution as the
target distribution and so might have different package environment
variables than the main image yet we currently unconditionally use the
same package environment variables for both of them.

Let's fix this by not passing the package environment variables to the
tools image and subimages anymore, and instead having the main, tools and
build images separately include a config file with the required environment
variables.
This commit is contained in:
Daan De Meyer
2025-04-01 14:57:22 +02:00
parent 9ead378ba0
commit ce68d4349e
19 changed files with 74 additions and 35 deletions

View File

@@ -19,7 +19,7 @@ actions:
post-upstream-clone: post-upstream-clone:
# Use the Fedora Rawhide specfile # Use the Fedora Rawhide specfile
- git clone https://src.fedoraproject.org/rpms/systemd .packit_rpm - git clone https://src.fedoraproject.org/rpms/systemd .packit_rpm
- bash -c 'git -C .packit_rpm checkout "$(grep GIT_COMMIT= mkosi.conf.d/centos-fedora/mkosi.conf | cut -d= -f2)"' - bash -c 'git -C .packit_rpm checkout "$(grep GIT_COMMIT= mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf | cut -d= -f2)"'
- bash -c 'echo "%bcond upstream 1" > .packit_rpm/systemd.spec.new' - bash -c 'echo "%bcond upstream 1" > .packit_rpm/systemd.spec.new'
- bash -c 'echo "%define meson_extra_configure_options --werror" >> .packit_rpm/systemd.spec.new' - bash -c 'echo "%define meson_extra_configure_options --werror" >> .packit_rpm/systemd.spec.new'
- bash -c 'cat .packit_rpm/systemd.spec >> .packit_rpm/systemd.spec.new' - bash -c 'cat .packit_rpm/systemd.spec >> .packit_rpm/systemd.spec.new'

View File

@@ -23,11 +23,6 @@ PassEnvironment=
ASAN_OPTIONS ASAN_OPTIONS
COVERAGE COVERAGE
VCS_TAG VCS_TAG
GIT_URL
GIT_SUBDIR
GIT_BRANCH
GIT_COMMIT
PKG_SUBDIR
[Output] [Output]
RepartDirectories=mkosi.repart RepartDirectories=mkosi.repart

View File

@@ -3,13 +3,6 @@
[Match] [Match]
Distribution=arch Distribution=arch
[Build]
Environment=
GIT_URL=https://gitlab.archlinux.org/archlinux/packaging/packages/systemd.git
GIT_BRANCH=main
GIT_COMMIT=1b4994657df1c7495607f0c2f20db73550b94f34
PKG_SUBDIR=arch
[Content] [Content]
VolatilePackages= VolatilePackages=
systemd systemd

View File

@@ -0,0 +1,11 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Match]
Distribution=arch
[Build]
Environment=
GIT_URL=https://gitlab.archlinux.org/archlinux/packaging/packages/systemd.git
GIT_BRANCH=main
GIT_COMMIT=1b4994657df1c7495607f0c2f20db73550b94f34
PKG_SUBDIR=arch

View File

@@ -4,13 +4,6 @@
Distribution=|centos Distribution=|centos
Distribution=|fedora Distribution=|fedora
[Build]
Environment=
GIT_URL=https://src.fedoraproject.org/rpms/systemd.git
GIT_BRANCH=rawhide
GIT_COMMIT=617952132de4ed882b9b00ceeed077f843130f91
PKG_SUBDIR=fedora
[Content] [Content]
VolatilePackages= VolatilePackages=
systemd systemd

View File

@@ -0,0 +1,12 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Match]
Distribution=|centos
Distribution=|fedora
[Build]
Environment=
GIT_URL=https://src.fedoraproject.org/rpms/systemd.git
GIT_BRANCH=rawhide
GIT_COMMIT=617952132de4ed882b9b00ceeed077f843130f91
PKG_SUBDIR=fedora

View File

@@ -4,14 +4,6 @@
Distribution=|debian Distribution=|debian
Distribution=|ubuntu Distribution=|ubuntu
[Build]
Environment=
GIT_URL=https://salsa.debian.org/systemd-team/systemd.git
GIT_SUBDIR=debian
GIT_BRANCH=debian/master
GIT_COMMIT=d8c7f8f7f461b1edc3bf5040509e697ea574c990
PKG_SUBDIR=debian
[Content] [Content]
VolatilePackages= VolatilePackages=
libnss-myhostname libnss-myhostname

View File

@@ -0,0 +1,13 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Match]
Distribution=|debian
Distribution=|ubuntu
[Build]
Environment=
GIT_URL=https://salsa.debian.org/systemd-team/systemd.git
GIT_SUBDIR=debian
GIT_BRANCH=debian/master
GIT_COMMIT=d8c7f8f7f461b1edc3bf5040509e697ea574c990
PKG_SUBDIR=debian

View File

@@ -9,12 +9,6 @@ Repositories=non-oss
[Build] [Build]
SandboxTrees=macros.db_backend:/etc/rpm/macros.db_backend SandboxTrees=macros.db_backend:/etc/rpm/macros.db_backend
Environment=
GIT_URL=https://github.com/bmwiedemann/openSUSE
GIT_SUBDIR=packages/s/systemd
GIT_BRANCH=master
GIT_COMMIT=9002a773f0ab185908dc8fb6c831c1cd9fdf11f0
PKG_SUBDIR=opensuse
[Content] [Content]
VolatilePackages= VolatilePackages=

View File

@@ -0,0 +1,12 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Match]
Distribution=opensuse
[Build]
Environment=
GIT_URL=https://github.com/bmwiedemann/openSUSE
GIT_SUBDIR=packages/s/systemd
GIT_BRANCH=master
GIT_COMMIT=9002a773f0ab185908dc8fb6c831c1cd9fdf11f0
PKG_SUBDIR=opensuse

View File

@@ -3,6 +3,9 @@
[Match] [Match]
Distribution=arch Distribution=arch
[Include]
Include=%D/mkosi.conf.d/arch/mkosi.conf.d/pkgenv.conf
[Content] [Content]
Packages= Packages=
base base

View File

@@ -4,6 +4,9 @@
Distribution=|centos Distribution=|centos
Distribution=|fedora Distribution=|fedora
[Include]
Include=%D/mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf
[Content] [Content]
Packages= Packages=
clang-devel clang-devel

View File

@@ -4,6 +4,9 @@
Distribution=|debian Distribution=|debian
Distribution=|ubuntu Distribution=|ubuntu
[Include]
Include=%D/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/pkgenv.conf
[Content] [Content]
Packages= Packages=
apt apt

View File

@@ -3,6 +3,9 @@
[Match] [Match]
Distribution=opensuse Distribution=opensuse
[Include]
Include=%D/mkosi.conf.d/opensuse/mkosi.conf.d/pkgenv.conf
[Content] [Content]
Packages= Packages=
clang clang

View File

@@ -3,6 +3,9 @@
[Match] [Match]
Distribution=arch Distribution=arch
[Include]
Include=%D/mkosi.conf.d/arch/mkosi.conf.d/pkgenv.conf
[Content] [Content]
PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/arch/mkosi.prepare PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/arch/mkosi.prepare
Packages= Packages=

View File

@@ -4,6 +4,9 @@
Distribution=|fedora Distribution=|fedora
Distribution=|centos Distribution=|centos
[Include]
Include=%D/mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf
[Content] [Content]
PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare
Packages= Packages=

View File

@@ -4,6 +4,9 @@
Distribution=|debian Distribution=|debian
Distribution=|ubuntu Distribution=|ubuntu
[Include]
Include=%D/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/pkgenv.conf
[Content] [Content]
PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.prepare PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.prepare
Packages= Packages=

View File

@@ -3,6 +3,9 @@
[Match] [Match]
Distribution=opensuse Distribution=opensuse
[Include]
Include=%D/mkosi.conf.d/opensuse/mkosi.conf.d/pkgenv.conf
[Content] [Content]
PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare
Packages= Packages=

View File

@@ -127,7 +127,7 @@ def update_distro(args, distro: str, config: dict):
changes = subprocess.check_output(cmd, text=True).strip() changes = subprocess.check_output(cmd, text=True).strip()
conf_dir = Path('mkosi.conf.d') conf_dir = Path('mkosi.conf.d')
files = conf_dir.glob('*/*.conf') files = conf_dir.glob('**/pkgenv.conf')
for file in files: for file in files:
s = file.read_text() s = file.read_text()
if old_commit in s: if old_commit in s: