Repository navigation
feat: support riscv64 targets - #14447
Conversation
Deploying rspack with
|
| Latest commit: |
ff0b79b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://029c2e04.rspack-v2.pages.dev |
| Branch Preview URL: | https://feat-riscv64.rspack-v2.pages.dev |
📦 Binary Size-limit
🙈 Size remains the same at 67.91MB |
Merging this PR will not alter performance
Comparing Footnotes
|
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 5 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 popular-libsPath:
📁 react-10kPath:
📁 react-1kPath:
📁 ui-componentsPath:
📁 react-5kPath:
Generated by Rsdoctor GitHub Action |
|
Adding a Risc-V runner for running Additionally, the |
|
@swwind Beside, trigger a canary release with risc bindings, to evaluate the effect on the publish process. |
|
@stormslowly canary results can be found here. It takes 11m9s to build |
# Conflicts: # .github/workflows/ci.yml
Set CHROMEDRIVER_SKIP_DOWNLOAD=true to avoid the bootstrap failure: "No official Chromedriver binary is available for RISC-V 64-bit". ChromeDriver is a development dependency used for browser tests, which the PKGBUILD does not run. Enable --install.ignore-platform in the project's .yarnrc so Yarn Classic installs the locked WASM fallback bindings. Rspack 2.0.8 has no native riscv64 package, and Yarn skips its fallback because it declares cpu: ["wasm32"], leaving @osd/monaco bootstrap failing with "Cannot find native binding". Keep engine checks enabled. Update @rspack/core and @rspack/cli to 2.1.0, which ships native riscv64 bindings. With the WASM package installed, 2.0.8 still fails on monferno: "WebAssembly.Module(): Wasm SIMD unsupported @+1235". The loader hides this error behind the native-binding diagnostic. Use the native binding to avoid Rspack's WASM SIMD requirement. Use jq to update the two dependency versions while preserving Yarn's workspaces object and nohoist rules. npm pkg set rejects that format with EWORKSPACESINVALID: "workspaces should be an array of strings." Keep the Yarn platform override and Sv39 blacklist for the remaining WASM fallbacks, including Tailwind oxide and @rspack/resolver, which still require a larger address space. Upstream: web-infra-dev/rspack#14447 Set ENABLE_V8_FUNCTIONS=false for LMDB 2.8.5, which builds from source on riscv64. Its bundled V8 header declares the old three-argument CFunctionInfo constructor, but Node 22 requires a fourth argument. Bootstrap fails loading lmdb.node with: "undefined symbol: _ZN2v813CFunctionInfoC2ERKNS_9CTypeInfoEjPS2_". Use LMDB's supported Node-API implementation, as upstream does for its portable prebuilt binaries. This retains database functionality without the incompatible optional V8 acceleration or a dependency version bump. https://github.com/kriszyp/lmdb-js/blob/189f52bf720f1bda436dc5162e88af4686c6218c/package.json Add opensearch-dashboards to the QEMU-user blacklist. On magby, LMDB loads but opening the compiler cache fails with "Operation not supported". mdb_env_setup_locks() initializes process-shared robust mutexes; QEMU-user returns ENOSYS for the robust-list syscalls, so glibc returns ENOTSUP from pthread_mutex_init(). Standalone LMDB is already blacklisted for the same failure (a75042c). Keep robust locking and the existing Sv39 exclusion intact. Work around the native Rspack SIGSEGV while bootstrapping @osd/ui-shared-deps on abomasnow. Its prebuilt riscv64 binding contains mimalloc compiled with GCC 11.4, which emits LR.aq/SC.aq for acquire- release compare-exchange without the required release ordering. A freed block can become visible to another CPU before its next-pointer is initialized, corrupting mimalloc's cross-thread free list. GDB stops in that list traversal at binding offset 0x229786a. Restoring release ordering to mimalloc's SC instructions in process memory makes the same bundle complete; an unmodified control run crashes again. Pin both Yarn build commands and their child threads to the first CPU in the allowed affinity set. The original binary completes the bundle with this restriction, avoiding cross-CPU ordering failures without rebuilding or modifying the binding. This sacrifices build parallelism until the prebuilt binding is rebuilt with a corrected C toolchain. The WASM binding is not a usable alternative on this builder: explicitly loading 2.1.0 still fails with "Wasm SIMD unsupported @+1373" because Node 22 requires RVV for WASM SIMD, which the P550 lacks. GCC fix: gcc-mirror/gcc@d199d2e Resolve lightningcss to npm:[email protected]. Tailwind 4.2.4 requires Lightning CSS 1.32.0, which has no native riscv64 binding. Plugin CSS compilation fails with: "Cannot find module '../lightningcss.linux-riscv64-gnu.node'". Use the published WASM build at the same version, following oxyromon's override. Its Node entry point provides the synchronous transform API and Features constants used by Tailwind, without requiring WASM SIMD. Add the Yarn resolution through the existing jq manifest edit.
Set CHROMEDRIVER_SKIP_DOWNLOAD=true to avoid the bootstrap failure: "No official Chromedriver binary is available for RISC-V 64-bit". ChromeDriver is a development dependency used for browser tests, which the PKGBUILD does not run. Enable --install.ignore-platform in the project's .yarnrc so Yarn Classic installs the locked WASM fallback bindings. Rspack 2.0.8 has no native riscv64 package, and Yarn skips its fallback because it declares cpu: ["wasm32"], leaving @osd/monaco bootstrap failing with "Cannot find native binding". Keep engine checks enabled. Update @rspack/core and @rspack/cli to 2.1.0, which ships native riscv64 bindings. With the WASM package installed, 2.0.8 still fails on monferno: "WebAssembly.Module(): Wasm SIMD unsupported @+1235". The loader hides this error behind the native-binding diagnostic. Use the native binding to avoid Rspack's WASM SIMD requirement. Use jq to update the two dependency versions while preserving Yarn's workspaces object and nohoist rules. npm pkg set rejects that format with EWORKSPACESINVALID: "workspaces should be an array of strings." Keep the Yarn platform override and Sv39 blacklist for the remaining WASM fallbacks, including Tailwind oxide and @rspack/resolver, which still require a larger address space. Upstream: web-infra-dev/rspack#14447 Set ENABLE_V8_FUNCTIONS=false for LMDB 2.8.5, which builds from source on riscv64. Its bundled V8 header declares the old three-argument CFunctionInfo constructor, but Node 22 requires a fourth argument. Bootstrap fails loading lmdb.node with: "undefined symbol: _ZN2v813CFunctionInfoC2ERKNS_9CTypeInfoEjPS2_". Use LMDB's supported Node-API implementation, as upstream does for its portable prebuilt binaries. This retains database functionality without the incompatible optional V8 acceleration or a dependency version bump. https://github.com/kriszyp/lmdb-js/blob/189f52bf720f1bda436dc5162e88af4686c6218c/package.json Add opensearch-dashboards to the QEMU-user blacklist. On magby, LMDB loads but opening the compiler cache fails with "Operation not supported". mdb_env_setup_locks() initializes process-shared robust mutexes; QEMU-user returns ENOSYS for the robust-list syscalls, so glibc returns ENOTSUP from pthread_mutex_init(). Standalone LMDB is already blacklisted for the same failure (a75042c). Keep robust locking and the existing Sv39 exclusion intact. Work around the native Rspack SIGSEGV while bootstrapping @osd/ui-shared-deps on abomasnow. Its prebuilt riscv64 binding contains mimalloc compiled with GCC 11.4, which emits LR.aq/SC.aq for acquire- release compare-exchange without the required release ordering. A freed block can become visible to another CPU before its next-pointer is initialized, corrupting mimalloc's cross-thread free list. GDB stops in that list traversal at binding offset 0x229786a. Restoring release ordering to mimalloc's SC instructions in process memory makes the same bundle complete; an unmodified control run crashes again. Pin both Yarn build commands and their child threads to the first CPU in the allowed affinity set. The original binary completes the bundle with this restriction, avoiding cross-CPU ordering failures without rebuilding or modifying the binding. This sacrifices build parallelism until the prebuilt binding is rebuilt with a corrected C toolchain. The WASM binding is not a usable alternative on this builder: explicitly loading 2.1.0 still fails with "Wasm SIMD unsupported @+1373" because Node 22 requires RVV for WASM SIMD, which the P550 lacks. GCC fix: gcc-mirror/gcc@d199d2e Resolve lightningcss to npm:[email protected]. Tailwind 4.2.4 requires Lightning CSS 1.32.0, which has no native riscv64 binding. Plugin CSS compilation fails with: "Cannot find module '../lightningcss.linux-riscv64-gnu.node'". Use the published WASM build at the same version, following oxyromon's override. Its Node entry point provides the synchronous transform API and Features constants used by Tailwind, without requiring WASM SIMD. Add the Yarn resolution through the existing jq manifest edit.
Bypass the Lerna/Nx bootstrap on riscv64: its WASM fallback lacks FileLock. Install the CLI and internal test package directly, retaining the upstream build and test suite. Use Rspack 2.1.0 for both packages because 2.0.5 lacks a native riscv64 binding. Keep parallel Jest tests using libzip WASM off Sv39 workers. Use complete diagnostic messages instead of 32-bit hashes for deduplication. MatchClass1 fails with "Expected 7 errors, got 8" after emitting the same [411:14] "float | int" diagnostic twice. Avoid the integer hashing path without changing the expected error count, and cover repeated insertion and distinct messages with colliding hashes. No matching Pyright fix was found; the RISC-V Maglev Word32 bug still present in Node 26.9.0 is a suspected trigger, not a confirmed diagnosis. Increase the LSP test-signal timeout from 10 to 60 seconds for "Timed out waiting for signal didopendocument". Upstream #11521 reports the same failure under parallel suite load. Preserve the complete configured suite and add no skips. https://archriscv.felixc.at/.status/logs/pyright/pyright-1.1.412-1.log nrwl/nx#20914 web-infra-dev/rspack#14447 microsoft/pyright#11521 v8/v8@3b5f516
Bypass the Lerna/Nx bootstrap on riscv64: its WASM fallback lacks FileLock. Install the CLI and internal test package directly, retaining the upstream build and test suite. Use Rspack 2.1.0 for both packages because 2.0.5 lacks a native riscv64 binding. Keep parallel Jest tests using libzip WASM off Sv39 workers. Use complete diagnostic messages instead of 32-bit hashes for deduplication. MatchClass1 fails with "Expected 7 errors, got 8" after emitting the same [411:14] "float | int" diagnostic twice. Avoid the integer hashing path without changing the expected error count, and cover repeated insertion and distinct messages with colliding hashes. No matching Pyright fix was found; the RISC-V Maglev Word32 bug still present in Node 26.9.0 is a suspected trigger, not a confirmed diagnosis. Increase the LSP test-signal timeout from 10 to 60 seconds for "Timed out waiting for signal didopendocument". Upstream #11521 reports the same failure under parallel suite load. Preserve the complete configured suite and add no skips. https://archriscv.felixc.at/.status/logs/pyright/pyright-1.1.412-1.log nrwl/nx#20914 web-infra-dev/rspack#14447 microsoft/pyright#11521 v8/v8@3b5f516
Summary
This PR adds support for publishing Node.js bindings for the Linux RISC-V 64-bit architecture.
riscv64gc-unknown-linux-gnu(Linux RISC-V 64-bit, glibc-based)riscv64gc-unknown-linux-musl(Linux RISC-V 64-bit, musl-based)Related links
fixes #11656.
Checklist