diff --git a/local/build-one.R b/local/build-one.R index 07c0b6a..830231e 100644 --- a/local/build-one.R +++ b/local/build-one.R @@ -30,43 +30,21 @@ s3 <- list( s3_secret_access_key = Sys.getenv("B2_S3_SECRET_KEY") ) -# Clone the CRAN source for a version and ask the ABI classifier whether it -# must be rebuilt per R minor. Fails safe to TRUE so a possibly-fragile binary -# is never served from the cross-minor generic slot by mistake. +# Ask bincraft's ABI classifier whether a version must be rebuilt per R minor. +# The classifier downloads the CRAN source tarball (no GitHub) and caches the +# verdict in the metadata DB keyed on package+version, so repeated runs and +# new-OS rebuilds reuse it. Fails safe to TRUE inside bincraft so a +# possibly-fragile binary is never served from the cross-minor generic slot. classify <- function(pkg, ver) { - dest <- file.path(tempdir(), sprintf("classify_%s_%s", pkg, ver)) - on.exit(unlink(dest, recursive = TRUE, force = TRUE), add = TRUE) - tryCatch( - { - message(sprintf( - "[classify] cloning %s@%s from github.com/cran ...", - pkg, - ver - )) - system2( - "git", - c( - "clone", - "--depth", - "1", - "--branch", - ver, - sprintf("https://github.com/cran/%s", pkg), - dest - ) - ) - message(sprintf("[classify] running ABI classifier on %s ...", pkg)) - isTRUE(as.logical(bincraft::needs_per_minor_recompile(dest))) - }, - error = function(e) { - message(sprintf( - "classify failed for %s %s: %s; treating as r-minor-sensitive", - pkg, - ver, - conditionMessage(e) - )) - TRUE - } + bincraft::classify_r_minor_sensitive( + pkg, + ver, + metadata_db_host = "r-binaries.devxy.io", + metadata_db_name = "build_metadata", + metadata_db_port = 15432, + metadata_db_user = "rpkgs", + metadata_db_password = Sys.getenv("PGPASS"), + metadata_db_sslmode = "require" ) }