Dne 24. 01. 23 v 21:48 Dominik 'Rathann' Mierzejewski napsal(a):
On Tuesday, 24 January 2023 at 18:30, Vít Ondruch wrote:
> Dne 24. 01. 23 v 15:26 Michael Dawson napsal(a):
>>> I think that the bundling in Node.js should not be forgotten.
>> Thanks for identifying that. To clarify do you mean Node.js needs to be
>> able to bundle in externalized WASM so we can rebuild it, or something
>> else?
>
> I mean that when there is some WASM file included in Node.js, we have to be
> able to replace this file with file compiled from plain sources. IOW, we
> must adhere to this guideline:
>
>
https://docs.fedoraproject.org/en-US/packaging-guidelines/what-can-be-pac...
>
> Actually I think that the guideline should be extended to include the WASM
> files.
The precompiled .wasm files should be removed in %prep and recompiled
with wat2wasm (from wabt package) from .wat sources. Possibly, they
could be further optimized with wasm-opt (from binaryen package).
Never heard of this and I am not entirely sure how that would look in
practice.
So this is one of the cases AFAIK. Node.js bundles llhttp:
https://github.com/nodejs/node/tree/main/deps/undici/src/lib/llhttp
And there are various WASM files. And this is llhttp source:
https://github.com/nodejs/llhttp
Now how would the wat2wasm help here? Could you please elaborate?
Vít
Regards,
Dominik