• Bug#1068842: Acknowledgement (node-undici: Fail upon being required)

    From =?UTF-8?Q?J=C3=A9r=C3=A9my?= Lal@21:1/5 to All on Fri Apr 12 11:50:01 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

    <div dir="ltr">The problem is this line at <a href="https://salsa.debian.org/js-team/node-undici/-/blame/master/debian/nodejs/build#L20">https://salsa.debian.org/js-team/node-undici/-/blame/master/debian/nodejs/build#L20</a><div>echo &#39;module.exports =
    &quot;&#39;`perl -MMIME::Base64 -000 -ne &#39;print encode_base64($_,&quot;&quot;)&#39; lib/llhttp/llhttp-wasm`&#39;&quot;;&#39; &gt; lib/llhttp/llhttp-wasm.js<br></div><div><br></div><div>it doesn&#39;t do what it is supposed to do<br></div><div>node -
    r .</div><div>&gt; Uncaught CompileError: WebAssembly.compile(): expected 48177 bytes, fell off end @+1361<br></div><div><br></div><div>However it doesn&#39;t throw, when doing the same job with:</div><div>fs.writeFileSync(&#39;lib/llhttp/llhttp-wasm.js&#
    39;, `module.exports = &#39;${fs.readFileSync(&#39;lib/llhttp/llhttp-wasm&#39;).toString(&#39;base64&#39;)}&#39;\n`)<br></div><div><br></div><div>I don&#39;t know perl... is MMIME::Base64 module broken in some weird and suspicious way (i&#39;m being
    paranoid) ?</div><div><br></div><div>Anyway I don&#39;t see the point in doing the compilation without using build/wasm.js,</div><div>since node-undici requires nodejs to be built fully.</div><div>It is somewhat simpler to use the build-profiles / two-
    staged nodejs build method,</div><div>only on nodejs, instead of requiring some other node module to be built in two stages too.</div><div><br></div><div>For these reasons I&#39;m reverting this back to using build/wasm.js</div><div><br></div><div>Jéré
    my</div><div><br></div><div><br></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)