Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2023-03-25 Iñaki Ucar <iucar@fedoraproject.org>

* R/Attributes.R: Switch to system2 to be able to capture stderr on error

2023-03-24 Dirk Eddelbuettel <edd@debian.org>

* docker/ci-dev/Dockerfile: During Debian freeze experimental repo is
Expand Down
8 changes: 4 additions & 4 deletions R/Attributes.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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) {
Expand Down