failed to call xz, please confirm that xz is installed in your system

21 views
Skip to first unread message

Fernando Bitti Loureiro

unread,
Jun 12, 2020, 10:48:01 AM6/12/20
to emscripten-discuss

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

Thomas Lively

unread,
Jun 12, 2020, 1:50:47 PM6/12/20
to emscripte...@googlegroups.com
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`.

--
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 emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/3e2c0c37-1f99-4df1-88c0-0040a2c14438o%40googlegroups.com.

Beuc

unread,
Jun 12, 2020, 2:07:46 PM6/12/20
to emscripte...@googlegroups.com

Hi Fernando,

You may want to check

https://github.com/kripken/zee.js

which exposes high-level functions of zlib through a secondary WASM module.

Cheers!
Beuc

Fernando Bitti Loureiro

unread,
Jun 12, 2020, 2:55:33 PM6/12/20
to emscripten-discuss
Thank you for the guidance, Beuc and Thomas!


On Friday, 12 June 2020 20:07:46 UTC+2, Beuc wrote:

Hi Fernando,

You may want to check

https://github.com/kripken/zee.js

which exposes high-level functions of zlib through a secondary WASM module.

Cheers!
Beuc

On 12/06/2020 19:50, 'Thomas Lively' via emscripten-discuss wrote:
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 <fernan...@gmail.com> 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 emscripten-discuss+unsub...@googlegroups.com.
--
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 emscripten-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages