From 97f481a5706a2046cb9e3e27b7d60269a2629b92 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Thu, 3 Sep 2026 21:52:05 -0300 Subject: [PATCH] fix(build): builddebs.pl drops riscv64, so apt serves no riscv64 xCAT builddebs.pl replaced build-ubunturepo as the Ubuntu builder, and the arch support riscv64 has in build-ubunturepo did not come with it. The pipeline prefers builddebs.pl whenever the ref carries it, so on this branch the switch silently stops producing riscv64 debs: no xcat_*_riscv64.deb in the pool, and a published Release that says 'Architectures: amd64 ppc64el'. apt on a riscv64 management node then reports 'Unable to locate package xcat', which is the same failure build-ubunturepo was fixed for. builddebs.pl reads its architectures from BuildUtils, so unlike build-ubunturepo -- which hardcoded the pair in three places -- riscv64 goes in one: @DEB_ARCHES. xcat-genesis-scripts is the exception and needs its own rule. Its per-arch deb Depends on xcat-genesis-base-, and no riscv64 genesis-base deb exists, because riscv64 takes the OpenEmbedded Genesis image from the shared xcat-dep pool. Built for riscv64 it would be uninstallable, so deb_package_arches excludes it. build_utils.t covers both: removing riscv64 from @DEB_ARCHES fails four assertions, including the reprepro Architectures line, and removing the genesis-scripts exclusion fails its own. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> (cherry picked from commit 90f9156411b11b33496a470574f37fcdc2a7330f) --- build-utils/lib/XCAT/BuildUtils.pm | 14 +++++++++++--- xCAT-test/unit/build_utils.t | 16 ++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/build-utils/lib/XCAT/BuildUtils.pm b/build-utils/lib/XCAT/BuildUtils.pm index e0deac209..1e7ecdff2 100644 --- a/build-utils/lib/XCAT/BuildUtils.pm +++ b/build-utils/lib/XCAT/BuildUtils.pm @@ -156,7 +156,14 @@ my %ARCH_PACKAGES = map { $_ => 1 } qw(xCAT xCATsn xCAT-genesis-scripts); # the repo-assembly and the package-selection paths cannot disagree about it. my %NO_PPC64EL = map { $_ => 1 } qw(saucy); -my @DEB_ARCHES = qw(amd64 ppc64el); +my @DEB_ARCHES = qw(amd64 ppc64el riscv64); + +# Packages that are NOT built for riscv64. xcat-genesis-scripts- Depends on +# xcat-genesis-base-, and no riscv64 genesis-base deb exists: riscv64 takes the +# OpenEmbedded Genesis image from the shared xcat-dep pool instead. Building it here would +# publish a package nothing can install, which is what happens when the arch list is one +# global constant. +my %NO_RISCV64 = map { $_ => 1 } qw(xCAT-genesis-scripts); # The Ubuntu releases the apt repository serves by default. Single source of truth: # the builder, the repo assembly and the tests all read it here, so they cannot drift. @@ -323,8 +330,9 @@ sub stage_probe_helpers { # 'all' is a single arch-independent build; the three arch packages get one per arch. sub deb_package_arches { my ($package) = @_; - return @DEB_ARCHES if $ARCH_PACKAGES{$package // ''}; - return ('all'); + return ('all') unless $ARCH_PACKAGES{$package // ''}; + return grep { $_ ne 'riscv64' } @DEB_ARCHES if $NO_RISCV64{$package}; + return @DEB_ARCHES; } # dist_arches: the architectures a release's apt repo declares. diff --git a/xCAT-test/unit/build_utils.t b/xCAT-test/unit/build_utils.t index 8a44fbe39..b750ad358 100644 --- a/xCAT-test/unit/build_utils.t +++ b/xCAT-test/unit/build_utils.t @@ -60,15 +60,19 @@ is_deeply( [deb_package_arches('perl-xCAT')], ['all'], 'a Perl package is built once, arch-independent' ); is_deeply( [deb_package_arches('xCAT-probe')], ['all'], 'xCAT-probe is arch-independent too' ); -for my $pkg (qw(xCAT xCATsn xCAT-genesis-scripts)) { - is_deeply( [deb_package_arches($pkg)], ['amd64', 'ppc64el'], +for my $pkg (qw(xCAT xCATsn)) { + is_deeply( [deb_package_arches($pkg)], ['amd64', 'ppc64el', 'riscv64'], "$pkg is built per architecture" ); } +# xcat-genesis-scripts- Depends on xcat-genesis-base- and there is no riscv64 +# genesis-base deb, so a riscv64 build of it would be uninstallable. +is_deeply( [deb_package_arches('xCAT-genesis-scripts')], ['amd64', 'ppc64el'], + 'xcat-genesis-scripts is built per architecture, but never for riscv64' ); is_deeply( [deb_package_arches(undef)], ['all'], 'an undefined package name does not blow up the arch lookup' ); -is_deeply( [dist_arches('noble')], ['amd64', 'ppc64el'], - 'a current release serves both architectures' ); +is_deeply( [dist_arches('noble')], ['amd64', 'ppc64el', 'riscv64'], + 'a current release serves every architecture xCAT builds' ); is_deeply( [dist_arches('saucy')], ['amd64'], 'saucy predates ppc64el and serves only amd64' ); @@ -151,8 +155,8 @@ is( scalar( () = $rewritten =~ /^ -- xCAT Build /mg ), 1, my $dists = reprepro_distributions([qw(focal noble)], 'DEADBEEF'); is( scalar(() = $dists =~ /^Codename:/mg), 2, 'one stanza per release' ); -like( $dists, qr/^Codename: focal\nArchitectures: amd64 ppc64el$/m, - 'a release declares both architectures, on the line after its codename' ); +like( $dists, qr/^Codename: focal\nArchitectures: amd64 ppc64el riscv64$/m, + 'a release declares every architecture, on the line after its codename' ); is( scalar(() = $dists =~ /^SignWith: DEADBEEF$/mg), 2, 'every stanza is signed when a key is given' );