@@ -5,6 +5,7 @@ import { coerce } from 'semver';
55
66import { CHANGELOG_URL , populate } from './templates.mjs' ;
77import { allGenerators } from '../../generators/index.mjs' ;
8+ import logger from '../../logger/index.mjs' ;
89import { parseChangelog , parseIndex } from '../../parsers/markdown.mjs' ;
910import { enforceArray } from '../array.mjs' ;
1011import { leftHandAssign } from '../generators.mjs' ;
@@ -33,7 +34,11 @@ export const getDefaultConfig = lazy(() =>
3334 } ) ,
3435 } ,
3536
36- threads : cpus ( ) . length ,
37+ // The number of wasm memory instances is severely limited on
38+ // riscv64 with sv39. Running multiple generators that use wasm in
39+ // parallel could cause failures to allocate new wasm instance.
40+ // See also https://github.com/nodejs/node/pull/60591
41+ threads : process . arch === 'riscv64' ? 1 : cpus ( ) . length ,
3742 chunkSize : 10 ,
3843 } )
3944 )
@@ -121,6 +126,14 @@ export const createRunConfiguration = async options => {
121126 merged . threads = Math . max ( merged . threads , 1 ) ;
122127 merged . chunkSize = Math . max ( merged . chunkSize , 1 ) ;
123128
129+ if ( process . arch === 'riscv64' && merged . threads > 1 ) {
130+ logger . warn (
131+ `Using ${ merged . threads } threads might cause failures when` +
132+ 'allocating wasm memory due to insufficient virtual address space' +
133+ 'on riscv64 with sv39. Please consider using only a single thread.'
134+ ) ;
135+ }
136+
124137 // Transform global config if it wasn't already done
125138 await transformConfig ( merged . global ) ;
126139
0 commit comments