Skip to content

Commit

Permalink
Remove rosetta2 hack for macOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
marc0der committed May 13, 2023
1 parent ed130f4 commit 3795e02
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
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 "DarwinX64"
;;
*)
echo "DarwinX64"
Expand Down
18 changes: 0 additions & 18 deletions src/test/groovy/sdkman/specs/PlatformSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,4 @@ class PlatformSpec extends SdkmanEnvSpecification {
"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")
}
}

0 comments on commit 3795e02

Please sign in to comment.