Skip to content
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

add ability to skip_on M1 Mac? #1421

Closed
cboettig opened this issue Aug 3, 2021 · 11 comments · Fixed by #1444
Closed

add ability to skip_on M1 Mac? #1421

cboettig opened this issue Aug 3, 2021 · 11 comments · Fixed by #1444
Labels
feature a feature request or enhancement skip

Comments

@cboettig
Copy link
Contributor

cboettig commented Aug 3, 2021

As you know, CRAN is beginning to enforce checks on M1 Macs, sending the usual "Please correct to safely retain" emails when tests fail. Like Solaris, some of these failures can occur when an upstream dependency installs on the platform but does not actually run. (Obviously doing skip_on("mac") would be a bit overkill). Not sure how to detect architecture though. Thanks for considering or any other suggestions on how to approach this.

@gaborcsardi
Copy link
Member

gaborcsardi commented Aug 3, 2021

AFAICT this is how to detect it. The OS:

❯ Sys.info()[["sysname"]]
[1] "Darwin"

and the arch:

> R.version$arch
[1] "aarch64"

@hadley hadley added feature a feature request or enhancement skip labels Sep 10, 2021
@hadley
Copy link
Member

hadley commented Sep 13, 2021

I'm happy to implement this but I'm stuck on what to call it.

@gaborcsardi
Copy link
Member

How about we add an arch argument to skip_on_os()?

@hadley
Copy link
Member

hadley commented Sep 13, 2021

What are the other possible architectures apart from x86_64 and aarch64?

@gaborcsardi
Copy link
Member

There are others, like s390x, ppc64el, other arms, etc. Maybe just let the user specify whatever, and match it to R.version$arch?

@hadley
Copy link
Member

hadley commented Sep 14, 2021

IMO part of the benefit of skip_on_os() is that you can (e.g.) specify "mac" and it figures out that you need "darwin". I'd like to keep something similar for arch.

@hadley
Copy link
Member

hadley commented Sep 14, 2021

But maybe I can just put them in the documentation..

@gaborcsardi
Copy link
Member

I think that is fine as well. Then you could have intel and m1 for mac only, and nothing else.

People can always skip on other arches with if (R.version$arch == ...) skip(...)...

@gaborcsardi
Copy link
Member

Or you could have some aliases, and fall back to compare to the exact value.

hadley added a commit that referenced this issue Sep 14, 2021
hadley added a commit that referenced this issue Sep 14, 2021
@cboettig
Copy link
Contributor Author

thanks 🙏, this looks great 🎉

Yeah, it's really all about the documentation here. Of course we can use if (R.version$arch == ...) skip(...) but that's not easy to do if you don't have access to said architecture and cannot easily determine what string R has decided to use... the skip_on_ docs have always been a great go-to to look up such arcana

@jlmelville
Copy link

with apologies for bringing this thread back from the dead, this may be of use to @cboettig: a package of mine that somehow has become an ubuntu or Debian package was failing tests on arm64, ppc64el and s390x. An Ubuntu developer was kind enough to provide the R.version$arch values for those architectures and for the record they are "aarch64", "powerpc64le" and "s390x" respectively. In all cases Sys.info()[["sysname"]] == "Linux", so I am currently hoping that skip_on_os("linux", arch = c("aarch64", "powerpc64le", "s390x")) will do the trick. Maybe this will help others if they find their way to this issue the same way I did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement skip
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants