Repository navigation
GH-33807: [R] Add a message if we detect running under emulation - #37777
Conversation
|
|
| # On MacOS only, Check if we are running in under emulation, and warn this will not work | ||
| rosetta <- identical(sysname, "darwin") && identical(system("sysctl -n sysctl.proc_translated", intern = TRUE), "1") | ||
| if (rosetta) { | ||
| packageStartupMessage( |
There was a problem hiding this comment.
Should this actually be a warning()? Or even a stop()?
There was a problem hiding this comment.
I guess it depends on the extent of the problem; does it always segfault, or just when we use some of the functionality?
There was a problem hiding this comment.
There might be some functionality that works, but everything I've seen people try (even open_dataset() |> nrow() segfaults. Given opcodes + architectures + emulation, I would be surprised if much of anything of use in arrow will work.
There was a problem hiding this comment.
I think packageStartupMessage is appropriate, I wouldn't raise other signals in onLoad
| "(typically, this is running an x86 build of R on an ARM or", | ||
| "M processor based mac). This configuration is not supported", | ||
| "by arrow and we highly recommend you install a native (arm64)", | ||
| "build of R and use arrow with that." |
There was a problem hiding this comment.
This is more verbose than many of our messages (and I'm happy for some streamlining), but my reasoning for being so explicit is that if someone finds themselves in this situation, they might not even realized what is going on with architectures, versions, emulation etc. So I wanted to give people more details to be able to get to a good state (native R + native arrow)
There was a problem hiding this comment.
I might explicitly link to https://cran.r-project.org/bin/macosx/ and say install the arm64 version. And I (personally) would be a bit more direct: you're running R built for Intel on a non-Intel mac, and arrow won't work in that context; to fix, install the arm64 version of R from CRAN and then reinstall R.
There was a problem hiding this comment.
Thanks for the "Intel on a non-Intel mac" that's probably the clearest way to describe it to folks who are most likely to run into this.
|
Sorry for the errant issue tag — too many tabs open! I've corrected it in the title + issue description |
| } | ||
|
|
||
| # On MacOS only, Check if we are running in under emulation, and warn this will not work | ||
| rosetta <- identical(sysname, "darwin") && identical(system("sysctl -n sysctl.proc_translated", intern = TRUE), "1") |
There was a problem hiding this comment.
I see this is also in install_arrow(), NBD but we could factor this out and put it in arrow-package.R alongside on_macos_10_13_or_lower() et al.
Have you confirmed locally at least? |
|
Also resolves #37034? |
|
Should this get mentioned in the docs somewhere too? |
Yes, here is an example of the output. After seeing it in the terminal I've moved it up about the missing features message + also add "Warning:" and some spacing to hopefully set this apart a little bit more. |
Add this to the readme section under caveats. |
nealrichardson
left a comment
There was a problem hiding this comment.
Thanks for doing this!
|
After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit 64ad8e5. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them. |
apache#37777) Resolves apache#33807 and apache#37034 ### Rationale for this change If someone is running R under emulation, arrow segfaults without error. We can detect this when we load so can also warn people that this is not recommended. Though the version of R being run is not directly an arrow issue, arrow fails very quickly in this configuration. ### What changes are included in this PR? Detect when running under rosetta (on macOS only) and warn when the library is attached ### Are these changes tested? No, given the paucity of ARM-based mac CI, testing this organically would be difficult. But the logic is straightforward. ### Are there any user-facing changes? Yes, a warning when someone loads arrow under emulation. * Closes: apache#33807 Authored-by: Jonathan Keane <[email protected]> Signed-off-by: Jonathan Keane <[email protected]>
apache#37777) Resolves apache#33807 and apache#37034 If someone is running R under emulation, arrow segfaults without error. We can detect this when we load so can also warn people that this is not recommended. Though the version of R being run is not directly an arrow issue, arrow fails very quickly in this configuration. Detect when running under rosetta (on macOS only) and warn when the library is attached No, given the paucity of ARM-based mac CI, testing this organically would be difficult. But the logic is straightforward. Yes, a warning when someone loads arrow under emulation. * Closes: apache#33807 Authored-by: Jonathan Keane <[email protected]> Signed-off-by: Jonathan Keane <[email protected]>
Resolves #33807 and #37034
Rationale for this change
If someone is running R under emulation, arrow segfaults without error. We can detect this when we load so can also warn people that this is not recommended. Though the version of R being run is not directly an arrow issue, arrow fails very quickly in this configuration.
What changes are included in this PR?
Detect when running under rosetta (on macOS only) and warn when the library is attached
Are these changes tested?
No, given the paucity of ARM-based mac CI, testing this organically would be difficult. But the logic is straightforward.
Are there any user-facing changes?
Yes, a warning when someone loads arrow under emulation.