From ae240b331108333427d05a101dcac202b444407c Mon Sep 17 00:00:00 2001 From: Roman Zavarnitsyn Date: Tue, 19 May 2026 14:02:47 +0200 Subject: [PATCH 1/7] fix(cli): Normalize Linux ARM64 arch name for sentry-cli binary lookup The JVM can report `os.arch` as `"arm64"` on some systems (e.g., Docker on Apple Silicon), but the bundled binary is named `sentry-cli-Linux-aarch64`. Normalize both ARM (`arm64`/`aarch64`) and x86 (`amd64`/`x86_64`) arch names to match the bundled binary naming convention. Fixes #1168 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../sentry/android/gradle/SentryCliProvider.kt | 9 ++++++++- .../android/gradle/SentryCliProviderTest.kt | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt b/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt index 423b8e512..0f0d1aa7b 100644 --- a/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt +++ b/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt @@ -134,7 +134,14 @@ internal object SentryCliProvider { val osArch = System.getProperty("os.arch") return when { "mac" in osName -> "Darwin-universal" - "linux" in osName -> if (osArch == "amd64") "Linux-x86_64" else "Linux-$osArch" + "linux" in osName -> { + val normalizedArch = when (osArch) { + "amd64", "x86_64" -> "x86_64" + "arm64", "aarch64" -> "aarch64" + else -> osArch + } + "Linux-$normalizedArch" + } "win" in osName -> "Windows-i686.exe" else -> null } diff --git a/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt b/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt index 0e8ddd788..73d89e418 100644 --- a/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt +++ b/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt @@ -159,6 +159,24 @@ class SentryCliProviderTest { assertEquals("Linux-x86_64", getCliSuffix()) } + @Test + @WithSystemProperty(["os.name", "os.arch"], ["linux", "x86_64"]) + fun `getCliSuffix on linux x86_64 returns Linux-x86_64`() { + assertEquals("Linux-x86_64", getCliSuffix()) + } + + @Test + @WithSystemProperty(["os.name", "os.arch"], ["linux", "arm64"]) + fun `getCliSuffix on linux arm64 returns Linux-aarch64`() { + assertEquals("Linux-aarch64", getCliSuffix()) + } + + @Test + @WithSystemProperty(["os.name", "os.arch"], ["linux", "aarch64"]) + fun `getCliSuffix on linux aarch64 returns Linux-aarch64`() { + assertEquals("Linux-aarch64", getCliSuffix()) + } + @Test @WithSystemProperty(["os.name", "os.arch"], ["linux", "armV7"]) fun `getCliSuffix on linux armV7 returns Linux-armV7`() { From 5329dd3bafb746df3f320a39e927eb1792ce9f3a Mon Sep 17 00:00:00 2001 From: Roman Zavarnitsyn Date: Tue, 19 May 2026 14:04:35 +0200 Subject: [PATCH 2/7] changelog: Add entry for ARM64 arch normalization fix Co-Authored-By: Claude Opus 4.6 (1M context) --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 575cff79e..ce79f5955 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Fixes + +- Normalize Linux ARM64 architecture name for bundled sentry-cli binary lookup ([#1201](https://github.com/getsentry/sentry-android-gradle-plugin/pull/1201)) + ## 6.7.1 ### Fixes From 639f75c62a16bbaecdf0b35870b32c2d32cb4fc8 Mon Sep 17 00:00:00 2001 From: Roman Zavarnitsyn Date: Tue, 19 May 2026 15:25:02 +0200 Subject: [PATCH 3/7] style: Apply spotless formatting Co-Authored-By: Claude Opus 4.6 (1M context) --- .../io/sentry/android/gradle/SentryCliProvider.kt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt b/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt index 0f0d1aa7b..1c4eafc38 100644 --- a/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt +++ b/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt @@ -135,11 +135,14 @@ internal object SentryCliProvider { return when { "mac" in osName -> "Darwin-universal" "linux" in osName -> { - val normalizedArch = when (osArch) { - "amd64", "x86_64" -> "x86_64" - "arm64", "aarch64" -> "aarch64" - else -> osArch - } + val normalizedArch = + when (osArch) { + "amd64", + "x86_64" -> "x86_64" + "arm64", + "aarch64" -> "aarch64" + else -> osArch + } "Linux-$normalizedArch" } "win" in osName -> "Windows-i686.exe" From 8fa7ddf1fdc5f3df7b75e7e5b7333cda71443ad2 Mon Sep 17 00:00:00 2001 From: Roman Zavarnitsyn Date: Wed, 20 May 2026 12:21:19 +0200 Subject: [PATCH 4/7] fix(cli): Add arch normalization for Windows and Linux i686 Expand platform coverage to match sentry-cli release binaries: - Download and support Windows-x86_64 and Windows-aarch64 binaries - Normalize Linux i386/i686 arch names - Add tests for all new arch mappings Co-Authored-By: Claude Opus 4.6 (1M context) --- plugin-build/download-sentry-cli.sh | 2 +- .../android/gradle/SentryCliProvider.kt | 15 ++++++- .../android/gradle/SentryCliProviderTest.kt | 40 ++++++++++++++++++- 3 files changed, 53 insertions(+), 4 deletions(-) diff --git a/plugin-build/download-sentry-cli.sh b/plugin-build/download-sentry-cli.sh index 9e9a7d010..4b01e5cdd 100755 --- a/plugin-build/download-sentry-cli.sh +++ b/plugin-build/download-sentry-cli.sh @@ -9,7 +9,7 @@ function prop { base_url="$(prop 'repo')/releases/download/$(prop 'version')" target_dir="src/main/resources/bin/" -PLATFORMS="Darwin-universal Linux-i686 Linux-x86_64 Linux-aarch64 Windows-i686" +PLATFORMS="Darwin-universal Linux-i686 Linux-x86_64 Linux-aarch64 Windows-i686 Windows-x86_64 Windows-aarch64" rm -f $target_dir/sentry-cli-* for plat in $PLATFORMS; do diff --git a/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt b/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt index 1c4eafc38..3910f9e82 100644 --- a/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt +++ b/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt @@ -141,11 +141,24 @@ internal object SentryCliProvider { "x86_64" -> "x86_64" "arm64", "aarch64" -> "aarch64" + "x86", + "i386", + "i686" -> "i686" else -> osArch } "Linux-$normalizedArch" } - "win" in osName -> "Windows-i686.exe" + "win" in osName -> { + val normalizedArch = + when (osArch) { + "amd64", + "x86_64" -> "x86_64" + "arm64", + "aarch64" -> "aarch64" + else -> "i686" + } + "Windows-$normalizedArch.exe" + } else -> null } } diff --git a/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt b/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt index 73d89e418..91339d7cf 100644 --- a/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt +++ b/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt @@ -177,6 +177,18 @@ class SentryCliProviderTest { assertEquals("Linux-aarch64", getCliSuffix()) } + @Test + @WithSystemProperty(["os.name", "os.arch"], ["linux", "i686"]) + fun `getCliSuffix on linux i686 returns Linux-i686`() { + assertEquals("Linux-i686", getCliSuffix()) + } + + @Test + @WithSystemProperty(["os.name", "os.arch"], ["linux", "i386"]) + fun `getCliSuffix on linux i386 returns Linux-i686`() { + assertEquals("Linux-i686", getCliSuffix()) + } + @Test @WithSystemProperty(["os.name", "os.arch"], ["linux", "armV7"]) fun `getCliSuffix on linux armV7 returns Linux-armV7`() { @@ -184,8 +196,32 @@ class SentryCliProviderTest { } @Test - @WithSystemProperty(["os.name"], ["windows"]) - fun `getCliSuffix on win returns Windows-i686`() { + @WithSystemProperty(["os.name", "os.arch"], ["windows", "amd64"]) + fun `getCliSuffix on win amd64 returns Windows-x86_64`() { + assertEquals("Windows-x86_64.exe", getCliSuffix()) + } + + @Test + @WithSystemProperty(["os.name", "os.arch"], ["windows", "x86_64"]) + fun `getCliSuffix on win x86_64 returns Windows-x86_64`() { + assertEquals("Windows-x86_64.exe", getCliSuffix()) + } + + @Test + @WithSystemProperty(["os.name", "os.arch"], ["windows", "arm64"]) + fun `getCliSuffix on win arm64 returns Windows-aarch64`() { + assertEquals("Windows-aarch64.exe", getCliSuffix()) + } + + @Test + @WithSystemProperty(["os.name", "os.arch"], ["windows", "aarch64"]) + fun `getCliSuffix on win aarch64 returns Windows-aarch64`() { + assertEquals("Windows-aarch64.exe", getCliSuffix()) + } + + @Test + @WithSystemProperty(["os.name", "os.arch"], ["windows", "x86"]) + fun `getCliSuffix on win x86 returns Windows-i686`() { assertEquals("Windows-i686.exe", getCliSuffix()) } From 1661a7ece57da05a1d591a83a6976e7d29b78cfe Mon Sep 17 00:00:00 2001 From: Roman Zavarnitsyn Date: Wed, 20 May 2026 12:23:42 +0200 Subject: [PATCH 5/7] fix(cli): Add Linux armv7 arch normalization and binary download - Download Linux-armv7 binary from sentry-cli releases - Normalize JVM arch values "arm" and "armv7l" to "armv7" - Replace incorrect armV7 test with arm and armv7l tests Co-Authored-By: Claude Opus 4.6 (1M context) --- plugin-build/download-sentry-cli.sh | 2 +- .../io/sentry/android/gradle/SentryCliProvider.kt | 2 ++ .../sentry/android/gradle/SentryCliProviderTest.kt | 12 +++++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/plugin-build/download-sentry-cli.sh b/plugin-build/download-sentry-cli.sh index 4b01e5cdd..8b362e5f3 100755 --- a/plugin-build/download-sentry-cli.sh +++ b/plugin-build/download-sentry-cli.sh @@ -9,7 +9,7 @@ function prop { base_url="$(prop 'repo')/releases/download/$(prop 'version')" target_dir="src/main/resources/bin/" -PLATFORMS="Darwin-universal Linux-i686 Linux-x86_64 Linux-aarch64 Windows-i686 Windows-x86_64 Windows-aarch64" +PLATFORMS="Darwin-universal Linux-armv7 Linux-i686 Linux-x86_64 Linux-aarch64 Windows-i686 Windows-x86_64 Windows-aarch64" rm -f $target_dir/sentry-cli-* for plat in $PLATFORMS; do diff --git a/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt b/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt index 3910f9e82..380c0a365 100644 --- a/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt +++ b/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt @@ -144,6 +144,8 @@ internal object SentryCliProvider { "x86", "i386", "i686" -> "i686" + "arm", + "armv7l" -> "armv7" else -> osArch } "Linux-$normalizedArch" diff --git a/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt b/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt index 91339d7cf..104906c92 100644 --- a/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt +++ b/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt @@ -190,9 +190,15 @@ class SentryCliProviderTest { } @Test - @WithSystemProperty(["os.name", "os.arch"], ["linux", "armV7"]) - fun `getCliSuffix on linux armV7 returns Linux-armV7`() { - assertEquals("Linux-armV7", getCliSuffix()) + @WithSystemProperty(["os.name", "os.arch"], ["linux", "arm"]) + fun `getCliSuffix on linux arm returns Linux-armv7`() { + assertEquals("Linux-armv7", getCliSuffix()) + } + + @Test + @WithSystemProperty(["os.name", "os.arch"], ["linux", "armv7l"]) + fun `getCliSuffix on linux armv7l returns Linux-armv7`() { + assertEquals("Linux-armv7", getCliSuffix()) } @Test From 25139c19bdd9b4cf0e0997a7a0c231e8f89902c1 Mon Sep 17 00:00:00 2001 From: Roman Zavarnitsyn Date: Wed, 20 May 2026 12:27:52 +0200 Subject: [PATCH 6/7] fix(cli): Use platform-specific binaries on macOS instead of universal Replace Darwin-universal (26MB) with Darwin-arm64 (12MB) and Darwin-x86_64 (14MB) for smaller extracted binary at runtime. JAR size stays the same since both are bundled. Co-Authored-By: Claude Opus 4.6 (1M context) --- plugin-build/download-sentry-cli.sh | 2 +- .../io/sentry/android/gradle/SentryCliProvider.kt | 2 +- .../sentry/android/gradle/SentryCliProviderTest.kt | 12 +++++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/plugin-build/download-sentry-cli.sh b/plugin-build/download-sentry-cli.sh index 8b362e5f3..21ad44444 100755 --- a/plugin-build/download-sentry-cli.sh +++ b/plugin-build/download-sentry-cli.sh @@ -9,7 +9,7 @@ function prop { base_url="$(prop 'repo')/releases/download/$(prop 'version')" target_dir="src/main/resources/bin/" -PLATFORMS="Darwin-universal Linux-armv7 Linux-i686 Linux-x86_64 Linux-aarch64 Windows-i686 Windows-x86_64 Windows-aarch64" +PLATFORMS="Darwin-arm64 Darwin-x86_64 Linux-armv7 Linux-i686 Linux-x86_64 Linux-aarch64 Windows-i686 Windows-x86_64 Windows-aarch64" rm -f $target_dir/sentry-cli-* for plat in $PLATFORMS; do diff --git a/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt b/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt index 380c0a365..53aec1328 100644 --- a/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt +++ b/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt @@ -133,7 +133,7 @@ internal object SentryCliProvider { val osName = System.getProperty("os.name").toLowerCase(Locale.ROOT) val osArch = System.getProperty("os.arch") return when { - "mac" in osName -> "Darwin-universal" + "mac" in osName -> if (osArch == "aarch64") "Darwin-arm64" else "Darwin-x86_64" "linux" in osName -> { val normalizedArch = when (osArch) { diff --git a/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt b/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt index 104906c92..866421668 100644 --- a/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt +++ b/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt @@ -148,9 +148,15 @@ class SentryCliProviderTest { } @Test - @WithSystemProperty(["os.name"], ["mac"]) - fun `getCliSuffix on mac returns Darwin-universal`() { - assertEquals("Darwin-universal", getCliSuffix()) + @WithSystemProperty(["os.name", "os.arch"], ["mac", "aarch64"]) + fun `getCliSuffix on mac aarch64 returns Darwin-arm64`() { + assertEquals("Darwin-arm64", getCliSuffix()) + } + + @Test + @WithSystemProperty(["os.name", "os.arch"], ["mac", "x86_64"]) + fun `getCliSuffix on mac x86_64 returns Darwin-x86_64`() { + assertEquals("Darwin-x86_64", getCliSuffix()) } @Test From fc4356af39b3bc6590024002add125c4c0b860e4 Mon Sep 17 00:00:00 2001 From: Roman Zavarnitsyn Date: Thu, 21 May 2026 16:53:04 +0200 Subject: [PATCH 7/7] revert: Remove Windows/Linux armv7 arch expansion, keep focused scope MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert Windows arch detection and Linux armv7/i386 normalization — Windows i686 works on all Windows archs via WoW64, and armv7/i386 are too niche to justify the JAR size increase. Keep macOS platform-specific binaries and Linux arm64 fix. Co-Authored-By: Claude Opus 4.6 (1M context) --- plugin-build/download-sentry-cli.sh | 2 +- .../android/gradle/SentryCliProvider.kt | 17 +----- .../android/gradle/SentryCliProviderTest.kt | 52 ++----------------- 3 files changed, 7 insertions(+), 64 deletions(-) diff --git a/plugin-build/download-sentry-cli.sh b/plugin-build/download-sentry-cli.sh index 21ad44444..59353012a 100755 --- a/plugin-build/download-sentry-cli.sh +++ b/plugin-build/download-sentry-cli.sh @@ -9,7 +9,7 @@ function prop { base_url="$(prop 'repo')/releases/download/$(prop 'version')" target_dir="src/main/resources/bin/" -PLATFORMS="Darwin-arm64 Darwin-x86_64 Linux-armv7 Linux-i686 Linux-x86_64 Linux-aarch64 Windows-i686 Windows-x86_64 Windows-aarch64" +PLATFORMS="Darwin-arm64 Darwin-x86_64 Linux-i686 Linux-x86_64 Linux-aarch64 Windows-i686" rm -f $target_dir/sentry-cli-* for plat in $PLATFORMS; do diff --git a/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt b/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt index 53aec1328..8b0a3f2af 100644 --- a/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt +++ b/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt @@ -141,26 +141,11 @@ internal object SentryCliProvider { "x86_64" -> "x86_64" "arm64", "aarch64" -> "aarch64" - "x86", - "i386", - "i686" -> "i686" - "arm", - "armv7l" -> "armv7" else -> osArch } "Linux-$normalizedArch" } - "win" in osName -> { - val normalizedArch = - when (osArch) { - "amd64", - "x86_64" -> "x86_64" - "arm64", - "aarch64" -> "aarch64" - else -> "i686" - } - "Windows-$normalizedArch.exe" - } + "win" in osName -> "Windows-i686.exe" else -> null } } diff --git a/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt b/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt index 866421668..ed3e310a3 100644 --- a/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt +++ b/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryCliProviderTest.kt @@ -184,56 +184,14 @@ class SentryCliProviderTest { } @Test - @WithSystemProperty(["os.name", "os.arch"], ["linux", "i686"]) - fun `getCliSuffix on linux i686 returns Linux-i686`() { - assertEquals("Linux-i686", getCliSuffix()) + @WithSystemProperty(["os.name", "os.arch"], ["linux", "armV7"]) + fun `getCliSuffix on linux armV7 returns Linux-armV7`() { + assertEquals("Linux-armV7", getCliSuffix()) } @Test - @WithSystemProperty(["os.name", "os.arch"], ["linux", "i386"]) - fun `getCliSuffix on linux i386 returns Linux-i686`() { - assertEquals("Linux-i686", getCliSuffix()) - } - - @Test - @WithSystemProperty(["os.name", "os.arch"], ["linux", "arm"]) - fun `getCliSuffix on linux arm returns Linux-armv7`() { - assertEquals("Linux-armv7", getCliSuffix()) - } - - @Test - @WithSystemProperty(["os.name", "os.arch"], ["linux", "armv7l"]) - fun `getCliSuffix on linux armv7l returns Linux-armv7`() { - assertEquals("Linux-armv7", getCliSuffix()) - } - - @Test - @WithSystemProperty(["os.name", "os.arch"], ["windows", "amd64"]) - fun `getCliSuffix on win amd64 returns Windows-x86_64`() { - assertEquals("Windows-x86_64.exe", getCliSuffix()) - } - - @Test - @WithSystemProperty(["os.name", "os.arch"], ["windows", "x86_64"]) - fun `getCliSuffix on win x86_64 returns Windows-x86_64`() { - assertEquals("Windows-x86_64.exe", getCliSuffix()) - } - - @Test - @WithSystemProperty(["os.name", "os.arch"], ["windows", "arm64"]) - fun `getCliSuffix on win arm64 returns Windows-aarch64`() { - assertEquals("Windows-aarch64.exe", getCliSuffix()) - } - - @Test - @WithSystemProperty(["os.name", "os.arch"], ["windows", "aarch64"]) - fun `getCliSuffix on win aarch64 returns Windows-aarch64`() { - assertEquals("Windows-aarch64.exe", getCliSuffix()) - } - - @Test - @WithSystemProperty(["os.name", "os.arch"], ["windows", "x86"]) - fun `getCliSuffix on win x86 returns Windows-i686`() { + @WithSystemProperty(["os.name"], ["windows"]) + fun `getCliSuffix on win returns Windows-i686`() { assertEquals("Windows-i686.exe", getCliSuffix()) }