fix(build): stop per-minor objects masking the per-minor candidate list
Two omissions in the snapshot, both the same shape as the ones already fixed downstream. s3_dir_ls(recurse = TRUE) walks the per-minor slots, and basename() throws the directory away, so 4.5/curl_1.0.tar.gz and curl_1.0.tar.gz collapse to one name. A package present under any R minor then counts as built for all of them, and the candidate list prunes exactly the packages a per-minor pass exists to build. arm64/alpine324 reported '0 remaining' for both 4.4 and 4.6 while the same run's indexes dropped 2407 and 2436 packages as missing for those minors. Per-minor objects are excluded here and presence is decided downstream, where the running R version is known: build-all.R filters on it and build_binary_package() checks the per-minor path per package. Archive/ is kept, or every superseded version would look unbuilt. The error query also matched on name, tag, platform and arch only, so a failure under the primary minor dropped the package from every other minor's candidate list. Same omission as local/build-all.R and bincraft's check_package_error(); this is the third and last consumer of that table.
This commit is contained in:
parent
213d30cea4
commit
084573b334
1 changed files with 35 additions and 3 deletions
|
|
@ -116,7 +116,28 @@ s3_pkgs <- s3fs::s3_dir_ls(
|
|||
recurse = TRUE
|
||||
)
|
||||
|
||||
file_names <- basename(s3_pkgs)
|
||||
# `recurse = TRUE` walks the per-minor slots as well, and `basename()` throws
|
||||
# the directory away - so `4.5/curl_1.0.tar.gz` and `curl_1.0.tar.gz` collapse
|
||||
# to one name and a package present under *any* R minor counts as built for
|
||||
# *all* of them. The candidate list then prunes exactly the packages a
|
||||
# per-minor pass exists to build: arm64/alpine324 reported "0 remaining" for
|
||||
# both 4.4 and 4.6 while its indexes were dropping 2400+ packages as missing.
|
||||
#
|
||||
# Per-minor objects are therefore excluded here. Presence in a specific minor
|
||||
# is decided downstream, where the running R version is known: build-all.R
|
||||
# filters on it, and `build_binary_package()` checks the per-minor path per
|
||||
# package and skips what is already there.
|
||||
#
|
||||
# Archive/ is kept. Those are versions that were built and then superseded;
|
||||
# dropping them would make every archived version look unbuilt.
|
||||
per_minor_object <- grepl("/[0-9]+\\.[0-9]+/[^/]+$", s3_pkgs)
|
||||
if (any(per_minor_object)) {
|
||||
cat(sprintf(
|
||||
"Excluding %d per-minor object(s) from the presence check; those are decided per pass\n",
|
||||
sum(per_minor_object)
|
||||
))
|
||||
}
|
||||
file_names <- basename(s3_pkgs[!per_minor_object])
|
||||
|
||||
# An object occupying a key is not proof a binary was built: a package whose
|
||||
# build failed has its CRAN source published under exactly that name. Left in
|
||||
|
|
@ -179,11 +200,22 @@ s3_dt <- data.table(
|
|||
|
||||
### Get all packages with build errors
|
||||
|
||||
# Scoped to the R minor this snapshot is computed under. A failure is a fact
|
||||
# about one interpreter: without the scope a package that failed under the
|
||||
# primary minor is dropped from the candidate list for every other minor too,
|
||||
# which is the same omission fixed in local/build-all.R and in bincraft's
|
||||
# check_package_error().
|
||||
snapshot_r_minor <- paste(
|
||||
R.version$major,
|
||||
strsplit(R.version$minor, ".", fixed = TRUE)[[1L]][1L],
|
||||
sep = "."
|
||||
)
|
||||
sql_query <- paste0(
|
||||
# nolint
|
||||
"SELECT error_occurred FROM ",
|
||||
"single_builds",
|
||||
" WHERE name = $1 AND tag = $2 AND platform = $3 AND arch = $4"
|
||||
" WHERE name = $1 AND tag = $2 AND platform = $3 AND arch = $4",
|
||||
" AND substring(r_version from '^[0-9]+[.][0-9]+') = $5"
|
||||
)
|
||||
# Function to query for a single package-version
|
||||
query_error <- function(pkg, ver) {
|
||||
|
|
@ -191,7 +223,7 @@ query_error <- function(pkg, ver) {
|
|||
~ DBI::dbGetQuery(
|
||||
con,
|
||||
sql_query,
|
||||
params = list(pkg, ver, platform, arch)
|
||||
params = list(pkg, ver, platform, arch, snapshot_r_minor)
|
||||
),
|
||||
rate = purrr::rate_backoff(
|
||||
pause_base = 1L,
|
||||
|
|
|
|||
Loading…
Reference in a new issue