jonkeane commented on code in PR #41019:
URL: https://github.com/apache/arrow/pull/41019#discussion_r1552591184
##########
r/R/arrow-package.R:
##########
@@ -182,37 +182,50 @@ 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. If on macOS, and features
+ # are disabled, advise that reinstalling might help
+ if (identical(tolower(Sys.info()[["sysname"]]), "darwin")) {
Review Comment:
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
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]