Skip to content

Commit 6960c15

Browse files
committed
fix: disable wasm highlighter on riscv64
riscv64 with sv39 has limited virtual memory space, where creating too many (>=20) wasm memory instances fails. See nodejs/node#60591 for more details. This PR fixes the following error encountered during `make test-only` on riscv64: [07:02:55.797] ERROR: WebAssembly.instantiate(): Out of memory: Cannot allocate Wasm memory for new instance RangeError: WebAssembly.instantiate(): Out of memory: Cannot allocate Wasm memory for new instancemake[1]: *** [Makefile:392: test/addons/.docbuildstamp] Error 1 make: *** [Makefile:352: test-only] Error 2 Signed-off-by: Levi Zim <[email protected]>
1 parent 9122dbe commit 6960c15

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/utils/highlighter.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ function isCodeBlock(node) {
3939
export const highlighter = await createHighlighter({
4040
// s390x machines throw memory issues on WASM builds
4141
// https://github.com/nodejs/node/blob/c9acf345922bd758fbb3f16ee6256aa165260219/test/common/sea.js#L55
42-
wasm: process.arch !== 's390x',
42+
//
43+
// riscv64 with sv39 has limited virtual memory space, where creating
44+
// too many (>20) wasm memory instances fails.
45+
// https://github.com/nodejs/node/pull/60591
46+
wasm: !['riscv64', 's390x'].includes(process.arch),
4347
});
4448

4549
/**

0 commit comments

Comments
 (0)