From 70fde29d745109f46ed03405b66e8cbb960c515d Mon Sep 17 00:00:00 2001 From: pat-s Date: Mon, 13 Jul 2026 09:24:13 +0000 Subject: [PATCH] fix(build-all): exclude previously-errored versions in prefilter Prefilter query only removed successfully-built versions (error_occurred = FALSE), so every previously-errored version stayed in the chunk and was walked one-by-one, each hitting the internal skip in build_binary_package(). Drop the error clause so all attempted versions are filtered out up front, and rename the log to already-attempted so the count is no longer misleadingly 0. --- local/build-all.R | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/local/build-all.R b/local/build-all.R index c0fe7f7..7983be3 100644 --- a/local/build-all.R +++ b/local/build-all.R @@ -64,10 +64,13 @@ sprintf("# of package versions for this job: %s", nrow(chunk)) exclude <- jsonlite::fromJSON("local/excluded-packages.json")[["package"]] chunk <- chunk[!chunk$Package %in% exclude, ] -# Skip package versions already built in a previous run. +# Skip package versions already attempted in a previous run (built or errored). # pkgs_to_build.rds is a static snapshot from the install-deps step, so on a # restart it still lists everything an interrupted run already produced. The # metadata DB reflects that progress, so we re-derive the remaining set here. +# We exclude *all* attempted versions, not just successful ones: a previously +# errored version is skipped by build_binary_package() anyway, so leaving it in +# the chunk only makes the job cycle through it one-by-one for no benefit. # Derive platform + arch from the running container, mirroring the codename -> # platform mapping bincraft uses internally. The OS/OS_VERSION selectors are # workflow-level CI variables that are not injected into the container @@ -104,13 +107,13 @@ con <- DBI::dbConnect( ) built <- DBI::dbGetQuery( con, - "SELECT name, tag FROM single_builds WHERE platform = $1 AND arch = $2 AND error_occurred = FALSE", + "SELECT name, tag FROM single_builds WHERE platform = $1 AND arch = $2", params = list(platform, arch) ) DBI::dbDisconnect(con) before <- nrow(chunk) chunk <- chunk[!paste(chunk$Package, chunk$Version) %in% paste(built$name, built$tag), ] -sprintf("Skipped %d already-built package versions; %d remaining for this job", before - nrow(chunk), nrow(chunk)) +sprintf("Skipped %d already-attempted package versions; %d remaining for this job", before - nrow(chunk), nrow(chunk)) # Read pre-computed S3 listing from install-deps step # This avoids loading s3fs/reticulate/Python in the build container, -- 2.54.0