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

Remove rosetta2 hack for arm64 on Mac #1205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/jreleaser/distributions/sdkman-cli/brew/formula.rb.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class {{brewFormulaName}} < Formula
sdkman_curl_max_time=10
sdkman_debug_mode=false
sdkman_insecure_ssl=false
sdkman_rosetta2_compatible=false
sdkman_selfupdate_feature=false
EOS
end
Expand Down
6 changes: 1 addition & 5 deletions src/main/bash/sdkman-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ function infer_platform() {
echo "DarwinX64"
;;
arm64)
if [[ "$sdkman_rosetta2_compatible" == 'true' ]]; then
echo "DarwinX64"
else
echo "DarwinARM64"
fi
echo "DarwinARM64"
;;
*)
echo "DarwinX64"
Expand Down
21 changes: 1 addition & 20 deletions src/test/groovy/sdkman/specs/PlatformSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,8 @@ class PlatformSpec extends SdkmanEnvSpecification {
"Linux" | "" | "exotic"
"Darwin" | "x86_64" | "darwinx64"
"Darwin" | "arm64" | "darwinarm64"
"Darwin" | "" | "darwinx64"
"MSYS64" | "i686" | "msys64"
"MSYS64" | "x86_64" | "msys64"
"MSYS64" | "" | "msys64"
"CYGWIN" | "" | "exotic"
}

def "should enable rosetta 2 compatibility mode with environment variable"() {
given:
unameStub.forKernel("Darwin").forMachine("arm64")
bash = sdkmanBashEnvBuilder
.withUnameStub(unameStub)
.withConfiguration("sdkman_rosetta2_compatible", "true")
.build()
bash.start()
bash.execute("source $bootstrapScript")

when:
bash.execute('echo $SDKMAN_PLATFORM')

then:
!bash.output.contains("darwinarm64")
bash.output.contains("darwinx64")
}
}