debian-forge-composer/internal/runner/rhel.go
Achilleas Koutsou 310578757a 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] ea8261cad6/runners/org.osbuild.rhel82 (L61)
2022-11-28 17:20:49 +01:00

39 lines
950 B
Go

package runner
import "fmt"
type RHEL struct {
Major uint64
Minor uint64
}
func (r *RHEL) String() string {
return fmt.Sprintf("org.osbuild.rhel%d%d", r.Major, r.Minor)
}
func (p *RHEL) GetBuildPackages() []string {
packages := []string{
"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
}