Repository navigation
GH-40991: [R] Prefer r-universe, add a startup message - #41019
Conversation
| vctrs | ||
| Roxygen: list(markdown = TRUE, r6 = FALSE, load = "source") | ||
| RoxygenNote: 7.2.3 | ||
| RoxygenNote: 7.3.1 |
There was a problem hiding this comment.
I'm happy to back this out + the extra docs changes, but they were stale on main.
|
|
| try( | ||
| { |
There was a problem hiding this comment.
styler apparently demands this now?. I can back it out if we don't like it, but came from make doc so we'll be fighting it if we do.
| }, 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")) { |
There was a problem hiding this 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
| minimal = Sys.getenv("LIBARROW_MINIMAL", FALSE), | ||
| verbose = Sys.getenv("ARROW_R_DEV", FALSE), | ||
| repos = getOption("repos"), | ||
| prefer_runiverse = TRUE, |
There was a problem hiding this comment.
I don't love the option profusion here, but I do think going to r-universe first here is actually a nice plan. We don't have to muck with swapping to only source builds on macOS in order to get libarrow (and then also if someone has a borked gcc setup that would error too).
There was a problem hiding this comment.
If you take my other suggestion, you don't need to touch this function (though cleaning up the autobrew references is probably worthwhile anyway) or arrow_repos().
| # 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) { | ||
| 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)) { |
There was a problem hiding this comment.
I believe the m1 detection isn't needed any more now that we have binaries for arm. The rosetta checking for jemalloc also probably can go away, since rosetta generally doesn't work (I'm happy to delete it too)
nealrichardson
left a comment
There was a problem hiding this comment.
Thanks for doing this. One suggestion that might simplify things a bit.
| packageStartupMessage( | ||
| paste( | ||
| "The repository you retrieved Arrow from did not include all of Arrow's features.", | ||
| "You can install a fully-featured version by running `arrow::install_arrow()`." |
There was a problem hiding this comment.
Did you see this R-package-devel thread? https://stat.ethz.ch/pipermail/r-package-devel/2024q2/010624.html
TL;DR order of repos doesn't necessarily guarantee order of lookup. So it might be better here to just recommend install.packages("arrow", repos = "https://apache.r-universe.dev"). We know they already have the arrow package dependencies installed since they're loading it, so we don't need to keep on a CRAN in order to get dependencies to resolve.
There was a problem hiding this comment.
Ah right of course. Thanks!
| minimal = Sys.getenv("LIBARROW_MINIMAL", FALSE), | ||
| verbose = Sys.getenv("ARROW_R_DEV", FALSE), | ||
| repos = getOption("repos"), | ||
| prefer_runiverse = TRUE, |
There was a problem hiding this comment.
If you take my other suggestion, you don't need to touch this function (though cleaning up the autobrew references is probably worthwhile anyway) or arrow_repos().
| ) | ||
| } | ||
| }, silent = TRUE) | ||
| # On macOS binaries from CRAN can be hobbled. If on macOS, and features |
There was a problem hiding this comment.
I don't think it's a bad idea to explain here why they're hobbled, just so we'll know in the future when we can remove this workaround.
| # jemalloc is only included because it is sometimes disabled in our build process | ||
| blocklist <- c("lzo", "bz2", "brotli", "substrait", "jemalloc") |
There was a problem hiding this comment.
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
568a472 to
2513c31
Compare
nealrichardson
left a comment
There was a problem hiding this comment.
Some final cleanup suggestions but otherwise LGTM.
Also need update the PR description to reflect the current scope of the changes.
| Sys.setenv(ARROW_JEMALLOC = "OFF") | ||
| } | ||
| if (apple_m1 || rosetta) { | ||
| Sys.setenv(FORCE_BUNDLED_BUILD = "true") |
There was a problem hiding this comment.
This is probably also about autobrew right?
| Sys.setenv(FORCE_BUNDLED_BUILD = "true") |
There was a problem hiding this comment.
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)
thisisnic
left a comment
There was a problem hiding this comment.
Haven't reviewed in detail but +1 overall to doing this and getting it merged ahead of Monday's code freeze
Co-authored-by: Neal Richardson <neal.p.richardson@gmail.com>
Co-authored-by: Neal Richardson <neal.p.richardson@gmail.com>
|
After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit 3886cf1. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 6 possible false positives for unstable benchmarks that are known to sometimes produce them. |
…41019) ### Rationale for this change If someone loads a version of Arrow on macOS with features disabled, warn them on startup that they can use `install_arrow()`. By default, prefer R-Universe in `install_arrow()` ### What changes are included in this PR? ^^^ ### Are these changes tested? Yes ### Are there any user-facing changes? Yes **This PR contains a "Critical Fix".** * GitHub Issue: apache#40991 Lead-authored-by: Jonathan Keane <jkeane@gmail.com> Co-authored-by: Neal Richardson <neal.p.richardson@gmail.com> Signed-off-by: Jonathan Keane <jkeane@gmail.com>
Rationale for this change
If someone loads a version of Arrow on macOS with features disabled, warn them on startup that they can use
install_arrow(). By default, prefer R-Universe ininstall_arrow()What changes are included in this PR?
^^^
Are these changes tested?
Yes
Are there any user-facing changes?
Yes
This PR contains a "Critical Fix".