From 6ed0fa2ba055e69c8f8f617df92804468a887bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Mon, 24 Aug 2026 13:07:04 -0300 Subject: [PATCH] fix(mockbuild): keep the empty-collection guards ahead of the Genesis release The Genesis release is installed from a verified directory instead of being built here, so counting it before the "did anything build?" checks made those checks unreachable with --genesis-release: a run whose builders had all failed carried seven release packages past the guard, ran createrepo, and copied them into the deployable per-EL tree before assert_required_deps stopped it, naming the missing dependencies rather than the failed builds. Assert on what the run collected first, then add the release. The source-RPM warning was masked the same way and moves with it. --- mockbuild-all.pl | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/mockbuild-all.pl b/mockbuild-all.pl index b7b6634..0949f2c 100755 --- a/mockbuild-all.pl +++ b/mockbuild-all.pl @@ -492,13 +492,17 @@ my ($copied, $skipped_src, $missing_roots) = collect_rpms( dry_run => $dry_run, ); -$copied += install_genesis_release_packages('rpm', $repo_dir) - if $genesis_release && !$dry_run; - +# Assert on what this run BUILT, before the Genesis release is added: the release is +# installed from a verified directory rather than built here, so counting it first would +# let a run whose builders all failed reach createrepo and the deployable tree, and fail +# much later in assert_required_deps naming packages instead of the failed builds. if (!$dry_run && $copied == 0) { die "No binary RPMs were collected. Check build logs and collection roots.\n"; } +$copied += install_genesis_release_packages('rpm', $repo_dir) + if $genesis_release && !$dry_run; + # Ensure the OS-dependent xCAT-genesis-base rpm (built by the genesis step above) # lands in the dep repo even when the full xCAT core is built elsewhere (--skip-xcat). if (!$skip_genesis && !$dry_run) { @@ -520,16 +524,16 @@ my ($copied_srpms, $skipped_non_src, $missing_srpm_roots) = collect_srpms( dry_run => $dry_run, ); +if (!$dry_run && $copied_srpms == 0) { + print "WARN: No source RPMs were collected. SRPM repo and tarball may be empty.\n"; +} + $copied_srpms += install_genesis_release_packages('srpm', $srpm_repo_dir) if $genesis_release && !$dry_run; assert_genesis_release_copied($repo_dir, $srpm_repo_dir) if $genesis_release && !$dry_run; -if (!$dry_run && $copied_srpms == 0) { - print "WARN: No source RPMs were collected. SRPM repo and tarball may be empty.\n"; -} - if (!$skip_createrepo) { run_step( step => 'Run createrepo',