diff --git a/MockBuildUtils.pm b/MockBuildUtils.pm index fff195a..dd33902 100644 --- a/MockBuildUtils.pm +++ b/MockBuildUtils.pm @@ -323,15 +323,21 @@ sub parse_pin { return ('version'); } -# The mock target that builds each SUSE deploy directory. A deploy directory does not name the -# chroot that builds it, so this needs a table rather than a pattern: mock-core-configs ships no -# SLE config, because SLE repositories need a subscription, and Leap 15.6 shares SLE 15 SP6's -# package base. sles12 is absent on purpose -- it has no buildable chroot, so it must resolve to -# nothing rather than to a wrong target, which would publish one release's rpms as another's. -my %SUSE_BUILD_TARGET = ( - sles15 => 'opensuse-leap-15.6', +# The Leap release that builds each SLE family, and the family it serves. mock-core-configs ships +# no SLE config, because SLE repositories need a subscription, so each cell is built in the +# openSUSE counterpart of its family. The SLE major is not the Leap major: Leap 15.6 carries SLE +# 15 SP6's base, and Leap 42.3 carries SLE 12 SP3's -- rpm 4.11.2, perl 5.18.2, glibc 2.22. +my %LEAP_SLE_MAJOR = ( + '42.3' => 12, + '15.6' => 15, + '16.0' => 16, ); +# The reverse, for a deploy directory handed to the gates by path alone. Derived from the table +# above so the two cannot disagree. +my %SUSE_BUILD_TARGET = + map { ("sles$LEAP_SLE_MAJOR{$_}" => "opensuse-leap-$_") } keys %LEAP_SLE_MAJOR; + sub derive_target_from_repo_path { my ($dir) = @_; my $tgt; @@ -1024,13 +1030,17 @@ sub target_profile { perl-IO-Stty perl-HTTP-Async perl-Net-HTTPS-NB)], }; } - # The dep repository publishes Leap under sles, so every 15.x lands in sles15. Leap has - # no EPEL and builds natively; the dep set is the EL one without elilo-xcat, which packages an - # EL boot loader. 94daf29 added this mapping and a1ab393 removed it while scoping its pull - # request to EL, and the pipeline has asked for the target ever since. - if (my ($rel, $arch) = $target =~ /\Aopensuse-leap-(\d+)\.\d+-([A-Za-z0-9_]+)\z/) { + # Leap has no EPEL and builds natively; the dep set is the EL one without elilo-xcat, which + # packages an EL boot loader. 94daf29 added this mapping and a1ab393 removed it while scoping + # its pull request to EL, and the pipeline has asked for the target ever since. + if (my ($leap, $arch) = $target =~ /\Aopensuse-leap-(\d+\.\d+)-([A-Za-z0-9_]+)\z/) { die "openSUSE target '$target' requires a $arch build host, found $host_arch\n" unless $arch eq $host_arch; + # An unmapped Leap release must not publish into sles: that would serve one + # family's rpms as another's. + my $rel = $LEAP_SLE_MAJOR{$leap} + or die "openSUSE target '$target' names no SLE family: add Leap $leap to" + . " %LEAP_SLE_MAJOR\n"; return { rel => $rel, arch => $arch, diff --git a/mock-configs/opensuse-leap-42.3-x86_64.cfg b/mock-configs/opensuse-leap-42.3-x86_64.cfg new file mode 100644 index 0000000..74e25a1 --- /dev/null +++ b/mock-configs/opensuse-leap-42.3-x86_64.cfg @@ -0,0 +1,70 @@ +# openSUSE Leap 42.3 x86_64 chroot for the xCAT dependency build. +# +# WHY THIS TARGET EXISTS: the sles12 cell publishes packages for the SLE 12 family, and Leap +# 42.3 is the openSUSE build of it (42.3 shares SLE 12 SP3's base: rpm 4.11.2, perl 5.18.2, +# glibc 2.22). This mirrors sles15, which is built in a Leap 15.6 chroot rather than on SLE +# media. Building on the public counterpart keeps the cell reproducible without a subscription. +# +# WHY NOT THE SLE 12 SP5 MEDIA: the Server DVD is a GA medium with no SDK, and the SDK is where +# SLE puts the development packages. nasm, libuuid-devel, readline-devel and tmux are all absent +# from it, so ipmitool-xcat, syslinux-xcat and the genesis payload cannot be built there at all. +# Leap 42.3 carries every one of them. +# +# Leap 42.3 is end of life, so it is served from the openSUSE discontinued archive rather than +# from a live mirror. mock ships no config for it, and the tree predates the layout mock expects: +# its rpm-md metadata is under repo/oss/suse/, not repo/oss/. +# +# mock builds its bootstrap chroot by installing python3-dnf from the target's repos, and 42.3 +# has no python3-dnf. Install straight into the chroot with the host package manager instead. +config_opts['root'] = 'opensuse-leap-42.3-x86_64' +config_opts['description'] = 'openSUSE Leap 42.3 x86_64 (xCAT dependency build, SLE 12 family)' +config_opts['target_arch'] = 'x86_64' +config_opts['legal_host_arches'] = ('x86_64',) +config_opts['dist'] = 'suse.lp423' +config_opts['releasever'] = '42.3' +config_opts['macros']['%dist'] = '.suse.lp423' +# Leap 42.3 ships rpm 4.11, which predates these macros. The Fedora source rpms this build +# rebuilds call them, and an undefined macro reaches the shell verbatim: %build then dies with +# "fg: no job control" rather than saying a macro is missing. %{?_smp_mflags} rpm 4.11 defines. +config_opts['macros']['%make_build'] = 'make %{?_smp_mflags}' +config_opts['macros']['%make_install'] = 'make install DESTDIR=%{buildroot} ; find %{buildroot} -name perllocal.pod -delete ; find %{buildroot} -name .packlist -delete' +config_opts['macros']['%license'] = '%doc' +config_opts['package_manager'] = 'dnf' +config_opts['use_bootstrap_image'] = False +config_opts['use_bootstrap'] = False +config_opts['extra_chroot_dirs'] = [ '/run/lock', ] +config_opts['ssl_ca_bundle_path'] = '/var/lib/ca-certificates/ca-bundle.pem' + +# Leap 42.3 names the build pattern the Leap way, not the SLE way. +config_opts['chroot_setup_cmd'] = 'install patterns-openSUSE-devel_basis rpm-build' + +config_opts['dnf.conf'] = """ +[main] +keepcache=1 +debuglevel=2 +reposdir=/dev/null +logfile=/var/log/yum.log +retries=20 +obsoletes=1 +gpgcheck=0 +assumeyes=1 +syslog_ident=mock +syslog_device= +install_weak_deps=0 +metadata_expire=0 +best=1 +excludepkgs=*.i586,*.i686 +protected_packages= + +[leap-42.3-oss] +name=openSUSE Leap 42.3 - x86_64 - OSS +baseurl=http://ftp.gwdg.de/pub/opensuse/discontinued/distribution/leap/42.3/repo/oss/suse/ +enabled=1 +gpgcheck=0 + +[leap-42.3-update] +name=openSUSE Leap 42.3 - x86_64 - Update +baseurl=http://ftp.gwdg.de/pub/opensuse/discontinued/update/leap/42.3/oss/ +enabled=1 +gpgcheck=0 +""" diff --git a/packages-manifest.conf b/packages-manifest.conf index 5684957..f4e305d 100644 --- a/packages-manifest.conf +++ b/packages-manifest.conf @@ -238,6 +238,21 @@ xCAT-genesis-base=>= 2:2.18.0 # does not carry. # xCAT-genesis-base is deliberately not listed. Operator decision, 2026-10-22: openSUSE ships no # legacy Genesis, so no openSUSE target builds the payload, like rocky-10-riscv64-xcat below. +# Leap 42.3 builds the sles12 cell: 42.3 carries SLE 12 SP3's base. Its chroot is in +# mock-configs/, because mock ships no configuration for a release that is end of life. +[opensuse-leap-42.3-x86_64] +conserver-xcat=8.2.1 +goconserver=>= 0.3.3-snap202011021058 +grub2-xcat=1.0 +ipmitool-xcat=>= 1.8.18-4 +ipxe-xcat=2.0.0 +syslinux-xcat=>= 6.03-1 +xnba-undi=>= 1.21.1-1 +perl-HTTP-Async=>= 0.30-3 +perl-IO-Stty=>= 0.04-5 +perl-Net-HTTPS-NB=>= 0.14-3 +perl-Net-Telnet=3.04 + [opensuse-leap-15.6-x86_64] conserver-xcat=8.2.1 goconserver=>= 0.3.3-snap202011021058