fix(local): make trial-build-patch.R detect non-throwing build failures #134

Merged
pat-s merged 1 commit from t3code/fix-trial-build-patch-falsegreen into main 2026-07-18 08:37:05 +00:00

View file

@ -40,23 +40,26 @@ cat(sprintf(
patches_dir patches_dir
)) ))
ok <- tryCatch( # build_binary_package() catches build failures internally and RETURNS "error"
{ # for the failed tag rather than throwing (bincraft >= v4.4.7), so inspect the
bincraft::build_binary_package( # return value -- checking only for a thrown exception reports a broken build as
package, # passing (false green).
tag_limit = 1L, res <- tryCatch(
patches = patches_dir, bincraft::build_binary_package(
archive = FALSE, package,
upload = FALSE, tag_limit = 1L,
store_build_metadata = FALSE patches = patches_dir,
) archive = FALSE,
TRUE upload = FALSE,
}, store_build_metadata = FALSE
),
error = function(e) { error = function(e) {
cat(sprintf("Trial build FAILED: %s\n", conditionMessage(e))) cat(sprintf("Trial build FAILED (threw): %s\n", conditionMessage(e)))
FALSE "error"
} }
) )
flat <- as.character(unlist(res))
ok <- length(flat) > 0L && !("error" %in% flat)
if (ok) { if (ok) {
cat(sprintf("Trial build OK: %s builds with the proposed patch.\n", package)) cat(sprintf("Trial build OK: %s builds with the proposed patch.\n", package))