[Pkg-javascript-devel] Bug#1068842: Acknowledgement (node-undici: Fail upon being required)

Jérémy Lal kapouer at melix.org
Fri Apr 12 10:40:10 BST 2024


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-devel/attachments/20240412/27166a13/attachment.htm>


More information about the Pkg-javascript-devel mailing list