fix(build): scope the already-attempted skip to the running R minor

single_builds records r_version per attempt, but the skip query ignored
it and matched on platform and arch alone. A non-primary pass therefore
skipped every package the primary pass had already attempted under a
different minor: build-all.R --sensitive-only under R 4.6 skipped
packages that had only ever been built for 4.5, so the per-minor slots
never filled and the backlog could not be worked off by rebuilding.

That is why amd64/resolute serves a 4.6 client 22322 packages against
the 4.5 slot's 26346, and why the run intended to close that gap
reported 'Skipped 2334 already-attempted package versions; 59 remaining'.

Matching on the major.minor prefix rather than the full string keeps a
patch bump (4.6.0 -> 4.6.1) from re-attempting the whole catalogue.
This commit is contained in:
Patrick Schratz 2026-08-31 13:33:39 +00:00
commit b5b6221b80
No known key found for this signature in database
GPG key ID: 62050D5BC68AB6DC

View file

@ -110,10 +110,25 @@ con <- DBI::dbConnect(
password = Sys.getenv("PGPASS"), password = Sys.getenv("PGPASS"),
sslmode = "require" sslmode = "require"
) )
# Scope the skip to the R minor this pass is running under. `single_builds`
# records `r_version` per attempt, but querying without it made a non-primary
# pass skip everything the primary pass had already attempted under a different
# minor - so `--sensitive-only` under 4.6 skipped packages that had only ever
# been built for 4.5, and the per-minor slots never filled. That is why
# amd64/resolute served 4000 fewer packages to a 4.6 client than to a 4.5 one.
r_minor <- paste(
R.version$major,
strsplit(R.version$minor, ".", fixed = TRUE)[[1L]][1L],
sep = "."
)
built <- DBI::dbGetQuery( built <- DBI::dbGetQuery(
con, con,
"SELECT name, tag FROM single_builds WHERE platform = $1 AND arch = $2", paste(
params = list(platform, arch) "SELECT name, tag FROM single_builds",
"WHERE platform = $1 AND arch = $2",
"AND substring(r_version from '^[0-9]+[.][0-9]+') = $3"
),
params = list(platform, arch, r_minor)
) )
DBI::dbDisconnect(con) DBI::dbDisconnect(con)
before <- nrow(chunk) before <- nrow(chunk)
@ -121,8 +136,9 @@ chunk <- chunk[
!paste(chunk$Package, chunk$Version) %in% paste(built$name, built$tag), !paste(chunk$Package, chunk$Version) %in% paste(built$name, built$tag),
] ]
sprintf( sprintf(
"Skipped %d already-attempted package versions; %d remaining for this job", "Skipped %d package versions already attempted under R %s; %d remaining for this job",
before - nrow(chunk), before - nrow(chunk),
r_minor,
nrow(chunk) nrow(chunk)
) )