Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: limit threads to 1 on riscv64
And warn user if they set it to a larger value.
  • Loading branch information
kxxt committed Mar 21, 2026
commit 2ce69e30edf0103f4504f7a1f1851af3ce08aa55
15 changes: 14 additions & 1 deletion src/utils/configuration/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { coerce } from 'semver';

import { CHANGELOG_URL, populate } from './templates.mjs';
import { allGenerators } from '../../generators/index.mjs';
import logger from '../../logger/index.mjs';
import { parseChangelog, parseIndex } from '../../parsers/markdown.mjs';
import { enforceArray } from '../array.mjs';
import { leftHandAssign } from '../generators.mjs';
Expand Down Expand Up @@ -33,7 +34,11 @@ export const getDefaultConfig = lazy(() =>
}),
},

threads: cpus().length,
// The number of wasm memory instances is severely limited on
// riscv64 with sv39. Running multiple generators that use wasm in
// parallel could cause failures to allocate new wasm instance.
// See also https://github.com/nodejs/node/pull/60591
threads: process.arch === 'riscv64' ? 1 : cpus().length,
chunkSize: 10,
})
)
Expand Down Expand Up @@ -121,6 +126,14 @@ export const createRunConfiguration = async options => {
merged.threads = Math.max(merged.threads, 1);
merged.chunkSize = Math.max(merged.chunkSize, 1);

if (process.arch === 'riscv64' && merged.threads > 1) {
logger.warn(
`Using ${merged.threads} threads might cause failures when` +
'allocating wasm memory due to insufficient virtual address space' +
'on riscv64 with sv39. Please consider using only a single thread.'
);
}

// Transform global config if it wasn't already done
await transformConfig(merged.global);

Expand Down
Loading