Open tt4g opened 1 year ago
It's a bug on create-exe. Thank you for openning the ticket. Not sure when we will fix this, in the mean time, we should add a document entry to warn about this bug.
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.
Any update?
Describe the bug
Versions:
I am trying to build
.wasm
with a very simple Rust projecthello-world
and generate an executable withwasmer create-exe
. However, thewasmer create-exe
command always fails.src/main.rs
I found the corresponding Rust code from the error message.
https://github.com/wasmerio/wasmer/blob/74fe894c075351cc40ca5e408bd9a94298a1e459/lib/cli/src/commands/create_exe.rs#L960-L964
I noticed a difference in the way the
atom_name
is generated.Statement
let atom_name = &atom.atom;
was generated byprepare_directory_from_single_wasm_file()
. Theapp_name
variable is expected to be assignedhello-world
(since the filename is taken fromhello-world.wasm
).https://github.com/wasmerio/wasmer/blob/74fe894c075351cc40ca5e408bd9a94298a1e459/lib/cli/src/commands/create_exe.rs#L865-L907
On the other hand,
prefixes
variables are generated byPrefixMapCompilation::from_input()
, which formats the name corresponding toatom_name
withnormalize_atom_name()
.https://github.com/wasmerio/wasmer/blob/74fe894c075351cc40ca5e408bd9a94298a1e459/lib/cli/src/commands/create_exe.rs#L496-L517
normalize_atom_name()
function is a simple function that converts-
to_
. So I renamed the file and the command succeeded.Steps to reproduce
Expected behavior
Actual behavior
Additional context
I am not familiar with WebAssembly, so I don't know if there is a "no hyphen in filenames" rule. Is this my mistake? Or is it a bug in
wasmer create-exe
?