wasmer
wasmer copied to clipboard
New cmdline option `wasmer create-exe --self-test`
Motivation
wasmer create-exe
requires WASMER_DIR
to be set to the location of the Wasmer installation and it also requires at least compiler cc
and linker ld
to be present.
In case where cross compilation is required, it would also need zig-cc
to be present.
Proposed solution
I want to use wasm create-exe
in https://github.com/cargo-bins/cargo-binstall/issues/246 and having wasm create-exe --self-test
that returns 0
on success would perfectly fix this issue, not only for cargo-binstall
but also for other scripting usage of wasm create-exe
.
Alternatives
We can use wasm create-exe
to compile a simple hello-world wasi program to verify that it is usable, but that requires a simple hello-world wasi to be embedded in the program and compiling this program might also take a lot of computation resource and make the program sluggish.
Additional context
This feature request is first mentioned in https://github.com/wasmerio/wasmer/issues/3053#issuecomment-1210736435
Errors are thrown if some component needed for create-exe is missing, to make this scriptable we can assign exit code numbers for each kind of error so that it can be part of an automated system.
So running wasmer create-exe
with no argument will also gives error if something is missing?
@epilys So we still need "--self-test", but that won't be hard because wasmer already throw errors on missing components?
If we have wasmer create-exe
properly running and returning successful errors, I'm not sure we'll need --self-test
.
Perhaps we need to add more extra tests into our CI
If we have wasmer create-exe properly running and returning successful errors, I'm not sure we'll need --self-test.
I propose --self-test
because I don't want to compile a hello-world program just to figure out whether the host can run wasmer create-exe
or not.
Okay, thanks @NobodyXu, we weren't sure what the motivation for this issue was. I'll discuss it further with @syrusakbary, we will get back to you.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Feel free to reopen the issue if it has been closed by mistake.