Skip to content

Add prebuilt riscv64 (linux-gnu) binary #1267

@gounthar

Description

@gounthar

lightningcss ships prebuilt bindings for linux x64/arm64/arm in both gnu and musl, but not riscv64. On a riscv64 box require('lightningcss') just throws: the loader looks for lightningcss-linux-riscv64-gnu (not on npm), then a bundled lightningcss.linux-riscv64-gnu.node (not shipped), and there's no wasm fallback on that path.

riscv64gc-unknown-linux-gnu is a supported Rust target and Node has riscv64 builds now, so the only missing piece is the prebuilt package. Anything that pulls lightningcss in (Parcel, vite, the @tailwindcss/oxide path) currently needs a manual workaround to run on these boards.

I built it both ways to be sure it actually works:

  • cross-compiled in the napi-rs container (riscv64gc-unknown-linux-gnu), ~3 min
  • natively on a riscv64 runner

Both produce a lightningcss.linux-riscv64-gnu.node that loads and minifies fine: .a{ color: #ffffff } comes out as .a{color:#fff}.

If you're open to it, I'm happy to send a PR adding riscv64gc-unknown-linux-gnu to the release matrix. It follows the existing cross entries: same napi-rs image plus gcc-riscv64-linux-gnu, and the matching riscv64gc -> riscv64 mapping in scripts/build-npm.js. Let me know if you'd rather handle it a different way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions