]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Stop passing package environment variables to tools image 36931/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 1 Apr 2025 12:57:22 +0000 (14:57 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 2 Apr 2025 08:34:03 +0000 (10:34 +0200)
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.

19 files changed:
.packit.yml
mkosi.conf
mkosi.conf.d/arch/mkosi.conf
mkosi.conf.d/arch/mkosi.conf.d/pkgenv.conf [new file with mode: 0644]
mkosi.conf.d/centos-fedora/mkosi.conf
mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf [new file with mode: 0644]
mkosi.conf.d/debian-ubuntu/mkosi.conf
mkosi.conf.d/debian-ubuntu/mkosi.conf.d/pkgenv.conf [new file with mode: 0644]
mkosi.conf.d/opensuse/mkosi.conf
mkosi.conf.d/opensuse/mkosi.conf.d/pkgenv.conf [new file with mode: 0644]
mkosi.images/build/mkosi.conf.d/arch/mkosi.conf
mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.conf
mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.conf
mkosi.images/build/mkosi.conf.d/opensuse/mkosi.conf
mkosi.tools.conf/mkosi.conf.d/arch.conf
mkosi.tools.conf/mkosi.conf.d/centos-fedora.conf
mkosi.tools.conf/mkosi.conf.d/debian-ubuntu.conf
mkosi.tools.conf/mkosi.conf.d/opensuse.conf
tools/fetch-distro.py

index 5a0be6131f0b4a951e81352bcbf9549a2aeefb29..19fbce9cdd586ac727083e9f9a9ce061e3854ca2 100644 (file)
@@ -19,7 +19,7 @@ actions:
   post-upstream-clone:
     # Use the Fedora Rawhide specfile
     - 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 "%define meson_extra_configure_options --werror" >> .packit_rpm/systemd.spec.new'
     - bash -c 'cat .packit_rpm/systemd.spec >> .packit_rpm/systemd.spec.new'
index 033b92d59159af4b6e0ac975471ecbd405f05b51..8c3695bef247fe5993a8bdfd9b93d953ae5d8185 100644 (file)
@@ -23,11 +23,6 @@ PassEnvironment=
         ASAN_OPTIONS
         COVERAGE
         VCS_TAG
-        GIT_URL
-        GIT_SUBDIR
-        GIT_BRANCH
-        GIT_COMMIT
-        PKG_SUBDIR
 
 [Output]
 RepartDirectories=mkosi.repart
index 79c189bf034b1cdd14ea91e9a4b35660309918fa..f897d7d31c17554951df72d1f992e3ea0d1ae167 100644 (file)
@@ -3,13 +3,6 @@
 [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
-
 [Content]
 VolatilePackages=
         systemd
diff --git a/mkosi.conf.d/arch/mkosi.conf.d/pkgenv.conf b/mkosi.conf.d/arch/mkosi.conf.d/pkgenv.conf
new file mode 100644 (file)
index 0000000..6624458
--- /dev/null
@@ -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
index 6f996fd578a5faee0e6d5e2e5aad829aede8c5b2..7c941046f77a501da5bdc9e08f9daf82af2d9945 100644 (file)
@@ -4,13 +4,6 @@
 Distribution=|centos
 Distribution=|fedora
 
-[Build]
-Environment=
-        GIT_URL=https://src.fedoraproject.org/rpms/systemd.git
-        GIT_BRANCH=rawhide
-        GIT_COMMIT=617952132de4ed882b9b00ceeed077f843130f91
-        PKG_SUBDIR=fedora
-
 [Content]
 VolatilePackages=
         systemd
diff --git a/mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf b/mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf
new file mode 100644 (file)
index 0000000..63caaed
--- /dev/null
@@ -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
index 3b85be300bef98efe939dec9ce4a7bc601664e36..30138c00fbc2b73469743cd731b034fb30440c9f 100644 (file)
@@ -4,14 +4,6 @@
 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
-
 [Content]
 VolatilePackages=
         libnss-myhostname
diff --git a/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/pkgenv.conf b/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/pkgenv.conf
new file mode 100644 (file)
index 0000000..1f8fe97
--- /dev/null
@@ -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
index 6509ea4f168419eadb06c83eaca49b8919babab3..32ff446fec53747ea839e0710ab471e65ea55a80 100644 (file)
@@ -9,12 +9,6 @@ Repositories=non-oss
 
 [Build]
 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]
 VolatilePackages=
diff --git a/mkosi.conf.d/opensuse/mkosi.conf.d/pkgenv.conf b/mkosi.conf.d/opensuse/mkosi.conf.d/pkgenv.conf
new file mode 100644 (file)
index 0000000..ac1ddf5
--- /dev/null
@@ -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
index d7a79d11c1051244a46508d84e9b15de3eac643f..2e54455354c3aa1f9352c18342dcb25fc385a416 100644 (file)
@@ -3,6 +3,9 @@
 [Match]
 Distribution=arch
 
+[Include]
+Include=%D/mkosi.conf.d/arch/mkosi.conf.d/pkgenv.conf
+
 [Content]
 Packages=
         base
index 4d0ca8917d83fd40d0921b3d8f7a6ef71334ca33..89fdfc4b20ab8592e6a236e5fff30ae22b95d237 100644 (file)
@@ -4,6 +4,9 @@
 Distribution=|centos
 Distribution=|fedora
 
+[Include]
+Include=%D/mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf
+
 [Content]
 Packages=
         clang-devel
index 81c79a2c219dc623d4b1eeac75dd1cd4a17268c0..7fac74772b9de495bd1d758920f403dcb75dd136 100644 (file)
@@ -4,6 +4,9 @@
 Distribution=|debian
 Distribution=|ubuntu
 
+[Include]
+Include=%D/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/pkgenv.conf
+
 [Content]
 Packages=
         apt
index 70a1b31b641964740337434db5bb8483a0a72841..00a45fce5b75ae602488b15ff53e761354a5799f 100644 (file)
@@ -3,6 +3,9 @@
 [Match]
 Distribution=opensuse
 
+[Include]
+Include=%D/mkosi.conf.d/opensuse/mkosi.conf.d/pkgenv.conf
+
 [Content]
 Packages=
         clang
index 2ccbf7c192e8993ae298019fa2418c6bbaca5fd8..75570ffe0c636d2cae6b57304d303b4dacad4526 100644 (file)
@@ -3,6 +3,9 @@
 [Match]
 Distribution=arch
 
+[Include]
+Include=%D/mkosi.conf.d/arch/mkosi.conf.d/pkgenv.conf
+
 [Content]
 PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/arch/mkosi.prepare
 Packages=
index b360b1d55b9a5d2d6f23e0266b947e4b334a33d3..8f5f07addf5f811907285778147a50e8be9ade77 100644 (file)
@@ -4,6 +4,9 @@
 Distribution=|fedora
 Distribution=|centos
 
+[Include]
+Include=%D/mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf
+
 [Content]
 PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare
 Packages=
index 2b962da2ea730e613ab7ee2282ad4b49f2644d2b..0a34b867c9b43f4ecf1dfba25004f0d7070c378a 100644 (file)
@@ -4,6 +4,9 @@
 Distribution=|debian
 Distribution=|ubuntu
 
+[Include]
+Include=%D/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/pkgenv.conf
+
 [Content]
 PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.prepare
 Packages=
index 9e016bcfb27b6d9357545a714cc326435496aeda..6fd1c746d60c243aba7e706205c9f729e1d531fb 100644 (file)
@@ -3,6 +3,9 @@
 [Match]
 Distribution=opensuse
 
+[Include]
+Include=%D/mkosi.conf.d/opensuse/mkosi.conf.d/pkgenv.conf
+
 [Content]
 PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare
 Packages=
index 77c46d45a2096d472925fbd1f39ccce06b651988..c7d30f18c1341d16d15865066c92f2e5d344384b 100755 (executable)
@@ -127,7 +127,7 @@ def update_distro(args, distro: str, config: dict):
     changes = subprocess.check_output(cmd, text=True).strip()
 
     conf_dir = Path('mkosi.conf.d')
-    files = conf_dir.glob('*/*.conf')
+    files = conf_dir.glob('**/pkgenv.conf')
     for file in files:
         s = file.read_text()
         if old_commit in s: