From 553e966565af05b921ff057fd68eb5ba5468dd4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Sat, 5 Sep 2026 17:00:21 -0300 Subject: [PATCH] fix(xcat-dep): keep the dependency bootstrap free of File::Slurper The build timeout helper was imported at compile time, and it pulls in XCAT::BuildUtils, which needs File::Slurper. The Ubuntu build hosts do not all carry that module, so every caller began to depend on it -- including --install-deps, whose whole job is to install it on a host that lacks it. The helper is now loaded where it is used. --- BuildUtils.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/BuildUtils.pm b/BuildUtils.pm index 5abf683..4840a84 100644 --- a/BuildUtils.pm +++ b/BuildUtils.pm @@ -17,7 +17,10 @@ use warnings; use Exporter 'import'; use File::Basename qw(basename dirname); use lib dirname(__FILE__) . '/lib'; -use XCAT::BuildUtils qw(run_bounded emulated_build_timeout); +# XCAT::BuildUtils is loaded ON DEMAND, not imported here: it pulls in File::Slurper, which the +# Ubuntu build hosts do not all carry. A compile-time import would make every caller depend on it -- +# including `sbuild-all.pl --install-deps`, the command whose whole job is to install that module on +# a host that lacks it. use File::Copy qw(copy); use File::Path qw(make_path); use Digest::MD5; @@ -744,7 +747,8 @@ sub chroot_build_timeout { my ($target_arch) = (($chroot // '') =~ /^.+-([^-]+)-sbuild$/); my $host_arch = `dpkg --print-architecture 2>/dev/null`; chomp $host_arch; - return emulated_build_timeout($target_arch, $host_arch); + require XCAT::BuildUtils; + return XCAT::BuildUtils::emulated_build_timeout($target_arch, $host_arch); } sub build_deb_in_chroot { @@ -782,7 +786,8 @@ sub build_deb_in_chroot { # "still running" rather than as a defect. Bound it, and print the process tree, each wchan and a # CPU sample before the kill, so the failure says WHY it stopped. my $timeout = defined $a{timeout} ? $a{timeout} : chroot_build_timeout($a{chroot}); - my $r = run_bounded(cmd => $cmd, timeout => $timeout, label => "[$pkg] build in $a{chroot}", + require XCAT::BuildUtils; + my $r = XCAT::BuildUtils::run_bounded(cmd => $cmd, timeout => $timeout, label => "[$pkg] build in $a{chroot}", out => \*STDOUT); die "[$pkg] build TIMED OUT after $r->{elapsed}s (budget ${timeout}s) -- see the stall report above\n" if $r->{timed_out};