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 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) {