-
Notifications
You must be signed in to change notification settings - Fork 824
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
Error with create-exe #2895
Comments
I think you need to gives much more information on your system. What hardware/OS are you using, and the different compiler version too. |
$ uname -a
Linux VM-89-86-centos 3.10.107-1-tlinux2_kvm_guest-0053 #1 SMP Fri Jul 3 20:40:27 CST 2020 x86_64 x86_64 x86_64 GNU/Linux
$ arch
x86_64
$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
$ rustc -V
rustc 1.59.0 (9d1b2106e 2022-02-23)
|
gcc is 4.8 !!! :O |
Can you provide a docker image to use the Wasmer's Thanks! |
Centos with 3.10 kernel is also from 2014. |
|
$ cd ./tests/examples
$ export WASMER_DIR=/root/.wasmer/
$ /wasmer/bin/wasmer create-exe fib.wat -o ./fib
Engine: staticlib
Compiler: cranelift
Target: x86_64-unknown-linux-gnu
✔ Native executable compiled successfully to `./fib`.
$ ./fib
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Custom { kind: UnexpectedEof, error: "" })', lib/engine-staticlib/src/artifact.rs:327:81
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5 |
This issue is somewhat related to #2916 |
Today, I update the codebase and try it again. The error was gone, but I get a new error: $ cd ./tests/examples
$ export WASMER_DIR=/workspaces/wasmer/package/
$ /workspaces/wasmer/target/release/wasmer create-exe fib.wat -o ./fib
Engine: staticlib
Compiler: cranelift
Target: x86_64-unknown-linux-gnu
✔ Native executable compiled successfully to `./fib`.
$ ./fib
Error getting WASI imports!
Error len: `52`
could not detect a WASI version on the given module |
Ideally, |
I have the same problems on windows. What's tools I need on windows? C:\Users\LIUD~1.H\AppData\Local\Temp>cat hello.rs
fn main() {
println!("Hello, world!");
}
C:\Users\LIUD~1.H\AppData\Local\Temp>rustc hello.rs --target wasm32-wasi
C:\Users\LIUD~1.H\AppData\Local\Temp>wasmer --version
wasmer 2.3.0
C:\Users\LIUD~1.H\AppData\Local\Temp>wasmer hello.wasm
Hello, world!
C:\Users\LIUD~1.H\AppData\Local\Temp>wasmer create-exe hello.wasm -o hello.exe
Engine: staticlib
Compiler: cranelift
Target: x86_64-pc-windows-msvc
error: Failed to compile C source code
╰─▶ 1: program not found
C:\Users\LIUD~1.H\AppData\Local\Temp>vs2022
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.1.2
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
C:\Users\LIUD~1.H\AppData\Local\Temp>cl /v
Microsoft (R) C/C++ Optimizing Compiler Version 19.31.31105 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line warning D9002 : ignoring unknown option '/v'
cl : Command line error D8003 : missing source filename
C:\Users\LIUD~1.H\AppData\Local\Temp>wasmer create-exe hello.wasm -o hello.exe
Engine: staticlib
Compiler: cranelift
Target: x86_64-pc-windows-msvc
error: Failed to compile C source code
╰─▶ 1: program not found
C:\Users\LIUD~1.H\AppData\Local\Temp> |
We are working to re-add it in Wasmer (master) as part of #2987 |
I can use |
Closing this, I was able to create a hello world executable using manos ~/wasmer % package/bin/wasmer create-exe ./tests/wasi-wast/wasi/snapshot1/hello.wasm -o hello
Compiler: cranelift
Target: aarch64-apple-darwin
Format: Symbols
Using libwasmer file: /Users/manos/wasmer/package/lib/libwasmer.a
Using path `/Users/manos/wasmer/package/lib/libwasmer.a` as libwasmer path.
✔ Native executable compiled successfully to `hello`.
manos ~/wasmer % ./hello
Hello, world! |
Describe the bug
.arg("-std=c99")
at this line and build the wasmer again:Steps to reproduce
Expected behavior
Actual behavior
Additional context
The text was updated successfully, but these errors were encountered: