Skip to content

Commit 54a7416

Browse files
authored
Merge pull request #1259 from RcppCore/fix/source-stderr
switch to system2 to be able to capture stderr on error
2 parents ba4e974 + 64bb627 commit 54a7416

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2023-03-25 Iñaki Ucar <[email protected]>
2+
3+
* R/Attributes.R: Switch to system2 to be able to capture stderr on error
4+
15
2023-03-24 Dirk Eddelbuettel <[email protected]>
26

37
* docker/ci-dev/Dockerfile: During Debian freeze experimental repo is

R/Attributes.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ sourceCpp <- function(file = "",
137137

138138
# prepare the command (output if we are in showOutput mode)
139139
args <- c(
140-
r, "CMD", "SHLIB",
140+
"CMD", "SHLIB",
141141
if (windowsDebugDLL) "-d",
142142
if (rebuild) "--preclean",
143143
if (dryRun) "--dry-run",
@@ -147,13 +147,13 @@ sourceCpp <- function(file = "",
147147
shQuote(src)
148148
)
149149

150-
cmd <- paste(args, collapse = " ")
151150
if (showOutput)
152-
cat(cmd, "\n") # #nocov
151+
cat(paste(c(r, args), collapse = " "), "\n") # #nocov
153152

154153
# execute the build -- suppressWarnings b/c when showOutput = FALSE
155154
# we are going to explicitly check for an error and print the output
156-
result <- suppressWarnings(system(cmd, intern = !showOutput))
155+
so <- if (showOutput) "" else TRUE
156+
result <- suppressWarnings(system2(r, args, stdout = so, stderr = so))
157157

158158
# check build results
159159
if(!showOutput) {

0 commit comments

Comments
 (0)