From 5f19c03f17b907911e3145e07aae4a24bdfc8c1e Mon Sep 17 00:00:00 2001 From: Xeonacid Date: Wed, 19 Aug 2026 09:19:14 +0200 Subject: [PATCH] feat: Add Linux riscv64 support Build and distribute sentry-cli for Linux riscv64 across GitHub releases, npm, PyPI, and Homebrew. Leave package-lock.json unchanged because @sentry/cli-linux-riscv64 is not published yet. --- .craft.yml | 9 +++++++- .github/workflows/build.yml | 4 ++++ AGENTS.md | 2 +- CHANGELOG.md | 5 +++++ build.rs | 4 ++++ lib/helper.ts | 6 +++++- .../linux-riscv64/README.md | 11 ++++++++++ .../linux-riscv64/bin/.gitkeep | 0 .../linux-riscv64/package.json | 21 +++++++++++++++++++ package.json | 1 + scripts/install.js | 3 +++ scripts/wheels | 4 ++++ 12 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 npm-binary-distributions/linux-riscv64/README.md create mode 100644 npm-binary-distributions/linux-riscv64/bin/.gitkeep create mode 100644 npm-binary-distributions/linux-riscv64/package.json diff --git a/.craft.yml b/.craft.yml index 332a778e78..149dfe69f0 100644 --- a/.craft.yml +++ b/.craft.yml @@ -26,6 +26,9 @@ targets: - name: npm id: '@sentry/cli-linux-i686' includeNames: /^sentry-cli-linux-i686-\d.*\.tgz$/ + - name: npm + id: '@sentry/cli-linux-riscv64' + includeNames: /^sentry-cli-linux-riscv64-\d.*\.tgz$/ - name: npm id: '@sentry/cli-linux-x64' includeNames: /^sentry-cli-linux-x64-\d.*\.tgz$/ @@ -64,7 +67,7 @@ targets: url "https://downloads.sentry-cdn.com/sentry-cli/{{version}}/sentry-cli-Linux-armv7" sha256 "{{checksums.sentry-cli-Linux-armv7}}" end - elseif Hardware::CPU.intel? + elsif Hardware::CPU.intel? if Hardware::CPU.is_64_bit? url "https://downloads.sentry-cdn.com/sentry-cli/{{version}}/sentry-cli-Linux-x86_64" sha256 "{{checksums.sentry-cli-Linux-x86_64}}" @@ -72,6 +75,9 @@ targets: url "https://downloads.sentry-cdn.com/sentry-cli/{{version}}/sentry-cli-Linux-i686" sha256 "{{checksums.sentry-cli-Linux-i686}}" end + elsif RUBY_PLATFORM.include?("riscv64") + url "https://downloads.sentry-cdn.com/sentry-cli/{{version}}/sentry-cli-Linux-riscv64" + sha256 "{{checksums.sentry-cli-Linux-riscv64}}" else raise "Unsupported architecture" end @@ -115,6 +121,7 @@ requireNames: - /^sentry-cli-Linux-x86_64$/ - /^sentry-cli-Linux-armv7$/ - /^sentry-cli-Linux-aarch64$/ + - /^sentry-cli-Linux-riscv64$/ - /^sentry-cli-Windows-i686.exe$/ - /^sentry-cli-Windows-x86_64.exe$/ - /^sentry-cli-Windows-aarch64.exe$/ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 906643f163..e4fc764e70 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,9 @@ jobs: - arch: aarch64 target: aarch64-unknown-linux-musl container: aarch64-musl + - arch: riscv64 + target: riscv64gc-unknown-linux-musl + container: riscv64gc-musl name: Linux ${{ matrix.arch }} runs-on: ubuntu-24.04 @@ -368,6 +371,7 @@ jobs: mv binary-artifacts/sentry-cli-Linux-armv7 npm-binary-distributions/linux-arm/bin/sentry-cli mv binary-artifacts/sentry-cli-Linux-aarch64 npm-binary-distributions/linux-arm64/bin/sentry-cli mv binary-artifacts/sentry-cli-Linux-i686 npm-binary-distributions/linux-i686/bin/sentry-cli + mv binary-artifacts/sentry-cli-Linux-riscv64 npm-binary-distributions/linux-riscv64/bin/sentry-cli mv binary-artifacts/sentry-cli-Linux-x86_64 npm-binary-distributions/linux-x64/bin/sentry-cli mv binary-artifacts/sentry-cli-Windows-i686.exe npm-binary-distributions/win32-i686/bin/sentry-cli.exe mv binary-artifacts/sentry-cli-Windows-x86_64.exe npm-binary-distributions/win32-x64/bin/sentry-cli.exe diff --git a/AGENTS.md b/AGENTS.md index 86a9a090dd..8bd5a9b3da 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,7 +9,7 @@ This is **sentry-cli**, a command-line utility for working with Sentry. It's pri - **Primary language**: Rust (core functionality) - **Secondary language**: JavaScript/TypeScript (npm wrapper, installation scripts) - **Build system**: Cargo for Rust, npm/yarn for JavaScript -- **Cross-platform**: Supports multiple architectures (darwin, linux, windows, ARM variants) +- **Cross-platform**: Supports multiple architectures (darwin, linux, windows, ARM and RISC-V variants) - **Binary distributions**: Located in `npm-binary-distributions/` for different platforms ## Project Structure diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cb5cede05..1793a14484 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,13 @@ ## Unreleased +### Features + +- Add Linux riscv64 release binaries, npm package, and Python wheel + ### Fixes +- Use `elsif` in the Homebrew formula so Linux Intel and RISC-V bottles resolve correctly - (logs) Correct the severity query example ([#3387](https://github.com/getsentry/sentry-cli/pull/3387)) ## 3.6.2 diff --git a/build.rs b/build.rs index 8cb0740f33..a08713ee22 100644 --- a/build.rs +++ b/build.rs @@ -21,6 +21,10 @@ fn main() -> Result<(), Box> { arch = "arm64"; // enforce Darwin naming conventions } + if arch == "riscv64gc" { + arch = "riscv64"; // match uname -m / Node os.arch() + } + writeln!(f, "/// The platform identifier")?; writeln!(f, "pub const PLATFORM: &str = \"{platform}\";")?; writeln!(f, "/// The CPU architecture identifier")?; diff --git a/lib/helper.ts b/lib/helper.ts index dd83538347..c0e6cf622f 100644 --- a/lib/helper.ts +++ b/lib/helper.ts @@ -12,6 +12,7 @@ const BINARY_DISTRIBUTIONS = [ { packageName: '@sentry/cli-linux-i686', subpath: 'bin/sentry-cli' }, { packageName: '@sentry/cli-linux-arm64', subpath: 'bin/sentry-cli' }, { packageName: '@sentry/cli-linux-arm', subpath: 'bin/sentry-cli' }, + { packageName: '@sentry/cli-linux-riscv64', subpath: 'bin/sentry-cli' }, { packageName: '@sentry/cli-win32-x64', subpath: 'bin/sentry-cli.exe' }, { packageName: '@sentry/cli-win32-i686', subpath: 'bin/sentry-cli.exe' }, { packageName: '@sentry/cli-win32-arm64', subpath: 'bin/sentry-cli.exe' }, @@ -56,6 +57,9 @@ function getDistributionForThisPlatform() { case 'arm': packageName = '@sentry/cli-linux-arm'; break; + case 'riscv64': + packageName = '@sentry/cli-linux-riscv64'; + break; } } else if (platform === 'win32') { switch (arch) { @@ -102,7 +106,7 @@ function throwUnsupportedPlatformError(): void { Sentry CLI supports: - Darwin (macOS) -- Linux and FreeBSD on x64, x86, ia32, arm64, and arm architectures +- Linux and FreeBSD on x64, x86, ia32, arm64, arm, and riscv64 architectures - Windows x64, x86, and ia32 architectures` ); } diff --git a/npm-binary-distributions/linux-riscv64/README.md b/npm-binary-distributions/linux-riscv64/README.md new file mode 100644 index 0000000000..7236efd983 --- /dev/null +++ b/npm-binary-distributions/linux-riscv64/README.md @@ -0,0 +1,11 @@ +

+ + Sentry + +

+ +# Sentry CLI Linux RISC-V 64-bit Binary + +This package contains the Sentry CLI binary for Linux riscv64. + +See https://github.com/getsentry/sentry-cli for more information. diff --git a/npm-binary-distributions/linux-riscv64/bin/.gitkeep b/npm-binary-distributions/linux-riscv64/bin/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/npm-binary-distributions/linux-riscv64/package.json b/npm-binary-distributions/linux-riscv64/package.json new file mode 100644 index 0000000000..a4d87c8e28 --- /dev/null +++ b/npm-binary-distributions/linux-riscv64/package.json @@ -0,0 +1,21 @@ +{ + "name": "@sentry/cli-linux-riscv64", + "version": "3.6.2", + "description": "The linux riscv64 distribution of the Sentry CLI binary.", + "repository": "https://github.com/getsentry/sentry-cli", + "license": "FSL-1.1-MIT", + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=18" + }, + "os": [ + "linux", + "freebsd", + "android" + ], + "cpu": [ + "riscv64" + ] +} diff --git a/package.json b/package.json index ad1c837612..ba5b54df55 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "@sentry/cli-linux-arm": "3.6.2", "@sentry/cli-linux-arm64": "3.6.2", "@sentry/cli-linux-i686": "3.6.2", + "@sentry/cli-linux-riscv64": "3.6.2", "@sentry/cli-linux-x64": "3.6.2", "@sentry/cli-win32-i686": "3.6.2", "@sentry/cli-win32-x64": "3.6.2", diff --git a/scripts/install.js b/scripts/install.js index fd02e64206..d968ed987a 100755 --- a/scripts/install.js +++ b/scripts/install.js @@ -69,6 +69,9 @@ function getDownloadUrl(platform, arch) { case 'arm': archString = 'armv7'; break; + case 'riscv64': + archString = 'riscv64'; + break; default: archString = arch; } diff --git a/scripts/wheels b/scripts/wheels index 7219f6705d..fe99ff3f65 100755 --- a/scripts/wheels +++ b/scripts/wheels @@ -40,6 +40,10 @@ WHEELS = ( src='sentry-cli-Linux-i686', plat='manylinux_2_17_i686.manylinux2014_i686.musllinux_1_2_i686', ), + Wheel( + src='sentry-cli-Linux-riscv64', + plat='manylinux_2_31_riscv64.musllinux_1_2_riscv64', + ), Wheel( src='sentry-cli-Linux-x86_64', plat='manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_2_x86_64',