From add616903d7ba74a5bddb0d4bbf4f1eb2a5997a5 Mon Sep 17 00:00:00 2001 From: Johannes Bechberger Date: Tue, 25 Jan 2022 11:23:17 +0100 Subject: [PATCH 1/3] Consider unsupported platforms as exotic Only fall back on Linuxx64 on platforms not mentioned in https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py#L56 (excluding the i*86 platforms) --- src/main/bash/sdkman-init.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/bash/sdkman-init.sh b/src/main/bash/sdkman-init.sh index 89ad27e84..bf52caf28 100644 --- a/src/main/bash/sdkman-init.sh +++ b/src/main/bash/sdkman-init.sh @@ -63,6 +63,9 @@ function infer_platform() { aarch64) echo "LinuxARM64" ;; + alpha | i64 | ppc | ppc64le | ppc64el | s390 | s390x) + echo "exotic" + ;; *) echo "LinuxX64" ;; From cdefeb485c05049c975547b2020affabeb010b9e Mon Sep 17 00:00:00 2001 From: Johannes Bechberger Date: Tue, 15 Mar 2022 13:02:00 +0100 Subject: [PATCH 2/3] Update test and init --- src/main/bash/sdkman-init.sh | 5 +---- src/test/groovy/sdkman/specs/PlatformSpec.groovy | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/bash/sdkman-init.sh b/src/main/bash/sdkman-init.sh index bf52caf28..1212eacfa 100644 --- a/src/main/bash/sdkman-init.sh +++ b/src/main/bash/sdkman-init.sh @@ -63,11 +63,8 @@ function infer_platform() { aarch64) echo "LinuxARM64" ;; - alpha | i64 | ppc | ppc64le | ppc64el | s390 | s390x) - echo "exotic" - ;; *) - echo "LinuxX64" + echo "Exotic" ;; esac ;; diff --git a/src/test/groovy/sdkman/specs/PlatformSpec.groovy b/src/test/groovy/sdkman/specs/PlatformSpec.groovy index a736a2939..2cca50e53 100644 --- a/src/test/groovy/sdkman/specs/PlatformSpec.groovy +++ b/src/test/groovy/sdkman/specs/PlatformSpec.groovy @@ -26,12 +26,13 @@ class PlatformSpec extends SdkmanEnvSpecification { "Linux" | "armv7l" | "linuxarm32hf" "Linux" | "armv8l" | "linuxarm32hf" "Linux" | "aarch64" | "linuxarm64" - "Linux" | "" | "linuxx64" + "Linux" | "" | "exotic" "Darwin" | "x86_64" | "darwinx64" "Darwin" | "arm64" | "darwinarm64" "Darwin" | "" | "darwinx64" "MSYS64" | "i686" | "msys64" "MSYS64" | "" | "msys64" + "Linux" | "ppc64le" | "exotic" } def "should enable rosetta 2 compatibility mode with environment variable"() { From f790d73ed498adefe7f77378b145caa20894e607 Mon Sep 17 00:00:00 2001 From: Johannes Bechberger Date: Tue, 15 Mar 2022 15:41:35 +0100 Subject: [PATCH 3/3] Fix test --- src/test/groovy/sdkman/specs/PlatformSpec.groovy | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test/groovy/sdkman/specs/PlatformSpec.groovy b/src/test/groovy/sdkman/specs/PlatformSpec.groovy index 2cca50e53..448b3449c 100644 --- a/src/test/groovy/sdkman/specs/PlatformSpec.groovy +++ b/src/test/groovy/sdkman/specs/PlatformSpec.groovy @@ -26,13 +26,19 @@ class PlatformSpec extends SdkmanEnvSpecification { "Linux" | "armv7l" | "linuxarm32hf" "Linux" | "armv8l" | "linuxarm32hf" "Linux" | "aarch64" | "linuxarm64" + "Linux" | "alpha" | "exotic" + "Linux" | "i64" | "exotic" + "Linux" | "ppc" | "exotic" + "Linux" | "ppc64le" | "exotic" + "Linux" | "ppc64el" | "exotic" + "Linux" | "s390" | "exotic" + "Linux" | "s390x" | "exotic" "Linux" | "" | "exotic" "Darwin" | "x86_64" | "darwinx64" "Darwin" | "arm64" | "darwinarm64" "Darwin" | "" | "darwinx64" "MSYS64" | "i686" | "msys64" "MSYS64" | "" | "msys64" - "Linux" | "ppc64le" | "exotic" } def "should enable rosetta 2 compatibility mode with environment variable"() {