Repository navigation
GH-40991: [R] Prefer r-universe, add a startup message #41019
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
Changes from all commits
751fb2e
46a8f57
df4d02e
8e1bc1f
2513c31
0361aab
4cd3b5f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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") | ||
|
Comment on lines
+142
to
+143
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might be a little paranoid / silly, but we disable jemalloc in our own builds, and honestly if only jemalloc is off, but nothing else is, that's generally ok, so I would rather be less noisy so long as folks can read parquet |
||
| # Return TRUE if any of the other features are FALSE | ||
| !all(features[setdiff(names(features), blocklist)]) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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( | ||
| { | ||
|
Comment on lines
+185
to
+186
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. styler apparently demands this now?. I can back it out if we don't like it, but came from |
||
| # 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")) { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could also check and confirm that the package was installed from CRAN here too if we wanted to be extra sure. Though we will also need to confirm that Posit Public Package Manager isn't also hosting bad binaries too if we do that, but if we leave this as a check on all macs, we have a slightly less strong push to confirm all non-CRANs are building on their own |
||
| 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 | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -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") | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is probably also about autobrew right?
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm pretty sure it is, but when I git blamed it wasn't clear that's the only reason for it. I can pull it out, but also we probably should just remove all of the rosetta building code entirely at some point since it's not really a supported setup. I'll add an issue to come back to this (+ various other places we have it)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||
| } | ||||
|
|
||||
| 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" | ||||
|
|
||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to back this out + the extra docs changes, but they were stale on main.