-
Notifications
You must be signed in to change notification settings - Fork 777
[wasm-merge] Does not print to stdout if -o
is not specified
#7397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'd also be curious what your use case for wasm-merge is, if you can share that... |
PRThanks for landing the PR so quickly. Appreciate that! Just one quick note: I think after this PR, you will still see no output. Would it be worth to either make the flag mandatory or emit a warning when no output is specified? Use-CaseI am compiling a piece of Rust code to wasm and using jco to generate the JS code to load it on the web (that is actually a really nice DX and feels like the spiritual successor to wasm-bindgen, as in a generic, properly source-language-agnostic way to generate JS bindings for a Wasm module). However, I am also depending on a C library, which somewhat forces me to target My goal here is to “terminate” Wasi at build time. There is wasi-virt, which generates a Wasm module with a virtual implementation of WASI. When combined with wac, that let’s me satisfy the WASI imports at the component level during build time, prevent jco from loading the shim. However, this approach didn’t really reduce the total number of bytes and resulted in a new component with a disproportionate number of new trampoline modules, which is not really acceptable for this use-case where loading performance is important. The solution I am exploring is to terminate WASI at the core wasm level, rather than at the component level. I am auto-generating modules for all WASI imports contained in the module, and each function just uses the |
Interesting use case!
Is there no tool that can optimize component graphs, or lower a component into a "flat" one? Btw, if you are mixing C/C++ and Rust and targeting the web, you may be interested in https://github.com/walkingeyerobot/cxx-rust-demo (more details in emscripten-core/emscripten#23493 and other links there, but it is all wip). Though that is focused more on "C++, adding Rust" and it sounds like you are more "Rust, adding C".
Possibly a warning or error makes sense, yeah. I believe we have one on |
I finally have a use-case for
wasm-merge
and trying to use it made me think the tool was broken! (It is not).It says:
However, if you don’t specify
-o
nothing gets printed.-o -
makes it print to stdout as expected. I suspect the default value for this flag is not implemented?The text was updated successfully, but these errors were encountered: