You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/04/05 18:57:35 UTC

[GitHub] [arrow] jonkeane commented on a change in pull request #9896: ARROW-12098: [R] Catch cpp build failures on linux

jonkeane commented on a change in pull request #9896:
URL: https://github.com/apache/arrow/pull/9896#discussion_r607265506



##########
File path: r/R/install-arrow.R
##########
@@ -62,55 +62,50 @@ install_arrow <- function(nightly = FALSE,
   sysname <- tolower(Sys.info()[["sysname"]])
   conda <- isTRUE(grepl("conda", R.Version()$platform))
 
-  if (sysname %in% c("windows", "darwin", "linux")) {
-    if (conda) {
-      if (nightly) {
-        system("conda install -y -c arrow-nightlies -c conda-forge --strict-channel-priority r-arrow")
-      } else {
-        system("conda install -y -c conda-forge --strict-channel-priority r-arrow")
-      }
+  if (conda) {
+    if (nightly) {
+      system("conda install -y -c arrow-nightlies -c conda-forge --strict-channel-priority r-arrow")
     } else {
-      Sys.setenv(
-        LIBARROW_DOWNLOAD = "true",
-        LIBARROW_BINARY = binary,
-        LIBARROW_MINIMAL = minimal,
-        ARROW_R_DEV = verbose,
-        ARROW_USE_PKG_CONFIG = use_system
-      )
-      # On the M1, we can't use the usual autobrew, which pulls Intel dependencies
-      apple_m1 <- grepl("arm-apple|aarch64.*darwin", R.Version()$platform)
-      # On Rosetta, we have to build without JEMALLOC, so we also can't autobrew
-      rosetta <- identical(sysname, "darwin") && identical(system("sysctl -n sysctl.proc_translated", intern = TRUE), "1")
-      if (rosetta) {
-        Sys.setenv(ARROW_JEMALLOC = "OFF")
-      }
-      if (apple_m1 || rosetta) {
-        Sys.setenv(FORCE_BUNDLED_BUILD = "true")
-      }
+      system("conda install -y -c conda-forge --strict-channel-priority r-arrow")
+    }
+  } else {
+    Sys.setenv(
+      LIBARROW_DOWNLOAD = "true",
+      LIBARROW_BINARY = binary,
+      LIBARROW_MINIMAL = minimal,
+      ARROW_R_DEV = verbose,
+      ARROW_USE_PKG_CONFIG = use_system
+    )
+    # On the M1, we can't use the usual autobrew, which pulls Intel dependencies
+    apple_m1 <- grepl("arm-apple|aarch64.*darwin", R.Version()$platform)
+    # On Rosetta, we have to build without JEMALLOC, so we also can't autobrew
+    rosetta <- identical(sysname, "darwin") && identical(system("sysctl -n sysctl.proc_translated", intern = TRUE), "1")
+    if (rosetta) {
+      Sys.setenv(ARROW_JEMALLOC = "OFF")
+    }
+    if (apple_m1 || rosetta) {
+      Sys.setenv(FORCE_BUNDLED_BUILD = "true")
+    }
 
-      opts <- list()
-      if (apple_m1 || rosetta) {
-        # Skip binaries (esp. for rosetta)
-        opts$pkgType <- "source"
-      } else if (isTRUE(binary)) {
-        # Unless otherwise directed, don't consider newer source packages when
-        # options(pkgType) == "both" (default on win/mac)
-        opts$install.packages.check.source <- "no"
-        opts$install.packages.compile.from.source <- "never"
-      }
-      if (length(opts)) {
-        old <- options(opts)
-        on.exit(options(old))
-      }
-      install.packages("arrow", repos = arrow_repos(repos, nightly), ...)
+    opts <- list()
+    if (apple_m1 || rosetta) {
+      # Skip binaries (esp. for rosetta)
+      opts$pkgType <- "source"
+    } else if (isTRUE(binary)) {
+      # Unless otherwise directed, don't consider newer source packages when
+      # options(pkgType) == "both" (default on win/mac)
+      opts$install.packages.check.source <- "no"
+      opts$install.packages.compile.from.source <- "never"
     }
-    if ("arrow" %in% loadedNamespaces()) {
-      # If you've just sourced this file, "arrow" won't be (re)loaded
-      reload_arrow()
+    if (length(opts)) {
+      old <- options(opts)
+      on.exit(options(old))

Review comment:
       This isn't enough to justify it, and I don't think that it's a recursive dependency of anything we currently depend on, but this makes me long for `withr::with_options()`

##########
File path: r/tools/nixlibs.R
##########
@@ -333,10 +333,10 @@ build_libarrow <- function(src_dir, dst_dir) {
     env_vars <- paste(env_vars, "ARROW_JEMALLOC=OFF ARROW_PARQUET=OFF ARROW_DATASET=OFF ARROW_WITH_RE2=OFF ARROW_WITH_UTF8PROC=OFF EXTRA_CMAKE_FLAGS=-DARROW_SIMD_LEVEL=NONE")
   }
   cat("**** arrow", ifelse(quietly, "", paste("with", env_vars)), "\n")
-  status <- system(
+  status <- suppressWarnings(system(

Review comment:
       `suppressWarnings()` makes sense here, though I'm curious what warnings you've seen here in the past?




-- 
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.

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