The problem is this line at
https://salsa.debian.org/js-team/node-undici/-/blame/master/debian/nodejs/build#L20
echo 'module.exports = "'`perl -MMIME::Base64 -000 -ne 'print
encode_base64($_,"")' lib/llhttp/llhttp-wasm`'";' >
lib/llhttp/llhttp-wasm.js

it doesn't do what it is supposed to do
node -r .
> Uncaught CompileError: WebAssembly.compile(): expected 48177 bytes, fell
off end @+1361

However it doesn't throw, when doing the same job with:
fs.writeFileSync('lib/llhttp/llhttp-wasm.js', `module.exports =
'${fs.readFileSync('lib/llhttp/llhttp-wasm').toString('base64')}'\n`)

I don't know perl... is MMIME::Base64 module broken in some weird and
suspicious way (i'm being paranoid) ?

Anyway I don't see the point in doing the compilation without using
build/wasm.js,
since node-undici requires nodejs to be built fully.
It is somewhat simpler to use the build-profiles / two-staged nodejs build
method,
only on nodejs, instead of requiring some other node module to be built in
two stages too.

For these reasons I'm reverting this back to using build/wasm.js

Jérémy

Reply via email to