From b4b7d53a832fc8d041849169fc94077679c88c1c Mon Sep 17 00:00:00 2001 From: pat-s Date: Sat, 18 Jul 2026 08:37:04 +0000 Subject: [PATCH] fix(local): make trial-build-patch.R detect non-throwing build failures (#134) `local/trial-build-patch.R` -- the single-package acceptance gate the proposer prints for humans to run (`PGPASS=... Rscript local/trial-build-patch.R `) -- reported **`Trial build OK`** for rstan even though rstan.so failed to load (`symbol not found: tbb::detail::r1::observe`). Same false-green as the registry gate before #130: `build_binary_package()` catches failures internally and returns `"error"` rather than throwing, so a `tryCatch` that only treats a thrown exception as failure passes a broken build. Now inspects the return value (mirrors trial-build-registry.R). Found while verifying the rstan/oneTBB unblock. Reviewed-on: https://git.devxy.io/devxy/build-cran-binaries/pulls/134 --- local/trial-build-patch.R | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/local/trial-build-patch.R b/local/trial-build-patch.R index 4e8030a..2229074 100644 --- a/local/trial-build-patch.R +++ b/local/trial-build-patch.R @@ -40,23 +40,26 @@ cat(sprintf( patches_dir )) -ok <- tryCatch( - { - bincraft::build_binary_package( - package, - tag_limit = 1L, - patches = patches_dir, - archive = FALSE, - upload = FALSE, - store_build_metadata = FALSE - ) - TRUE - }, +# build_binary_package() catches build failures internally and RETURNS "error" +# for the failed tag rather than throwing (bincraft >= v4.4.7), so inspect the +# return value -- checking only for a thrown exception reports a broken build as +# passing (false green). +res <- tryCatch( + bincraft::build_binary_package( + package, + tag_limit = 1L, + patches = patches_dir, + archive = FALSE, + upload = FALSE, + store_build_metadata = FALSE + ), error = function(e) { - cat(sprintf("Trial build FAILED: %s\n", conditionMessage(e))) - FALSE + cat(sprintf("Trial build FAILED (threw): %s\n", conditionMessage(e))) + "error" } ) +flat <- as.character(unlist(res)) +ok <- length(flat) > 0L && !("error" %in% flat) if (ok) { cat(sprintf("Trial build OK: %s builds with the proposed patch.\n", package))