fix(local): make trial-build-patch.R detect non-throwing build failures
local/trial-build-patch.R -- the single-package acceptance gate the proposer tells humans to run -- reported "Trial build OK" for a build that actually failed (rstan's rstan.so failing to load with an undefined TBB symbol). Same root cause 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 false-greens. Inspect the return value: a pass requires a non-empty result containing no "error" sentinel. Mirrors the fix in trial-build-registry.R.
This commit is contained in:
parent
a30c6f9532
commit
3d3c4c462a
1 changed files with 17 additions and 14 deletions
|
|
@ -40,8 +40,11 @@ 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
|
||||||
|
# return value -- checking only for a thrown exception reports a broken build as
|
||||||
|
# passing (false green).
|
||||||
|
res <- tryCatch(
|
||||||
bincraft::build_binary_package(
|
bincraft::build_binary_package(
|
||||||
package,
|
package,
|
||||||
tag_limit = 1L,
|
tag_limit = 1L,
|
||||||
|
|
@ -49,14 +52,14 @@ ok <- tryCatch(
|
||||||
archive = FALSE,
|
archive = FALSE,
|
||||||
upload = FALSE,
|
upload = FALSE,
|
||||||
store_build_metadata = FALSE
|
store_build_metadata = FALSE
|
||||||
)
|
),
|
||||||
TRUE
|
|
||||||
},
|
|
||||||
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))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue