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

Fix architecture detection on MacOS to be configuration-cache friendly #24

Closed
wants to merge 1 commit into from

Conversation

msridhar
Copy link

See diffplug/goomph#211. Executing uname -a causes configuration cache issues, so get the info from the os.arch system property instead.

@nedtwigg
Copy link
Member

Thanks for the PR! On an M1 mac, you can use the arch command to run something under x86 or arm. On an M1 mac, It should be that

  • OS.getRunning() will report either arm or x86 based on whether you are using the x86 Rosetta emulation or the native ARM exection
  • OS.getNative() should always return arm

These requirements are definitely met by uname. I think they are not met by os.arch, though I might be wrong. Do you have access to an M1 or M2 mac? If so, can you:

  • use arch to setup a case with the existing published version that says OS.getRunning is x86 and OS.getNaive is arm
  • repeat that test with the change proposed in this PR

If you report that this works, I'm happy to merge and release it.

@msridhar
Copy link
Author

Thanks for the feedback! I don't think this PR will work according the requirements. In particular when running under Rosetta I think getNative() will return x86 incorrectly. So I think a different approach is needed. Shall I go ahead and close this PR?

@nedtwigg nedtwigg closed this Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants