mirror of
https://github.com/xcat2/xcat-dep.git
synced 2026-09-12 12:36:23 +00:00
fix(xcat-dep): require the arch:all boot tools (syslinux/grub2/elilo/xnba) on ppc64el
The ppc64el manifest sections listed only the natively-built deps (ipmitool-xcat, conserver-xcat, goconserver) + genesis, omitting the four noarch boot components syslinux-xcat, grub2-xcat, elilo-xcat and xnba-undi. A ppc management node needs these for netboot -- the EL manifest and the historical 2.16 ppc dep repo both ship them (grub2-xcat + syslinux-xcat especially; yaboot-xcat was dropped in 2.18 as obsolete). They ARE published to the ppc index today (Architecture:all rides into every binary-<arch> index), but the completeness gate never asserted their presence for ppc. List them as required-present on every ppc64el target so the gate verifies the ppc repo carries them. They remain SINGLE-PRODUCER: their source is x86-only (syslinux compiles with nasm/gcc-multilib), so build_one_codename now skips an Architecture:all package on any non-amd64 arch -- detected via a new pure, unit-tested control_binary_arch() helper -- so listing them for ppc64el drives verification, not a second (failing) build. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
+18
-1
@@ -25,7 +25,7 @@ our @EXPORT_OK = qw(
|
||||
sh_quote print_step
|
||||
version_matches required_pkgs read_manifest standard_options
|
||||
verify_repo_packages verify_repo_signature parse_packages_index resolve_present_names
|
||||
index_has_native_arch
|
||||
index_has_native_arch control_binary_arch
|
||||
codename_to_version version_to_codename known_codenames
|
||||
chroot_name chroot_sources_list
|
||||
control_field genesis_deb_control
|
||||
@@ -239,6 +239,23 @@ sub index_has_native_arch {
|
||||
return 0;
|
||||
}
|
||||
|
||||
# control_binary_arch($control_text, $binpkg): the Architecture field of the BINARY package $binpkg in
|
||||
# a debian/control (a source may declare several binary packages). Returns e.g. 'all', 'any',
|
||||
# 'ppc64el', or undef if that package/field is absent. Lets the builder tell an arch:all
|
||||
# single-producer package (built once on amd64 -- e.g. syslinux-xcat/grub2-xcat, whose source is
|
||||
# x86-only) from a genuinely per-arch one, so it is not rebuilt on ppc. Pure: text in, string out.
|
||||
sub control_binary_arch {
|
||||
my ($text, $binpkg) = @_;
|
||||
return undef unless defined $text && defined $binpkg && $binpkg ne '';
|
||||
for my $para (split /\n\n+/, $text) {
|
||||
my ($p) = $para =~ /^Package:[ \t]*(\S+)/m;
|
||||
next unless defined $p && $p eq $binpkg;
|
||||
my ($a) = $para =~ /^Architecture:[ \t]*(\S+)/m;
|
||||
return $a; # undef if this paragraph lacks an Architecture field
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
# resolve_present_names(\%parsed, $arch, \@names) -> \%present (name => upstream version | undef)
|
||||
# PURE. Resolves each manifest package NAME to the version actually in the parsed index (\%parsed from
|
||||
# parse_packages_index), reducing to the upstream version so it compares against the manifest's
|
||||
|
||||
+25
-6
@@ -15,12 +15,15 @@
|
||||
# PER-ARCH SETS (review concern #3 -- the arch matrix must be valid):
|
||||
# * Compiled, arch-specific deps that genuinely build on BOTH arches are listed for amd64 AND
|
||||
# ppc64el: ipmitool-xcat, conserver-xcat, goconserver (debian/control Architecture: any / *-ppc64el).
|
||||
# * The x86 boot components are Architecture:all but their SOURCE builds x86-only bootloader
|
||||
# binaries (syslinux) or are x86/EFI loaders (elilo, xnba) -- they are built ONCE on amd64 and,
|
||||
# being arch:all, assembled into every arch's Packages index. They are NOT built on ppc64el
|
||||
# (a syslinux build on ppc is meaningless / fails). This makes each output file SINGLE-PRODUCER
|
||||
# (concern #3b): the arch:all debs have exactly one builder (amd64).
|
||||
# * grub2-xcat is Architecture:all (config/scripts) -> single amd64 producer, installable everywhere.
|
||||
# * The noarch boot components (syslinux-xcat, grub2-xcat, elilo-xcat, xnba-undi) are
|
||||
# Architecture:all: their SOURCE is x86-only (syslinux compiles with nasm/gcc-multilib; elilo/xnba
|
||||
# are x86/EFI loaders; grub2-xcat is config/scripts), so they are BUILT ONCE on amd64 -- SINGLE
|
||||
# PRODUCER, concern #3b -- and, being arch:all, assembled into EVERY arch's Packages index. They
|
||||
# ARE listed for ppc64el too, as REQUIRED-PRESENT: a ppc MN needs them for netboot, so the gate
|
||||
# must verify the ppc repo carries them (matching the EL manifest and the historical 2.16 ppc dep
|
||||
# repo, minus the obsolete yaboot-xcat). sbuild-all.pl's build phase SKIPS an Architecture:all
|
||||
# package on any non-amd64 arch (it is not rebuilt there -- a syslinux build on ppc fails), so
|
||||
# listing them for ppc64el drives VERIFICATION, not a second build.
|
||||
# * xcat-genesis-base is arch:all but arch-SPECIFIC content (the netboot image for that arch), so
|
||||
# each arch produces its own (xcat-genesis-base-<arch>); the finalize step cross-populates both
|
||||
# into every codename pool for cross-arch netboot (issue #7610). Pinned 2.* -- its Version walks
|
||||
@@ -46,6 +49,10 @@ xcat-genesis-base=2.*
|
||||
ipmitool-xcat=1.8.18
|
||||
conserver-xcat=8.2.1
|
||||
goconserver=0.3.3
|
||||
syslinux-xcat=3.86
|
||||
grub2-xcat=2.12
|
||||
elilo-xcat=3.14
|
||||
xnba-undi=1.21.1
|
||||
xcat-genesis-base=2.*
|
||||
|
||||
# ============================ jammy (ubuntu22.04) ============================
|
||||
@@ -63,6 +70,10 @@ xcat-genesis-base=2.*
|
||||
ipmitool-xcat=1.8.18
|
||||
conserver-xcat=8.2.1
|
||||
goconserver=0.3.3
|
||||
syslinux-xcat=3.86
|
||||
grub2-xcat=2.12
|
||||
elilo-xcat=3.14
|
||||
xnba-undi=1.21.1
|
||||
xcat-genesis-base=2.*
|
||||
|
||||
# ============================ noble (ubuntu24.04) ============================
|
||||
@@ -80,6 +91,10 @@ xcat-genesis-base=2.*
|
||||
ipmitool-xcat=1.8.18
|
||||
conserver-xcat=8.2.1
|
||||
goconserver=0.3.3
|
||||
syslinux-xcat=3.86
|
||||
grub2-xcat=2.12
|
||||
elilo-xcat=3.14
|
||||
xnba-undi=1.21.1
|
||||
xcat-genesis-base=2.*
|
||||
|
||||
# ============================ resolute (ubuntu26.04) =========================
|
||||
@@ -97,4 +112,8 @@ xcat-genesis-base=2.*
|
||||
ipmitool-xcat=1.8.18
|
||||
conserver-xcat=8.2.1
|
||||
goconserver=0.3.3
|
||||
syslinux-xcat=3.86
|
||||
grub2-xcat=2.12
|
||||
elilo-xcat=3.14
|
||||
xnba-undi=1.21.1
|
||||
xcat-genesis-base=2.*
|
||||
|
||||
+14
-1
@@ -38,7 +38,7 @@ use FindBin qw($RealBin);
|
||||
use lib $RealBin;
|
||||
use BuildUtils qw(sh_quote print_step version_matches required_pkgs read_manifest standard_options
|
||||
verify_repo_packages verify_repo_signature parse_packages_index resolve_present_names
|
||||
index_has_native_arch
|
||||
index_has_native_arch control_binary_arch
|
||||
codename_to_version known_codenames chroot_name chroot_sources_list
|
||||
control_field genesis_deb_control
|
||||
deb_field deb_version deb_upstream_version deb_hash cross_copy_genesis_deb);
|
||||
@@ -341,6 +341,19 @@ sub build_one_codename {
|
||||
for my $pkg (@pkgs) {
|
||||
my $dir = $PKG_DIR{$pkg}
|
||||
or die "FATAL: no builder dir mapped for manifest package '$pkg'\n";
|
||||
# arch:all single-producer packages (grub2-xcat/syslinux-xcat/elilo-xcat/xnba-undi) are built
|
||||
# ONCE on amd64 -- their source is x86-only (syslinux compiles with nasm/gcc-multilib) -- and,
|
||||
# being Architecture:all, are assembled into every arch's Packages index. They stay REQUIRED in
|
||||
# the ppc64el manifest so the gate verifies the ppc repo actually carries them, but are NOT
|
||||
# rebuilt here (a ppc build would fail). Detect arch:all from the package's own debian/control.
|
||||
if ($arch ne 'amd64') {
|
||||
my $ctl = '';
|
||||
if (open my $cf, '<', "$repo_root/$dir/debian/control") { local $/; $ctl = <$cf>; close $cf; }
|
||||
if ((control_binary_arch($ctl, $pkg) // '') eq 'all') {
|
||||
print " [$cn] -> $pkg: arch:all single-producer (built on amd64) -- not rebuilt on $arch\n";
|
||||
next;
|
||||
}
|
||||
}
|
||||
my $builder = "$repo_root/$dir/sbuild.pl";
|
||||
die "FATAL: missing builder $builder (required for $pkg on $tgt)\n" unless -f $builder;
|
||||
my $log = "$out/$pkg.buildlog";
|
||||
|
||||
+25
-12
@@ -14,7 +14,7 @@ use File::Path qw(make_path);
|
||||
use File::Basename qw(basename);
|
||||
use BuildUtils qw(required_pkgs version_matches read_manifest standard_options
|
||||
verify_repo_packages verify_repo_signature parse_packages_index resolve_present_names
|
||||
index_has_native_arch
|
||||
index_has_native_arch control_binary_arch
|
||||
codename_to_version version_to_codename known_codenames
|
||||
chroot_name chroot_sources_list
|
||||
control_field genesis_deb_control
|
||||
@@ -289,20 +289,17 @@ SKIP: {
|
||||
is_deeply(\@miss_go, [], 'goconserver present in every manifest target')
|
||||
or diag("missing goconserver in: @miss_go");
|
||||
|
||||
# The x86 boot components are single-producer: present ONLY in amd64 sections, never on ppc64el
|
||||
# (building syslinux/elilo/xnba on ppc is meaningless -- the review's concern #3).
|
||||
# The noarch boot components (syslinux-xcat, grub2-xcat, elilo-xcat, xnba-undi) are Architecture:all
|
||||
# single-producer (built ONCE on amd64) but REQUIRED-PRESENT on EVERY target incl. ppc64el, so the
|
||||
# gate verifies the ppc repo actually carries them (matches the EL manifest + the 2.16 ppc dep repo;
|
||||
# a ppc MN needs them for netboot). It is the BUILD PHASE -- not the manifest -- that avoids
|
||||
# rebuilding them on ppc (build_one_codename skips an Architecture:all package on non-amd64; see the
|
||||
# control_binary_arch test below).
|
||||
for my $t (@targets) {
|
||||
my $is_ppc = $t =~ /-ppc64el$/;
|
||||
for my $x86only (qw(syslinux-xcat elilo-xcat xnba-undi)) {
|
||||
if ($is_ppc) {
|
||||
ok(!exists $m{$t}{$x86only}, "$x86only NOT built on ppc target $t (x86-only, single producer)");
|
||||
}
|
||||
for my $boot (qw(syslinux-xcat grub2-xcat elilo-xcat xnba-undi)) {
|
||||
ok(exists $m{$t}{$boot}, "$boot required-present on $t (arch:all, verified on every arch)");
|
||||
}
|
||||
}
|
||||
# ...and each amd64 section DOES carry them (so they are produced exactly once, on amd64).
|
||||
for my $t (grep { /-amd64$/ } @targets) {
|
||||
ok(exists $m{$t}{'syslinux-xcat'}, "syslinux-xcat built on amd64 target $t");
|
||||
}
|
||||
}
|
||||
|
||||
# ---- resolve_present_names: PURE name-resolution incl. per-arch genesis (guards the #7610 false-PASS)
|
||||
@@ -353,4 +350,20 @@ SKIP: {
|
||||
ok(!index_has_native_arch(undef, 'amd64'), 'undef index text -> not built (no crash)');
|
||||
}
|
||||
|
||||
# ---- control_binary_arch: PURE Architecture lookup for a specific BINARY package in debian/control --
|
||||
# Drives build_one_codename's "skip arch:all on non-amd64" (single-producer) decision. Must pick the
|
||||
# right binary paragraph -- e.g. the syslinux SOURCE is 'any' but the syslinux-xcat subpackage is 'all'.
|
||||
{
|
||||
my $ctl = "Source: syslinux\n\nPackage: syslinux\nArchitecture: any\n\n"
|
||||
. "Package: syslinux-xcat\nArchitecture: all\n\n"
|
||||
. "Package: syslinux-extlinux\nArchitecture: any\n";
|
||||
is(control_binary_arch($ctl, 'syslinux-xcat'), 'all', 'picks the arch:all subpackage, not the source');
|
||||
is(control_binary_arch($ctl, 'syslinux'), 'any', 'picks the per-arch main package by name');
|
||||
is(control_binary_arch($ctl, 'nonesuch'), undef, 'absent package -> undef');
|
||||
is(control_binary_arch('', 'syslinux-xcat'), undef, 'empty control -> undef');
|
||||
is(control_binary_arch(undef,'x'), undef, 'undef control -> undef (no crash)');
|
||||
is(control_binary_arch("Package: ipmitool-xcat\nArchitecture: ppc64el\n", 'ipmitool-xcat'),
|
||||
'ppc64el', 'native per-arch value returned verbatim');
|
||||
}
|
||||
|
||||
done_testing;
|
||||
|
||||
Reference in New Issue
Block a user