perf: use ccache and parallel make, and skip already-built newer-R candidates in bulk #240
Loading…
Reference in a new issue
No description provided.
Delete branch "perf/ccache-and-newer-r-prefilter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Most of a
process-updatesrun is per-package overhead, not compiling.In pipeline 14290 (ubuntu-2204-amd64) the
build-newer-r.Rloop spent about 4s on each of the ~1,100 candidates that already had a binary, and ccache was configured but never actually used.Changes
local/compiler-cache.sh(new): sourced by the build pipelines right after the clone.PATH(/usr/lib/ccache/binon Alpine,/usr/lib64/ccacheon RHEL,/usr/lib/ccacheon Ubuntu). The images call baregcc/g++in Makeconf and/root/.R/Makevars, so this catches every compile, CMake-driven vendored builds included, without replacing the images' Makevars throughR_MAKEVARS_USER.CCACHE_BASEDIR=/tmpandCCACHE_NOHASHDIR=1. R compiles each package in a fresh/tmp/RtmpXXXXXXdir and its default-gputs that dir into the hash, so without these nothing ever hits.CCACHE_COMPILERCHECK=contentso an image rebuild doesn't invalidate the cache.MAKEFLAGS=-j$MAKE_JOBS(default 2).process-updates.yaml,weekly-rebuild-missing.yaml: source the script and setMAKE_JOBS: 3to match their 3-CPU limit.build-all-versions.yaml: source the script (2-CPU limit, so the default of 2 applies).local/newer-r-helpers.R: addnewer_r_outstanding(), which applies bincraft's skip decision in bulk. A candidate is dropped only when a binary that isn't a CRAN source sits at the path its cached ABI verdict routes it to. No cached verdict, or a slot that could not be listed, leaves the package for bincraft.local/build-newer-r.R: before the loop, list the flat slot and this interpreter's per-minor slot once each, read the ABI verdicts in one query, filter withnewer_r_outstanding(), and log how many were skipped.local/tests/test-newer-r-helpers.R: tests for the routing, a sensitive package that only has a flat copy, source fallbacks, unlisted slots and empty inputs.Verification
build-env-ubuntu:jammy,build-env-redhat:9andbuild-env-alpine:3.24images: installingfastmatchtwice from different temp dirs gave 4/4 cache hits on the second build. The same test withoutCCACHE_BASEDIR/CCACHE_NOHASHDIRgave 0 hits.local/testspass;crow lint .crow/andprek run -apass for the changed files.Behaviour change
build-newer-r.Rno longer calls bincraft for candidates that already have a binary at their routed path. Everything else is handled exactly as before.MAKE_JOBS: 1for that pipeline.