From e7d52727193a0ab961600c1cb4512b0be3df35c7 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Sat, 24 Oct 2026 07:51:05 -0300 Subject: [PATCH 1/2] fix(xcat-core): no test asserts the pod BuildRequires an openSUSE build needs The openSUSE Leap 15.6 core build dies in %build with "Can't locate Pod/Man.pm in @INC ... at ./xpod2man line 12" for xCAT-buildkit, xCAT-client, xCAT-test and xCAT-vlan. Nothing in the suite reads a spec to check that its pod converter dependency survives the suse_version conditionals, so the gap is invisible until a Leap chroot runs the converter and finds perl-base alone. This test reads every package spec, selects the ones whose %build runs xpod2man, pod2man or pod2html, and asserts each names a build dependency that holds when suse_version is defined. The spec list is derived from the checkout, so a new pod-converting spec is covered without editing the test. It fails on this commit for all six converting specs, each reporting no BuildRequires at all under suse_version. xCAT-confluent comments its converter call out, and the derivation excludes it. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/unit/opensuse_pod_buildrequires.t | 95 +++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 xCAT-test/unit/opensuse_pod_buildrequires.t diff --git a/xCAT-test/unit/opensuse_pod_buildrequires.t b/xCAT-test/unit/opensuse_pod_buildrequires.t new file mode 100644 index 0000000000..93c29ceb8b --- /dev/null +++ b/xCAT-test/unit/opensuse_pod_buildrequires.t @@ -0,0 +1,95 @@ +#!/usr/bin/env perl +# openSUSE has no perl-generators, and its chroot carries only perl-base, which ships +# no Pod::Man and no pod2man. A spec that converts pods in %build must therefore name a +# build dependency that holds under suse_version, or the buildroot holds none by accident. +use strict; +use warnings; + +use FindBin; +use lib "$FindBin::Bin/../lib"; +use File::Spec; +use Test::More; + +use XCAT::Test::File qw(repo_path slurp_repo_file); + +#------------------------------------------------------------------------------- + +=head3 converts_pods + +Descriptions: Say whether a spec runs a pod converter in an active line. A commented +call does not count: xCAT-confluent carries one and needs no converter. + +Arguments: the spec text + +Returns: the number of converter calls + +=cut + +#------------------------------------------------------------------------------- +sub converts_pods { + my ($text) = @_; + return scalar(grep { /^\s*(\.\/xpod2man|pod2man|pod2html)\b/ } split /\n/, $text); +} + +#------------------------------------------------------------------------------- + +=head3 suse_buildrequires + +Descriptions: Collect the BuildRequires of a spec that apply when suse_version is +defined. Only the suse_version conditionals are evaluated; any other %if is entered, +because its BuildRequires can still reach a SUSE build. + +Arguments: the spec text + +Returns: the list of required package names + +=cut + +#------------------------------------------------------------------------------- +sub suse_buildrequires { + my ($text) = @_; + my @dead; # one entry per open conditional: true means the branch is not taken + my @names; + for my $line (split /\n/, $text) { + if ($line =~ /^%if\s*(!?)\s*0%\{\?suse_version\}\s*$/) { + push @dead, ($1 eq '!' ? 1 : 0); + } + elsif ($line =~ /^%if/) { + push @dead, 0; + } + elsif ($line =~ /^%else\b/) { + $dead[-1] = $dead[-1] ? 0 : 1 if @dead; + } + elsif ($line =~ /^%endif/) { + pop @dead; + } + elsif ($line =~ /^BuildRequires:\s*(.+?)\s*$/ && !grep { $_ } @dead) { + push @names, split /[,\s]+/, $1; + } + } + return @names; +} + +my %text; +for my $absolute (glob repo_path('*/*.spec')) { + my @parts = File::Spec->splitdir($absolute); + my $relative = File::Spec->catfile(@parts[-2, -1]); + $text{$relative} = slurp_repo_file($relative); +} +die "read no package spec from the checkout" unless keys %text > 10; + +my @converting = sort grep { converts_pods($text{$_}) } keys %text; +plan skip_all => 'no spec converts pods' unless @converting; +plan tests => 1 + scalar(@converting); + +cmp_ok(scalar(@converting), '>=', 4, 'several specs convert pods in %build'); + +# On Leap 15.6 perl(Pod::Man), perl(Pod::Html) and /usr/bin/pod2man are all in "perl"; +# "perl-Pod-Html" does not exist there at all. +for my $relative (@converting) { + my @required = suse_buildrequires($text{$relative}); + ok(scalar(grep { $_ eq 'perl' } @required), + "$relative build-requires perl on SUSE, which provides Pod::Man and pod2man") + or diag("BuildRequires under suse_version: " + . (@required ? join(', ', @required) : '(none)')); +} From 697c85174992b781acb5a49737c60b8f50b41ea5 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Sat, 24 Oct 2026 07:52:41 -0300 Subject: [PATCH 2/2] fix(xcat-core): the openSUSE core build has no Pod::Man, so pod conversion fails The openSUSE Leap 15.6 target cannot build xCAT-buildkit, xCAT-client, xCAT-test or xCAT-vlan. Each dies in %build with "Can't locate Pod/Man.pm in @INC ... at ./xpod2man line 12", and that failure alone makes the openSUSE core build red. Six specs guard their pod converter dependency with "%if !0%{?suse_version}" around "BuildRequires: perl-Pod-Html". The guard is right that Leap has no perl-Pod-Html, but it drops the dependency instead of naming the package that replaces it. A Leap mock chroot then holds perl-base only, which ships neither Pod::Man nor pod2man, and openSUSE has no perl-generators to pull the full perl package in by accident. On Leap 15.6 the "perl" package provides perl(Pod::Man), perl(Pod::Html) and /usr/bin/pod2man. Each guard becomes a two-branch conditional that build-requires perl on SUSE and perl-Pod-Html elsewhere, so the EL buildroot is unchanged. opensuse_pod_buildrequires.t reported no BuildRequires under suse_version for all six specs on the preceding commit, and passes here. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-OpenStack-baremetal/xCAT-OpenStack-baremetal.spec | 8 ++++++-- xCAT-SoftLayer/xCAT-SoftLayer.spec | 8 ++++++-- xCAT-buildkit/xCAT-buildkit.spec | 8 ++++++-- xCAT-client/xCAT-client.spec | 8 ++++++-- xCAT-test/xCAT-test.spec | 8 ++++++-- xCAT-vlan/xCAT-vlan.spec | 8 ++++++-- 6 files changed, 36 insertions(+), 12 deletions(-) diff --git a/xCAT-OpenStack-baremetal/xCAT-OpenStack-baremetal.spec b/xCAT-OpenStack-baremetal/xCAT-OpenStack-baremetal.spec index 71fa9b96b7..23dc05a17b 100644 --- a/xCAT-OpenStack-baremetal/xCAT-OpenStack-baremetal.spec +++ b/xCAT-OpenStack-baremetal/xCAT-OpenStack-baremetal.spec @@ -20,8 +20,12 @@ BuildArch: noarch Provides: xCAT-OpenStack-baremetal = %{epoch}:%{version} Requires: xCAT-client -# Pod::Html ships inside the core perl package on SUSE; there is no perl-Pod-Html -%if !0%{?suse_version} +# The pod converters are in perl-Pod-Html on EL and in the core perl package on +# SUSE, which has no perl-Pod-Html. A SUSE chroot holds perl-base only, and that +# ships neither Pod::Man nor pod2man. +%if 0%{?suse_version} +BuildRequires: perl +%else BuildRequires: perl-Pod-Html %endif diff --git a/xCAT-SoftLayer/xCAT-SoftLayer.spec b/xCAT-SoftLayer/xCAT-SoftLayer.spec index a2355ddba8..3ccb508e40 100644 --- a/xCAT-SoftLayer/xCAT-SoftLayer.spec +++ b/xCAT-SoftLayer/xCAT-SoftLayer.spec @@ -15,8 +15,12 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root BuildArch: noarch %endif Requires: xCAT-server -# Pod::Html ships inside the core perl package on SUSE; there is no perl-Pod-Html -%if !0%{?suse_version} +# The pod converters are in perl-Pod-Html on EL and in the core perl package on +# SUSE, which has no perl-Pod-Html. A SUSE chroot holds perl-base only, and that +# ships neither Pod::Man nor pod2man. +%if 0%{?suse_version} +BuildRequires: perl +%else BuildRequires: perl-Pod-Html %endif diff --git a/xCAT-buildkit/xCAT-buildkit.spec b/xCAT-buildkit/xCAT-buildkit.spec index 4bc6d948b1..f9ce2778d2 100644 --- a/xCAT-buildkit/xCAT-buildkit.spec +++ b/xCAT-buildkit/xCAT-buildkit.spec @@ -12,8 +12,12 @@ Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} Prefix: /opt/xcat BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root -# Pod::Html ships inside the core perl package on SUSE; there is no perl-Pod-Html -%if !0%{?suse_version} +# The pod converters are in perl-Pod-Html on EL and in the core perl package on +# SUSE, which has no perl-Pod-Html. A SUSE chroot holds perl-base only, and that +# ships neither Pod::Man nor pod2man. +%if 0%{?suse_version} +BuildRequires: perl +%else BuildRequires: perl-Pod-Html %endif diff --git a/xCAT-client/xCAT-client.spec b/xCAT-client/xCAT-client.spec index 2f6b71e288..aca7ac08a8 100644 --- a/xCAT-client/xCAT-client.spec +++ b/xCAT-client/xCAT-client.spec @@ -19,8 +19,12 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root %define s390x %(if [ "$s390x" = "1" ];then echo 1; else echo 0; fi) %define nots390x %(if [ "$s390x" = "1" ];then echo 0; else echo 1; fi) -# Pod::Html ships inside the core perl package on SUSE; there is no perl-Pod-Html -%if !0%{?suse_version} +# The pod converters are in perl-Pod-Html on EL and in the core perl package on +# SUSE, which has no perl-Pod-Html. A SUSE chroot holds perl-base only, and that +# ships neither Pod::Man nor pod2man. +%if 0%{?suse_version} +BuildRequires: perl +%else BuildRequires: perl-Pod-Html %endif diff --git a/xCAT-test/xCAT-test.spec b/xCAT-test/xCAT-test.spec index 6c1d859820..b4a8d849f9 100644 --- a/xCAT-test/xCAT-test.spec +++ b/xCAT-test/xCAT-test.spec @@ -11,8 +11,12 @@ Vendor: IBM Corp. Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} Prefix: /opt/xcat BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root -# Pod::Html ships inside the core perl package on SUSE; there is no perl-Pod-Html -%if !0%{?suse_version} +# The pod converters are in perl-Pod-Html on EL and in the core perl package on +# SUSE, which has no perl-Pod-Html. A SUSE chroot holds perl-base only, and that +# ships neither Pod::Man nor pod2man. +%if 0%{?suse_version} +BuildRequires: perl +%else BuildRequires: perl-Pod-Html %endif diff --git a/xCAT-vlan/xCAT-vlan.spec b/xCAT-vlan/xCAT-vlan.spec index 883f714d18..d621737f5a 100644 --- a/xCAT-vlan/xCAT-vlan.spec +++ b/xCAT-vlan/xCAT-vlan.spec @@ -11,8 +11,12 @@ Vendor: IBM Corp. Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} Prefix: /opt/xcat BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root -# Pod::Html ships inside the core perl package on SUSE; there is no perl-Pod-Html -%if !0%{?suse_version} +# The pod converters are in perl-Pod-Html on EL and in the core perl package on +# SUSE, which has no perl-Pod-Html. A SUSE chroot holds perl-base only, and that +# ships neither Pod::Man nor pod2man. +%if 0%{?suse_version} +BuildRequires: perl +%else BuildRequires: perl-Pod-Html %endif