From fe498adf316dbf0e5d1ff8b2b18090b6b731d6f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20=C3=9Acar?= Date: Sat, 25 Mar 2023 11:37:23 +0100 Subject: [PATCH 1/2] switch to system2 to be able to capture stderr on error --- R/Attributes.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/Attributes.R b/R/Attributes.R index 472442525..523620862 100644 --- a/R/Attributes.R +++ b/R/Attributes.R @@ -137,7 +137,7 @@ sourceCpp <- function(file = "", # prepare the command (output if we are in showOutput mode) args <- c( - r, "CMD", "SHLIB", + "CMD", "SHLIB", if (windowsDebugDLL) "-d", if (rebuild) "--preclean", if (dryRun) "--dry-run", @@ -147,13 +147,13 @@ sourceCpp <- function(file = "", shQuote(src) ) - cmd <- paste(args, collapse = " ") if (showOutput) - cat(cmd, "\n") # #nocov + cat(paste(c(r, args), collapse = " "), "\n") # #nocov # execute the build -- suppressWarnings b/c when showOutput = FALSE # we are going to explicitly check for an error and print the output - result <- suppressWarnings(system(cmd, intern = !showOutput)) + so <- if (showOutput) "" else TRUE + result <- suppressWarnings(system2(r, args, stdout = so, stderr = so)) # check build results if(!showOutput) { From 64bb6275978e85aa97bfcba61d6c1802d0930910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20=C3=9Acar?= Date: Sat, 25 Mar 2023 11:39:09 +0100 Subject: [PATCH 2/2] update ChangeLog --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index bc2b05444..71d2c810b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2023-03-25 IƱaki Ucar + + * R/Attributes.R: Switch to system2 to be able to capture stderr on error + 2023-03-24 Dirk Eddelbuettel * docker/ci-dev/Dockerfile: During Debian freeze experimental repo is