Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-34105: [R] Provide extra output for failed builds #37698

Closed
wants to merge 1 commit into from
Closed
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
18 changes: 10 additions & 8 deletions r/tools/nixlibs.R
Original file line number Diff line number Diff line change
Expand Up @@ -473,17 +473,19 @@ build_libarrow <- function(src_dir, dst_dir) {
env_vars <- env_vars_as_string(env_var_list)

cat("**** arrow", ifelse(quietly, "", paste("with", env_vars)), "\n")
status <- suppressWarnings(system(

status <- suppressWarnings(system2(
paste(env_vars, "inst/build_arrow_static.sh"),
ignore.stdout = quietly, ignore.stderr = quietly
stdout = ifelse(quietly, NULL, TRUE),
stderr = ifelse(quietly, NULL, TRUE)
Comment on lines +479 to +480
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not certain I follow the logic, but I think this is what you want

Suggested change
stdout = ifelse(quietly, NULL, TRUE),
stderr = ifelse(quietly, NULL, TRUE)
# If running quietly, capture stdout/stderr so it doesn't print,
# else print to the console
stdout = ifelse(quietly, TRUE, ""),
stderr = ifelse(quietly, TRUE, "")

))
if (status != 0) {
if (!is.null(attr(status, "status"))) {
# It failed :(
cat(
"**** Error building Arrow C++.",
ifelse(env_is("ARROW_R_DEV", "true"), "", "Re-run with ARROW_R_DEV=true for debug information."),
"\n"
)
cat("**** Error building Arrow C++.", "\n")
if (!env_is("ARROW_R_DEV", "true")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above: quietly <- !env_is("ARROW_R_DEV", "true")

Suggested change
if (!env_is("ARROW_R_DEV", "true")) {
if (quietly) {

cat(status, fill = TRUE)
cat("Re-run with ARROW_R_DEV=true for more detailed debug information.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary anymore, is it?

Suggested change
cat("Re-run with ARROW_R_DEV=true for more detailed debug information.")

}
}
invisible(status)
}
Expand Down
Loading