From a02adbfc63787b261570349b3faeeb9ba5ef76ec Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Sun, 5 Jul 2026 16:51:09 -0300 Subject: [PATCH] feat(mockbuild-all): build conserver-xcat as a dep builder Register conserver-xcat in mockbuild-all.pl's dep-builder set so the traditional C conserver (8.2.1) is built per-EL/arch alongside goconserver. xCAT itself requires goconserver, so conserver stays a build-on-demand artifact, but wiring it into the full dep build keeps it produced and signed with the rest of xcat-dep for sites that want it. conserver/mockbuild.pl gains the --build-timestamp option that mockbuild-all passes to every builder (SOURCE_DATE_EPOCH for deterministic builds); without it the child invocation would abort on an unknown option. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- conserver/mockbuild.pl | 24 ++++++++++++++++++------ mockbuild-all.pl | 1 + 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/conserver/mockbuild.pl b/conserver/mockbuild.pl index 64e493a..6d175e6 100755 --- a/conserver/mockbuild.pl +++ b/conserver/mockbuild.pl @@ -29,14 +29,16 @@ my $mock_uniqueext = ''; my $result_dir = "$script_dir/../build-output/list-conserver/conserver"; my $log_dir = "$script_dir/../build-logs/list-conserver/conserver"; my $skip_install = 0; +my $build_timestamp; GetOptions( - 'work-dir=s' => \$work_dir, - 'mock-cfg=s' => \$mock_cfg, - 'mock-uniqueext=s' => \$mock_uniqueext, - 'result-dir=s' => \$result_dir, - 'log-dir=s' => \$log_dir, - 'skip-install!' => \$skip_install, + 'work-dir=s' => \$work_dir, + 'mock-cfg=s' => \$mock_cfg, + 'mock-uniqueext=s' => \$mock_uniqueext, + 'result-dir=s' => \$result_dir, + 'log-dir=s' => \$log_dir, + 'skip-install!' => \$skip_install, + 'build-timestamp=i' => \$build_timestamp, ) or die usage(); die "Run as root (current uid=$>)\n" if $> != 0; @@ -44,6 +46,16 @@ for my $bin (qw(mock rpmbuild rpm)) { run("command -v " . sh_quote($bin) . " >/dev/null 2>&1"); } +# Deterministic builds: honor --build-timestamp (else Gitepoch, else git HEAD time), +# matching the other xcat-dep builders so mockbuild-all.pl can drive this one. +my $repo_root = abs_path("$script_dir/.."); +my $sde = $build_timestamp; +if (!$sde && -f "$repo_root/Gitepoch") { $sde = capture("cat " . sh_quote("$repo_root/Gitepoch")); } +if (!$sde || $sde !~ /^\d+$/) { + $sde = capture("git -C " . sh_quote($repo_root) . " log -1 --format=%ct HEAD 2>/dev/null"); +} +$ENV{SOURCE_DATE_EPOCH} = $sde if defined $sde && $sde =~ /^\d+$/; + my $arch = capture('uname -m'); if (!$mock_cfg) { my $os_id = capture(q{bash -lc 'source /etc/os-release; echo $ID'}); diff --git a/mockbuild-all.pl b/mockbuild-all.pl index 520677a..6343818 100755 --- a/mockbuild-all.pl +++ b/mockbuild-all.pl @@ -221,6 +221,7 @@ my @dep_builders = ( { name => 'ipmitool-xcat', script => "$repo_root/ipmitool/mockbuild.pl" }, { name => 'syslinux-xcat', script => "$repo_root/syslinux/mockbuild.pl" }, { name => 'goconserver', script => "$repo_root/goconserver/mockbuild.pl" }, + { name => 'conserver-xcat', script => "$repo_root/conserver/mockbuild.pl" }, { name => 'xnba-undi', script => "$repo_root/xnba/mockbuild.pl" }, );