From 310578757a4dc5ab4328266fe9cbafaf7b0076d8 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Mon, 7 Nov 2022 14:27:03 +0100 Subject: [PATCH] runner: add python or platform-python to all build roots Required for running osbuild modules. In Fedora, so far, python3 was always pulled by some other build-root dependency. We should add it explicitly since it's required by all our runners. For RHEL and CentOS, the requirement is platform-python. For RHEL 8 and CentOS 8, we also need to explicitly add python36 and for RHEL 9 and CentOS 9 python3 because it's used to run the stages in osbuild [1]. [1] https://github.com/osbuild/osbuild/blob/ea8261cad6c5c606c00c0f2824c3f483c01a0cc9/runners/org.osbuild.rhel82#L61 --- internal/runner/centos.go | 18 +++++++++++++++++- internal/runner/fedora.go | 1 + internal/runner/linux.go | 1 + internal/runner/rhel.go | 17 ++++++++++++++++- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/internal/runner/centos.go b/internal/runner/centos.go index bb04c6d30..2c65fac9a 100644 --- a/internal/runner/centos.go +++ b/internal/runner/centos.go @@ -12,12 +12,28 @@ func (c *CentOS) String() string { func (c *CentOS) GetBuildPackages() []string { packages := []string{ - "glibc", // ldconfig + "glibc", // ldconfig + "platform-python", // osbuild } if c.Version >= 8 { packages = append(packages, "systemd", // systemd-tmpfiles and systemd-sysusers ) } + if c.Version < 9 { + packages = append(packages, + // The RHEL 8 runner (which is also used for CS8) in osbuild runs + // with platform-python but explicitly symlinks python 3.6 to + // /etc/alternatives (which in turn is the target for + // /usr/bin/python3) for the stages. + // https://github.com/osbuild/osbuild/blob/ea8261cad6c5c606c00c0f2824c3f483c01a0cc9/runners/org.osbuild.rhel82#L61 + // Install python36 explicitly for CS8. + "python36", + ) + } else { + packages = append(packages, + "python3", // osbuild stages + ) + } return packages } diff --git a/internal/runner/fedora.go b/internal/runner/fedora.go index cf555bab8..3482b0e11 100644 --- a/internal/runner/fedora.go +++ b/internal/runner/fedora.go @@ -14,5 +14,6 @@ func (p *Fedora) GetBuildPackages() []string { return []string{ "glibc", // ldconfig "systemd", // systemd-tmpfiles and systemd-sysusers + "python3", // osbuild } } diff --git a/internal/runner/linux.go b/internal/runner/linux.go index 5f42a843d..9e3ee7731 100644 --- a/internal/runner/linux.go +++ b/internal/runner/linux.go @@ -11,5 +11,6 @@ func (p *Linux) GetBuildPackages() []string { return []string{ "glibc", // ldconfig "systemd", // systemd-tmpfiles and systemd-sysusers + "python3", // osbuild } } diff --git a/internal/runner/rhel.go b/internal/runner/rhel.go index a3c2a70b5..7dcb5ca44 100644 --- a/internal/runner/rhel.go +++ b/internal/runner/rhel.go @@ -13,12 +13,27 @@ func (r *RHEL) String() string { func (p *RHEL) GetBuildPackages() []string { packages := []string{ - "glibc", // ldconfig + "glibc", // ldconfig + "platform-python", // osbuild } if p.Major >= 8 { packages = append(packages, "systemd", // systemd-tmpfiles and systemd-sysusers ) } + if p.Major < 9 { + packages = append(packages, + // The RHEL 8 runner in osbuild runs with platform-python but + // explicitly symlinks python 3.6 to /etc/alternatives (which in turn + // is the target for /usr/bin/python3) for the stages. + // https://github.com/osbuild/osbuild/blob/ea8261cad6c5c606c00c0f2824c3f483c01a0cc9/runners/org.osbuild.rhel82#L61 + // Install python36 explicitly for RHEL 8. + "python36", + ) + } else { + packages = append(packages, + "python3", // osbuild stages + ) + } return packages }