WebAssembly in the browser has no notion of processes (or shells), so `system` will not work. Whether you compile xz to wasm or use the npm package, you will probably still have to modify the original code to call out to some JS that invokes xz rather than using `system`.
On Fri, Jun 12, 2020 at 7:48 AM Fernando Bitti Loureiro < [email protected]> wrote: > > Let me resort again to the support of this list. > > I successfully compiled a tool to wasm just to find out it uses the C > system command: > https://linux.die.net/man/3/system > ... to call another program, https://github.com/xz-mirror/xz. > > The wasm program still works when I run the program through node on Linux > CLI, but it obviously fails when I run it on a browser, with the error on > the subject of this message: > "failed to call xz, please confirm that xz is installed in your system" > (this is an error message created by the tool itself, not Emscripten) > > Researching this specific topic is being really difficult. I tried to find > a single example of a C program with a system call being compiled to wasm > and running on a browser. > But, because the words "system" and "shell" mean different things and are > used in a variety of contexts, I get a lot of unrelated search results, > hence I'm resorting to this discussion list. > > I thought about the following possible solutions: > 1. touch the original C code to remove the system shell calls to the xz > tool and handle the compression on JS via https://www.npmjs.com/package/xz > 2. compile the xz tool to wasm and (somehow) make calls between the two > wasm functions. > (is this possible)? > > Any guidance is welcome. > > Thank you so much, > > Fernando > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/emscripten-discuss/3e2c0c37-1f99-4df1-88c0-0040a2c14438o%40googlegroups.com > <https://groups.google.com/d/msgid/emscripten-discuss/3e2c0c37-1f99-4df1-88c0-0040a2c14438o%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAJZD_EWOU8qj6KNEVORGvnaktCujrUXVRJkW_fcaY%3DnHMOnAYw%40mail.gmail.com.
