diff --git a/r/DESCRIPTION b/r/DESCRIPTION index 6062a8c4f468..c9f84e2e794c 100644 --- a/r/DESCRIPTION +++ b/r/DESCRIPTION @@ -43,7 +43,7 @@ Imports: utils, vctrs Roxygen: list(markdown = TRUE, r6 = FALSE, load = "source") -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 Config/testthat/edition: 3 Config/build/bootstrap: TRUE Suggests: diff --git a/r/R/arrow-info.R b/r/R/arrow-info.R index 54145b2ee120..916b6683fbcc 100644 --- a/r/R/arrow-info.R +++ b/r/R/arrow-info.R @@ -139,7 +139,8 @@ arrow_with_json <- function() { some_features_are_off <- function(features) { # `features` is a named logical vector (as in arrow_info()$capabilities) # Let's exclude some less relevant ones - blocklist <- c("lzo", "bz2", "brotli", "substrait") + # jemalloc is only included because it is sometimes disabled in our build process + blocklist <- c("lzo", "bz2", "brotli", "substrait", "jemalloc") # Return TRUE if any of the other features are FALSE !all(features[setdiff(names(features), blocklist)]) } diff --git a/r/R/arrow-package.R b/r/R/arrow-package.R index 54e237192e08..f6977e626276 100644 --- a/r/R/arrow-package.R +++ b/r/R/arrow-package.R @@ -182,37 +182,54 @@ configure_tzdb <- function() { .onAttach <- function(libname, pkgname) { # Just to be extra safe, let's wrap this in a try(); # we don't want a failed startup message to prevent the package from loading - try({ - # On macOS only, Check if we are running in under emulation, and warn this will not work - if (on_rosetta()) { - packageStartupMessage( - paste( - "Warning:", - " It appears that you are running R and Arrow in emulation (i.e. you're", - " running an Intel version of R on a non-Intel mac). This configuration is", - " not supported by arrow, you should install a native (arm64) build of R", - " and use arrow with that. See https://cran.r-project.org/bin/macosx/", - "", - sep = "\n" + try( + { + # On macOS only, Check if we are running in under emulation, and warn this will not work + if (on_rosetta()) { + packageStartupMessage( + paste( + "Warning:", + " It appears that you are running R and Arrow in emulation (i.e. you're", + " running an Intel version of R on a non-Intel mac). This configuration is", + " not supported by arrow, you should install a native (arm64) build of R", + " and use arrow with that. See https://cran.r-project.org/bin/macosx/", + "", + sep = "\n" + ) ) - ) - } + } - features <- arrow_info()$capabilities - # That has all of the #ifdef features, plus the compression libs and the - # string libraries (but not the memory allocators, they're added elsewhere) - # - # Let's print a message if some are off - if (some_features_are_off(features)) { - packageStartupMessage( - paste( - "Some features are not enabled in this build of Arrow.", - "Run `arrow_info()` for more information." + features <- arrow_info()$capabilities + # That has all of the #ifdef features, plus the compression libs and the + # string libraries (but not the memory allocators, they're added elsewhere) + # + # Let's print a message if some are off + if (some_features_are_off(features)) { + packageStartupMessage( + paste( + "Some features are not enabled in this build of Arrow.", + "Run `arrow_info()` for more information." + ) ) - ) - } - }, silent = TRUE) + # On macOS binaries from CRAN can be hobbled. They sometimes restrict access to our + # dependency source downloading even though we can build from source on their machines. + # They also refuse to allow libarrow binaries to be downloaded, so instead distribute + # hobbled arrow binaries + # If on macOS, and features are disabled, advise that reinstalling might help + if (identical(tolower(Sys.info()[["sysname"]]), "darwin")) { + packageStartupMessage( + paste0( + "The repository you retrieved Arrow from did not include all of Arrow's features.\n", + "You can install a fully-featured version by running:\n", + "`install.packages('arrow', repos = 'https://apache.r-universe.dev')`." + ) + ) + } + } + }, + silent = TRUE + ) } # Clean up the StopSource that was registered in .onLoad() so that if the diff --git a/r/R/install-arrow.R b/r/R/install-arrow.R index 74d3a9645477..44b876537490 100644 --- a/r/R/install-arrow.R +++ b/r/R/install-arrow.R @@ -76,22 +76,14 @@ install_arrow <- function(nightly = FALSE, 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 <- on_rosetta() - if (rosetta) { + # On Rosetta, we have to build without JEMALLOC + if (on_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)) { + 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" diff --git a/r/man/arrow-package.Rd b/r/man/arrow-package.Rd index 15f672a1fe94..41ec7956fe81 100644 --- a/r/man/arrow-package.Rd +++ b/r/man/arrow-package.Rd @@ -18,15 +18,15 @@ Useful links: } \author{ -\strong{Maintainer}: Nic Crane \email{thisisnic@gmail.com} +\strong{Maintainer}: Jonathan Keane \email{jkeane@gmail.com} Authors: \itemize{ \item Neal Richardson \email{neal.p.richardson@gmail.com} \item Ian Cook \email{ianmcook@gmail.com} + \item Nic Crane \email{thisisnic@gmail.com} \item Dewey Dunnington \email{dewey@fishandwhistle.net} (\href{https://orcid.org/0000-0002-9415-4582}{ORCID}) \item Romain François (\href{https://orcid.org/0000-0002-2444-4226}{ORCID}) - \item Jonathan Keane \email{jkeane@gmail.com} \item Dragoș Moldovan-Grünfeld \email{dragos.mold@gmail.com} \item Jeroen Ooms \email{jeroen@berkeley.edu} \item Jacob Wujciak-Jens \email{jacob@wujciak.de} diff --git a/r/man/format_schema.Rd b/r/man/format_schema.Rd new file mode 100644 index 000000000000..d1c81e3fe762 --- /dev/null +++ b/r/man/format_schema.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/schema.R +\name{format_schema} +\alias{format_schema} +\title{Get a string representing a Dataset or RecordBatchReader object's schema} +\usage{ +format_schema(obj) +} +\arguments{ +\item{obj}{a Dataset or RecordBatchReader} +} +\value{ +A string containing a formatted representation of the schema of \code{obj} +} +\description{ +Get a string representing a Dataset or RecordBatchReader object's schema +} +\keyword{internal}