You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "nealrichardson (via GitHub)" <gi...@apache.org> on 2023/09/14 13:36:47 UTC

[GitHub] [arrow] nealrichardson commented on a diff in pull request #37698: GH-34105: [R] Provide extra output for failed builds

nealrichardson commented on code in PR #37698:
URL: https://github.com/apache/arrow/pull/37698#discussion_r1325964119


##########
r/tools/nixlibs.R:
##########
@@ -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)
   ))
-  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")) {

Review Comment:
   See above: `quietly <- !env_is("ARROW_R_DEV", "true")`
   
   ```suggestion
       if (quietly) {
   ```



##########
r/tools/nixlibs.R:
##########
@@ -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)
   ))
-  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")) {
+      cat(status, fill = TRUE)
+      cat("Re-run with ARROW_R_DEV=true for more detailed debug information.")

Review Comment:
   Not necessary anymore, is it?
   
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org