Skip to content

fix(cli): Normalize Linux ARM64 arch name for sentry-cli binary lookup#1201

Merged
romtsn merged 9 commits into
mainfrom
rz/fix/normalize-linux-arm64-arch
Jun 11, 2026
Merged

fix(cli): Normalize Linux ARM64 arch name for sentry-cli binary lookup#1201
romtsn merged 9 commits into
mainfrom
rz/fix/normalize-linux-arm64-arch

Conversation

@romtsn

@romtsn romtsn commented May 19, 2026

Copy link
Copy Markdown
Member

Summary

  • Normalize Linux architecture names in getCliSuffix() so that both arm64 and aarch64 JVM values resolve to the bundled sentry-cli-Linux-aarch64 binary
  • Also normalize x86_64 alongside the existing amd64 mapping for robustness
  • Add tests for arm64, aarch64, and x86_64 arch values

Fixes #1168

Test plan

  • Existing SentryCliProviderTest tests still pass
  • New test: os.arch=arm64 -> Linux-aarch64
  • New test: os.arch=aarch64 -> Linux-aarch64
  • New test: os.arch=x86_64 -> Linux-x86_64
  • Manually verify in Docker: docker build --platform linux/arm64 no longer fails to find sentry-cli

🤖 Generated with Claude Code

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) <[email protected]>
romtsn and others added 2 commits May 19, 2026 14:04
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we take a look at https://github.com/getsentry/sentry-cli/releases/tag/3.4.2 and make sure we support all the different releases correctly here?

Comment thread plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt Outdated
romtsn and others added 3 commits May 20, 2026 12:21
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) <[email protected]>
- 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) <[email protected]>
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) <[email protected]>
Comment thread plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 25139c1. Configure here.

Comment thread plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryCliProvider.kt Outdated
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) <[email protected]>
@rbro112
rbro112 removed their request for review June 1, 2026 16:33
Some JVM distributions on Apple Silicon may report os.arch as "arm64"
instead of "aarch64". Match both values to select the Darwin-arm64
binary, consistent with the Linux normalization.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@romtsn
romtsn requested a review from 0xadam-brown as a code owner June 11, 2026 10:04
@romtsn
romtsn merged commit 79669f9 into main Jun 11, 2026
25 of 26 checks passed
@romtsn
romtsn deleted the rz/fix/normalize-linux-arm64-arch branch June 11, 2026 10:39
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.

"arm64" not normalized to "aarch64" when searching for sentry-cli binary

2 participants