Comments (7)
Compile on install can be done but then you risk the host system not having the required tools or correct version of tools to build the library.
Some npm packages only ship pre-compiled versions and fail if it doesn't have one for the host and Node.js version, while some fall back to compile on install.
It's easier for us to ignore all that and compile once to WASM.
It's also faster for our users since they don't have to compile anything when installing Yarn.
Also, just to confirm, the SUPPORT_BIG_ENDIAN setting means that result will run on both big and little endian with a single build?
Yes.
Hopefully it doesn't come with too much of a performance hit.
When support for big-endian was added to Yarn the benchmarks indicated almost no impact on performance yarnpkg/berry#3669 (comment).
from emscripten.
It looks like that function was renamed in #21439 but that call was overlooked. I guess we don't have any testing for that setting :-/
Can I ask what your target is that you are using that option?
from emscripten.
Can I ask what your target is that you are using that option?
Of course!
Yarn compiles libzip to WASM for Node.js and needs to support big-endian systems.
I don't know specifically what systems people run it on but I know at least big-endian s390x systems are in use.
We don't have access to a big-endian system so our CI emulates one while Node.js CITGM validates that it works on a real machine.
from emscripten.
Thanks! Thats good to know. I didn't know yarn was using wasm like this. BTW, can I ask why you/they didn't just go with a native node binary? What is the advantage they/you seen in using wasm under node? (I'm not saying there are not advantages, I'm just wondering why you made the choice).
from emscripten.
The main reason is reproducibility. We need the output of libzip to be identical on all systems since we checksum the zip files to see if they've been tampered with or corrupted.
It's also easier to compile to WASM once and use it everywhere Node.js works than to make a native Node.js addon for each and every architecture, platform, and libc implementation that Node.js runs on.
from emscripten.
I see, I'm not very familiar with node addon.
Does that mean that npm
doesn't generally do compile on install
for things like? Does it instead rely on your to compile native extension for evey possible arch up front? That does sounds hard/impossible.
Also, just to confirm, the SUPPORT_BIG_ENDIAN
setting means that result will run on both big and little endian with a single build?
I guess we should add more testing of this setting if folks like you are depending on it so much. Hopefully it doesn't come with too much of a performance hit.
from emscripten.
Thanks for the useful data points!
from emscripten.
Related Issues (20)
- Running browser.test_wasmfs_opfs_jspi twice causes tack overflow error HOT 5
- Password input with no echo is not working HOT 9
- Setting `--closure 1` causes `JSC_UNDEFINED_VARIABLE` errors HOT 3
- std::atomic<std::shared_ptr<T>> not compiling with emcc 3.1.42 / clang 17.0.0 HOT 5
- --emit-tsd crashes when used in standalone wasm mode
- Block size specification for audio worklet HOT 3
- Unexpected error of proxyAsync with emscripten_init_websocket_to_posix_socket_bridge HOT 3
- WebGPU new Surface API HOT 1
- Memory Profiler Incorrectly Reporting Data as Free HOT 1
- Using the closure compiler at link time corrupts references to variables in EM_JS blocks HOT 4
- Please set EMSCRIPTEN as an INTERNAL variable in the Emscripten.cmake toolchain file HOT 1
- emsdk 3.1.57: undefined symbol: saveSetjmp/testSetjmp HOT 4
- lto2.test_asyncify_indirect_lists_add is currently failing on the releases waterfall HOT 6
- Int64 return functions with dynamic linking crashes on exception
- `--emit-tsd` doesn't account for `-s WASM_ASYNC_COMPILATION=0` with `-s MODULARIZE=1`
- Should remove remove (reduce usage of) withStackSave? HOT 1
- register_vector and register_map with raw pointer HOT 1
- Support omitting optional arguments in js embind bindings HOT 1
- --emit-tsd crashes when wasmTable is exported
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emscripten.