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: check for rosetta in shell #941

Merged
merged 1 commit into from
Apr 17, 2024
Merged

Conversation

mistydemeo
Copy link
Contributor

We inherited a check for the old-style Mac uname -m reporting on Intel from rustup, but we're missing a case to check for Rosetta under aarch64. Makes sense to me to add one and always install the aarch64 binary even if the installer's being run from within an Intel Rosetta shell.

@mistydemeo mistydemeo requested a review from Gankra April 16, 2024 23:34
@mistydemeo mistydemeo force-pushed the installer-arm-rosetta-2-mac branch from ce49837 to f8fef04 Compare April 16, 2024 23:36
@@ -627,6 +627,13 @@ get_architecture() {
fi
fi

if [ "$_ostype" = Darwin ] && [ "$_cputype" = x86_64 ]; then
# Rosetta on aarch64
if [ "$(sysctl -n hw.optional.arm64 2>/dev/null)" = "1" ]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used sysctl -n instead of piping into grep for a bit of a cleaner comparison.

@mistydemeo
Copy link
Contributor Author

Confirmed this works when running in both rosetta and non-rosetta shells on arm64.

@mistydemeo mistydemeo merged commit 67d31ee into main Apr 17, 2024
15 checks passed
@mistydemeo mistydemeo deleted the installer-arm-rosetta-2-mac branch April 17, 2024 20:57
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