Using rspack on ppc64le #12975
-
|
I am attempting to use the rspack package on a ppc64le system. I am receiving an error message though when I am confused because this module does not appear in NPM, but a reference to the module exists in the binding.js file: rspack/crates/node_binding/binding.js Line 295 in c4c9877 What is the correct way to build/install this module so that Any information is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
@Jenkins-J rspack doesn't publish pre-built binaries for ppc64le. the stub in you need to build the native binding from source. two approaches: option A -- use the env var escape hatch (fastest path):
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
}so build the # install rust (ppc64le is tier 2, fully supported)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup default nightly # rspack needs nightly for some flags
# clone and build
git clone https://github.com/web-infra-dev/rspack.git
cd rspack
pnpm install
cd crates/node_binding
pnpm build:dev
# the output is: rspack.linux-ppc64-gnu.node
# use it in your project:
export NAPI_RS_NATIVE_LIBRARY_PATH=/path/to/rspack/crates/node_binding/rspack.linux-ppc64-gnu.node
npx rspack buildoption B -- copy the .node file into the expected location: # after building, copy to where binding.js looks for it:
cp rspack.linux-ppc64-gnu.node /your/project/node_modules/@rspack/binding/heads up: the build needs nightly rust because |
Beta Was this translation helpful? Give feedback.
-
|
Is it possible to add support for creating official builds of rspack for ppc64le? |
Beta Was this translation helpful? Give feedback.
@Jenkins-J rspack doesn't publish pre-built binaries for ppc64le. the stub in
binding.jsis auto-generated by napi-rs for every architecture node.js might report, but rspack only builds for x86_64/aarch64 (checknapi.targetsin package.json).you need to build the native binding from source. two approaches:
option A -- use the env var escape hatch (fastest path):
binding.jslines 67-69 check forNAPI_RS_NATIVE_LIBRARY_PATHbefore any platform detection:so build the
.nodefile and point to it: