From 651243fbf33a315339c3a64e443b3fe987cd7ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Sun, 6 Sep 2026 02:44:58 -0300 Subject: [PATCH] fix(xcat-dep): drop a deb that fails its smoke The debs land in staging before the smoke runs, and the publish gate checks names and versions only. A deb whose binary could not run therefore stayed in staging and was eligible for publication, which is the case the smoke exists to catch. The failure now removes the debs it rejected and says so. --- BuildUtils.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/BuildUtils.pm b/BuildUtils.pm index 04c24a1..e8fc965 100644 --- a/BuildUtils.pm +++ b/BuildUtils.pm @@ -801,7 +801,17 @@ sub build_deb_in_chroot { die "[$pkg] build succeeded in the chroot but no .deb is visible at $a{result_dir} on the host\n" . " (is --result-dir on a path bind-mounted into the chroot, e.g. under /opt/xcat-ci-shared?)\n" unless @debs; - smoke_deb_in_chroot(%a, debs => \@debs) if $a{smoke}; + if ($a{smoke}) { + # The debs are already in staging, and the publish gate checks names and versions, not + # whether the binary runs. A deb that fails the smoke must not survive the failure, or the + # next publish ships exactly the broken binary the smoke exists to catch. + my $ok = eval { smoke_deb_in_chroot(%a, debs => \@debs); 1 }; + unless ($ok) { + my $err = $@ || "unknown smoke failure\n"; + unlink @debs; + die $err . "[$pkg] the debs were removed from $a{result_dir}: they did not pass the smoke\n"; + } + } print "[$pkg] OK (" . scalar(@debs) . " deb(s) in $a{result_dir})\n"; return scalar @debs; }