Skip to content

Commit

Permalink
Add support for linux riscv64 gnu (#5288)
Browse files Browse the repository at this point in the history
* chore: bump @napi-rs/cli  to 2.17.0

Necessary for riscv64 support

* Add support for linux riscv64 gnu

---------

Co-authored-by: Lukas Taegert-Atkinson <[email protected]>
  • Loading branch information
kxxt and lukastaegert authored Dec 7, 2023
1 parent d77b682 commit 179b0ca
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,16 @@ jobs:
set -e &&
npm run build:napi -- --release --target aarch64-linux-android &&
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
- host: ubuntu-latest
target: riscv64gc-unknown-linux-gnu
setup: |
sudo apt-get update
sudo apt-get install gcc-riscv64-linux-gnu -y
build: >-
set -e &&
rustup target add riscv64gc-unknown-linux-gnu &&
npm run build:napi -- --release --target riscv64gc-unknown-linux-gnu &&
riscv64-linux-gnu-strip *.node
name: Build ${{ matrix.settings.name || matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
timeout-minutes: 30
Expand Down
1 change: 1 addition & 0 deletions native.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const bindingsByPlatformAndArch = {
linux: {
arm: { base: 'linux-arm-gnueabihf', musl: null },
arm64: { base: 'linux-arm64-gnu', musl: 'linux-arm64-musl' },
riscv64: { base: 'linux-riscv64-gnu', musl: null },
x64: { base: 'linux-x64-gnu', musl: 'linux-x64-musl' }
},
win32: {
Expand Down
3 changes: 3 additions & 0 deletions npm/linux-riscv64-gnu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `@rollup/rollup-linux-riscv64-gnu`

This is the **riscv64gc-unknown-linux-gnu** binary for `rollup`
22 changes: 22 additions & 0 deletions npm/linux-riscv64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "@rollup/rollup-linux-riscv64-gnu",
"version": "0.0.0",
"os": [
"linux"
],
"cpu": [
"riscv64"
],
"files": [
"rollup.linux-riscv64-gnu.node"
],
"description": "Native bindings for Rollup",
"author": "Lukas Taegert-Atkinson",
"homepage": "https://rollupjs.org/",
"license": "MIT",
"repository": "rollup/rollup",
"libc": [
"glibc"
],
"main": "./rollup.linux-riscv64-gnu.node"
}
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"armv7-linux-androideabi",
"armv7-unknown-linux-gnueabihf",
"i686-pc-windows-msvc",
"riscv64gc-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-pc-windows-msvc",
"x86_64-unknown-linux-gnu",
Expand Down Expand Up @@ -113,7 +114,7 @@
"@codemirror/view": "^6.22.1",
"@jridgewell/sourcemap-codec": "^1.4.15",
"@mermaid-js/mermaid-cli": "^10.6.1",
"@napi-rs/cli": "^2.16.5",
"@napi-rs/cli": "^2.17.0",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-buble": "^1.0.3",
"@rollup/plugin-commonjs": "^25.0.7",
Expand Down

0 comments on commit 179b0ca

Please sign in to comment.