feat(local): just rebuild builds across all installed R minors
- Dockerfile: install bincraft into each R minor, run a primary pass plus a sensitive-only pass under every other /opt/R/[0-9]* minor (deduped by minor), probe/skip xvfb, set GIT_TERMINAL_PROMPT=0; extra-minor failures are non-fatal. - build-one.R: add --sensitive-only mode, log + shallow-clone the ABI classify step, and clear cranlike's stale ./PACKAGES.db before each index refresh (workaround for the "table packages already exists" bug; pending cranlike fix).
This commit is contained in:
parent
e5398af5f5
commit
3ae4672d66
1 changed files with 65 additions and 7 deletions
|
|
@ -25,8 +25,36 @@ RUN --mount=type=secret,id=b2_access,required=true \
|
|||
export B2_S3_SECRET_KEY="$(cat /run/secrets/b2_secret)" && \
|
||||
export PGPASS="$(cat /run/secrets/pgpass)" && \
|
||||
export GITHUB_PAT="$(cat /run/secrets/github_pat 2>/dev/null || true)" && \
|
||||
/opt/R/${R_VERSION}/bin/R -q -e 'if (!requireNamespace("bincraft", quietly = TRUE) || packageVersion("bincraft") != "4.2.0") pak::pak("git::https://codefloe.com/rpkgs/bincraft.git@v4.2.0")' && \
|
||||
XVFB=$(command -v xwfb-run 2>/dev/null || command -v xvfb-run); \
|
||||
export GIT_TERMINAL_PROMPT=0 && \
|
||||
export OTEL_SDK_DISABLED=true && \
|
||||
XVFB=$(command -v xwfb-run 2>/dev/null || command -v xvfb-run || true); \
|
||||
XVFB_ARGS=""; \
|
||||
if command -v xwfb-run >/dev/null 2>&1; then dnf install -y -q weston 2>/dev/null; XVFB_ARGS="-c weston"; fi; \
|
||||
$XVFB $XVFB_ARGS -- /opt/R/${R_VERSION}/bin/Rscript /work/build-one.R "${PACKAGE}" ${VERSIONS}
|
||||
USE_XVFB=0; \
|
||||
if [ -n "$XVFB" ] && $XVFB -a $XVFB_ARGS -- true >/dev/null 2>&1; then \
|
||||
USE_XVFB=1; echo "Using virtual display via $XVFB"; \
|
||||
else \
|
||||
echo "No working virtual display; building without xvfb" >&2; \
|
||||
fi; \
|
||||
run_build() { if [ "$USE_XVFB" = 1 ]; then $XVFB -a $XVFB_ARGS -- "$@"; else "$@"; fi; }; \
|
||||
ensure_bincraft() { "$1" -q -e 'if (!requireNamespace("bincraft", quietly = TRUE) || packageVersion("bincraft") != "4.2.1") pak::pak("git::https://codefloe.com/rpkgs/bincraft.git@v4.2.1")'; }; \
|
||||
PRIMARY_MINOR=$(echo "$R_VERSION" | cut -d. -f1-2); \
|
||||
seen=" $PRIMARY_MINOR "; \
|
||||
prc=0; failed=""; \
|
||||
echo "=== primary pass under R $R_VERSION ==="; \
|
||||
ensure_bincraft /opt/R/${R_VERSION}/bin/R; \
|
||||
run_build /opt/R/${R_VERSION}/bin/Rscript /work/build-one.R "${PACKAGE}" ${VERSIONS} || prc=$?; \
|
||||
for RBIN in /opt/R/*/bin/Rscript; do \
|
||||
[ -x "$RBIN" ] || continue; \
|
||||
RV=$(basename "$(dirname "$(dirname "$RBIN")")"); \
|
||||
case "$RV" in [0-9]*) ;; *) continue ;; esac; \
|
||||
RMINOR=$(echo "$RV" | cut -d. -f1-2); \
|
||||
case "$seen" in *" $RMINOR "*) continue ;; esac; \
|
||||
seen="$seen$RMINOR "; \
|
||||
echo "=== sensitive-only pass under R $RV ==="; \
|
||||
ensure_bincraft "$(dirname "$RBIN")/R"; \
|
||||
run_build "$RBIN" /work/build-one.R --sensitive-only "${PACKAGE}" ${VERSIONS} || failed="$failed $RV"; \
|
||||
done; \
|
||||
if [ -n "$failed" ]; then echo "WARNING: extra-minor build(s) failed (non-fatal; e.g. a version too old to compile on a newer R):$failed" >&2; fi; \
|
||||
if [ "$prc" != 0 ]; then echo "primary pass under R $R_VERSION failed (exit $prc)" >&2; fi; \
|
||||
exit "$prc"
|
||||
|
|
|
|||
Loading…
Reference in a new issue