mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-25 20:02:19 +00:00
Merge upstream/master into feat/ipv6-foundation-clean
This commit is contained in:
@@ -49,6 +49,7 @@ our @EXPORT_OK = qw(
|
||||
genesis_log_errors genesis_log_deny_rules deb_belongs_to_dist
|
||||
genesis_dists genesis_dist_reason
|
||||
fips_policy_artifacts fips_policy_plan sync_fips_policy
|
||||
package_skip_reason
|
||||
);
|
||||
|
||||
# Both builders echo the commands they run under --verbose. Set once, after
|
||||
@@ -806,6 +807,32 @@ sub cancel_build {
|
||||
sub DESTROY { shift->release }
|
||||
}
|
||||
|
||||
# The packages a target does not build, and why. Each rule names the package and
|
||||
# the target-name prefixes that do not build it.
|
||||
#
|
||||
# openSUSE ships no legacy Genesis. Operator decision, 2026-10-22. The payload manifest
|
||||
# verify-genesis-payload checks is written for EL: on opensuse-leap-15.6-x86_64 it reports 566
|
||||
# missing zoneinfo/posix paths, etc/redhat-release and 45 EL paths and tool names, so the package
|
||||
# cannot be built there and under that decision does not need to be.
|
||||
my @PACKAGE_SKIPS = (
|
||||
{ package => 'xCAT-genesis-base',
|
||||
prefixes => ['opensuse-'],
|
||||
reason => 'openSUSE ships no legacy Genesis',
|
||||
},
|
||||
);
|
||||
|
||||
# Why $pkg is not built for $target, or undef when the pair is built.
|
||||
sub package_skip_reason {
|
||||
my ($pkg, $target) = @_;
|
||||
return undef unless defined($pkg) && defined($target);
|
||||
for my $skip (@PACKAGE_SKIPS) {
|
||||
next unless $pkg eq $skip->{package};
|
||||
return $skip->{reason}
|
||||
if grep { index($target, $_) == 0 } @{ $skip->{prefixes} };
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub openeuler_build_target {
|
||||
my ($os, $arch) = @_;
|
||||
return undef unless lc($os->{ID} // '') eq 'openeuler';
|
||||
|
||||
+13
-1
@@ -60,6 +60,7 @@ use XCAT::BuildUtils qw(git_revision source_date_epoch sh sh_or_die usage buildi
|
||||
stage_genesis_base_sources
|
||||
write_script read_line targetarch_from_target
|
||||
openeuler_build_target openeuler_repo_subdir
|
||||
package_skip_reason
|
||||
mock_config_text);
|
||||
use POSIX (); # EEXIST, for the directory build lock (see main())
|
||||
use Getopt::Long qw(GetOptions);
|
||||
@@ -1027,7 +1028,18 @@ sub main {
|
||||
# A builder killed with SIGKILL together with this parent leaves its directory behind.
|
||||
sweep_build_sources_dirs($SOURCES_BASE);
|
||||
|
||||
my @rpms = product($opts{packages}, $opts{targets});
|
||||
my @rpms;
|
||||
for my $pair (product($opts{packages}, $opts{targets})) {
|
||||
my $why = package_skip_reason($pair->@*);
|
||||
$why ? print "Skipping $pair->[0] for $pair->[1]: $why\n" : push @rpms, $pair;
|
||||
}
|
||||
# An empty plan is the plan, not a failure. The dep pipeline asks for
|
||||
# xCAT-genesis-base alone, and no openSUSE target builds it.
|
||||
if (!@rpms) {
|
||||
print "Nothing to build: every requested package is out of scope for the"
|
||||
. " requested targets\n";
|
||||
return;
|
||||
}
|
||||
my $pm = Parallel::ForkManager->new($opts{nproc});
|
||||
|
||||
# Track which mock chroot each live child is building so abort_builds can scrub it.
|
||||
|
||||
@@ -48,7 +48,14 @@ Source1: xCAT-genesis-scripts.tar.bz2
|
||||
# so floor it at the 2.18.0 baseline: any 2.18.0-or-newer genesis-base snap satisfies it,
|
||||
# and core version bumps no longer force a genesis-base re-publish. (RPM ignores release
|
||||
# when the dependency omits it.)
|
||||
#
|
||||
# openSUSE is excluded. Operator decision, 2026-10-22: openSUSE ships no legacy Genesis, so
|
||||
# no openSUSE target builds xCAT-genesis-base. No OpenEmbedded payload is published for the
|
||||
# family either, so nothing an openSUSE management node reads can satisfy this name, and
|
||||
# stating it stops zypper install xCAT.
|
||||
%if ! 0%{?suse_version}
|
||||
Requires: xCAT-genesis-base-%{tarch} >= 2:2.18.0
|
||||
%endif
|
||||
|
||||
Buildroot: %{_localstatedir}/tmp/xCAT-genesis
|
||||
Packager: IBM Corp.
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use FindBin;
|
||||
use File::Slurper qw(read_lines);
|
||||
use Test::More;
|
||||
|
||||
use lib "$FindBin::Bin/../../build-utils/lib";
|
||||
use XCAT::BuildUtils ();
|
||||
|
||||
# openSUSE ships no legacy Genesis. Operator decision, 2026-10-22, the same decision taken for
|
||||
# openEuler on 2026-10-01.
|
||||
#
|
||||
# Two artifacts carry it. The build plan decides the (package, target) pairs buildrpms.pl
|
||||
# builds, and xCAT-genesis-scripts carries the payload requirement that makes an install fail
|
||||
# when the payload is absent.
|
||||
#
|
||||
# Measured 2026-10-22: sles/devel/xcat-dep has no common/ tree (repomd.xml 404, against 200 for
|
||||
# the EL one), so no OpenEmbedded payload is published for the family either. Nothing in the
|
||||
# openSUSE graph can satisfy the payload name.
|
||||
my @opensuse_targets = qw(
|
||||
opensuse-leap-15.6-x86_64
|
||||
opensuse-leap-42.3-x86_64
|
||||
opensuse-leap-15.6-ppc64le
|
||||
);
|
||||
my @payload_targets = qw(
|
||||
alma+epel-8-x86_64
|
||||
alma+epel-9-x86_64
|
||||
alma+epel-10-x86_64
|
||||
alma+epel-10-ppc64le
|
||||
openeuler-22.03sp4-x86_64
|
||||
);
|
||||
|
||||
my $decides = XCAT::BuildUtils->can('package_skip_reason');
|
||||
ok($decides, 'BuildUtils decides which packages a target builds');
|
||||
|
||||
SKIP: {
|
||||
skip 'BuildUtils has no build-plan decision', 17 unless $decides;
|
||||
|
||||
foreach my $target (@opensuse_targets) {
|
||||
ok($decides->('xCAT-genesis-base', $target),
|
||||
"xCAT-genesis-base is not built for $target");
|
||||
}
|
||||
|
||||
foreach my $target (@payload_targets) {
|
||||
is($decides->('xCAT-genesis-base', $target), undef,
|
||||
"xCAT-genesis-base is built for $target");
|
||||
}
|
||||
|
||||
# The gate names one package. openSUSE keeps every other package, including the scripts
|
||||
# half of Genesis: xCAT requires it, and dropping it would be a second decision.
|
||||
foreach my $pkg (qw(perl-xCAT xCAT xCATsn xCAT-client xCAT-server xCAT-probe
|
||||
xCAT-genesis-scripts xCAT-test xCAT-release)) {
|
||||
is($decides->($pkg, 'opensuse-leap-15.6-x86_64'), undef,
|
||||
"$pkg is built for openSUSE");
|
||||
}
|
||||
}
|
||||
|
||||
# zypper install xCAT reaches this requirement through xCAT-genesis-scripts. An openSUSE core
|
||||
# that states it cannot install at all, because no repository the family reads carries the
|
||||
# payload.
|
||||
my $root = "$FindBin::Bin/../..";
|
||||
my @lines = read_lines("$root/xCAT-genesis-scripts/xCAT-genesis-scripts.spec");
|
||||
my ($index) = grep {
|
||||
$lines[$_] =~ /^Requires:\s*xCAT-genesis-base-%\{tarch\}\s*>=\s*2:2\.18\.0\s*$/
|
||||
} 0 .. $#lines;
|
||||
ok(defined $index, 'xCAT-genesis-scripts requires the legacy Genesis payload');
|
||||
|
||||
my $if = defined $index ? $lines[$index - 1] : '';
|
||||
like($if, qr/^%if\b/, '... behind a condition');
|
||||
like($if, qr/\Q0%{?suse_version}\E/, '... that reads suse_version');
|
||||
like($if, qr/^%if\s*!/, '... and excludes openSUSE rather than selecting it');
|
||||
|
||||
done_testing();
|
||||
Reference in New Issue
Block a user