feat(full): classify r-minor sensitivity in install-deps precompute
This commit is contained in:
parent
dbf26d7786
commit
34173a6722
3 changed files with 43 additions and 2 deletions
|
|
@ -35,7 +35,7 @@ steps:
|
||||||
- git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
|
- git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
|
||||||
- git clone -q https://codefloe.com/rpkgs/bincraft.git /tmp/bincraft
|
- git clone -q https://codefloe.com/rpkgs/bincraft.git /tmp/bincraft
|
||||||
- /opt/R/$R_VERSION/bin/R -q -e 'pak::sysreqs_db_update(); pak::local_install("/tmp/bincraft"); pak::pak(c("RPostgres", "s3fs", "data.table", "future", "jsonlite")); packageVersion("bincraft")'
|
- /opt/R/$R_VERSION/bin/R -q -e 'pak::sysreqs_db_update(); pak::local_install("/tmp/bincraft"); pak::pak(c("RPostgres", "s3fs", "data.table", "future", "jsonlite")); packageVersion("bincraft")'
|
||||||
- /opt/R/$R_VERSION/bin/R -q -e "source('local/packages-to-build.R'); saveRDS(pkgs, '/mnt/cache/packages/pkgs_to_build.rds'); sprintf('Precomputed %s package versions to build', nrow(pkgs))"
|
- /opt/R/$R_VERSION/bin/R -q -e "source('local/packages-to-build.R'); saveRDS(pkgs, '/mnt/cache/packages/pkgs_to_build.rds'); saveRDS(pkgs[r_minor_sensitive == TRUE], '/mnt/cache/packages/r_minor_sensitive_pkgs.rds'); sprintf('Precomputed %s package versions (%s r-minor-sensitive)', nrow(pkgs), nrow(pkgs[r_minor_sensitive == TRUE]))"
|
||||||
backend_options:
|
backend_options:
|
||||||
docker:
|
docker:
|
||||||
resources:
|
resources:
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ steps:
|
||||||
- git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
|
- git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
|
||||||
- git clone -q https://codefloe.com/rpkgs/bincraft.git /tmp/bincraft
|
- git clone -q https://codefloe.com/rpkgs/bincraft.git /tmp/bincraft
|
||||||
- /opt/R/$R_VERSION/bin/R -q -e 'pak::sysreqs_db_update(); pak::local_install("/tmp/bincraft"); pak::pak(c("RPostgres", "s3fs", "data.table", "future", "jsonlite")); packageVersion("bincraft")'
|
- /opt/R/$R_VERSION/bin/R -q -e 'pak::sysreqs_db_update(); pak::local_install("/tmp/bincraft"); pak::pak(c("RPostgres", "s3fs", "data.table", "future", "jsonlite")); packageVersion("bincraft")'
|
||||||
- /opt/R/$R_VERSION/bin/R -q -e "source('local/packages-to-build.R'); saveRDS(pkgs, '/mnt/cache/packages/pkgs_to_build.rds'); sprintf('Precomputed %s package versions to build', nrow(pkgs))"
|
- /opt/R/$R_VERSION/bin/R -q -e "source('local/packages-to-build.R'); saveRDS(pkgs, '/mnt/cache/packages/pkgs_to_build.rds'); saveRDS(pkgs[r_minor_sensitive == TRUE], '/mnt/cache/packages/r_minor_sensitive_pkgs.rds'); sprintf('Precomputed %s package versions (%s r-minor-sensitive)', nrow(pkgs), nrow(pkgs[r_minor_sensitive == TRUE]))"
|
||||||
backend_options:
|
backend_options:
|
||||||
docker:
|
docker:
|
||||||
resources:
|
resources:
|
||||||
|
|
|
||||||
|
|
@ -140,3 +140,44 @@ pkgs <- pkgs_no_error[!s3_dt]
|
||||||
# Deduplicate
|
# Deduplicate
|
||||||
pkgs <- unique(pkgs)
|
pkgs <- unique(pkgs)
|
||||||
setorder(pkgs, Package, Version)
|
setorder(pkgs, Package, Version)
|
||||||
|
|
||||||
|
### R-minor sensitivity (classify once per package, applied to all versions)
|
||||||
|
source(file.path("local", "r-minor-helpers.R"))
|
||||||
|
risky_deps <- bincraft::abi_risky_linking_deps()
|
||||||
|
|
||||||
|
release_meta <- data.table(
|
||||||
|
Package = cran_release$Package,
|
||||||
|
NeedsCompilation = cran_release$NeedsCompilation,
|
||||||
|
LinkingTo = cran_release$LinkingTo
|
||||||
|
)
|
||||||
|
|
||||||
|
meta <- release_meta[Package %in% unique(pkgs$Package)]
|
||||||
|
meta[, triage := mapply(
|
||||||
|
classify_from_metadata,
|
||||||
|
NeedsCompilation,
|
||||||
|
LinkingTo,
|
||||||
|
MoreArgs = list(risky_deps = risky_deps)
|
||||||
|
)]
|
||||||
|
|
||||||
|
# Only the "ambiguous" compiled packages need a source grep.
|
||||||
|
ambiguous <- meta[triage == "ambiguous", Package]
|
||||||
|
sensitive_ambiguous <- character()
|
||||||
|
if (length(ambiguous) > 0L) {
|
||||||
|
tmp_src <- file.path(tempdir(), "abi_src")
|
||||||
|
dir.create(tmp_src, showWarnings = FALSE, recursive = TRUE)
|
||||||
|
sens <- vapply(ambiguous, function(pkg) {
|
||||||
|
out <- tryCatch({
|
||||||
|
dl <- utils::download.packages(
|
||||||
|
pkg, destdir = tmp_src,
|
||||||
|
repos = "https://cloud.r-project.org", quiet = TRUE
|
||||||
|
)
|
||||||
|
isTRUE(as.logical(bincraft::needs_per_minor_recompile(dl[1L, 2L])))
|
||||||
|
}, error = function(e) TRUE) # fail safe: treat as sensitive
|
||||||
|
out
|
||||||
|
}, logical(1L))
|
||||||
|
sensitive_ambiguous <- ambiguous[sens]
|
||||||
|
}
|
||||||
|
|
||||||
|
sensitive_pkgs <- unique(c(meta[triage == "sensitive", Package], sensitive_ambiguous))
|
||||||
|
pkgs[, r_minor_sensitive := Package %in% sensitive_pkgs]
|
||||||
|
sprintf("R-minor-sensitive packages: %s of %s", length(sensitive_pkgs), uniqueN(pkgs$Package))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue