You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to run the runtime-c-api tests but I'm running into this compilation issue. I'm on an up to date Arch Linux system. I've run rustup default nightly.
$ cargo test -- --nocapture
...
[ 23%] Built target test-module-imports
Scanning dependencies of target test-import-function
[ 26%] Building C object CMakeFiles/test-import-function.dir/test-import-function.c.o
stderr:
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c: In function ‘print_str’:
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:23:47: error: implicit declaration of function ‘wasmer_trampoline_get_context’ [-Werror=implicit-function-declaration]
23 | struct print_str_context *local_context = wasmer_trampoline_get_context();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:23:47: error: initialization of ‘struct print_str_context *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c: In function ‘main’:
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:51:5: error: unknown type name ‘wasmer_trampoline_buffer_builder_t’
51 | wasmer_trampoline_buffer_builder_t *tbb = wasmer_trampoline_buffer_builder_new();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:51:47: error: implicit declaration of function ‘wasmer_trampoline_buffer_builder_new’ [-Werror=implicit-function-declaration]
51 | wasmer_trampoline_buffer_builder_t *tbb = wasmer_trampoline_buffer_builder_new();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:51:47: error: initialization of ‘int *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:52:35: error: implicit declaration of function ‘wasmer_trampoline_buffer_builder_add_context_trampoline’ [-Werror=implicit-function-declaration]
52 | unsigned long print_str_idx = wasmer_trampoline_buffer_builder_add_context_trampoline(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:54:10: error: ‘wasmer_trampoline_callable_t’ undeclared (first use in this function)
54 | (wasmer_trampoline_callable_t *) print_str,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:54:10: note: each undeclared identifier is reported only once for each function it appears in
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:54:40: error: expected expression before ‘)’ token
54 | (wasmer_trampoline_callable_t *) print_str,
| ^
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:57:5: error: unknown type name ‘wasmer_trampoline_buffer_t’
57 | wasmer_trampoline_buffer_t *tb = wasmer_trampoline_buffer_builder_build(tbb);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:57:38: error: implicit declaration of function ‘wasmer_trampoline_buffer_builder_build’ [-Werror=implicit-function-declaration]
57 | wasmer_trampoline_buffer_t *tb = wasmer_trampoline_buffer_builder_build(tbb);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:57:38: error: initialization of ‘int *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:58:40: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
58 | const wasmer_trampoline_callable_t *print_str_callable = wasmer_trampoline_buffer_get_trampoline(tb, print_str_idx);
| ^
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:58:41: error: ‘print_str_callable’ undeclared (first use in this function); did you mean ‘print_str_called’?
58 | const wasmer_trampoline_callable_t *print_str_callable = wasmer_trampoline_buffer_get_trampoline(tb, print_str_idx);
| ^~~~~~~~~~~~~~~~~~
| print_str_called
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:58:62: error: implicit declaration of function ‘wasmer_trampoline_buffer_get_trampoline’ [-Werror=implicit-function-declaration]
58 | const wasmer_trampoline_callable_t *print_str_callable = wasmer_trampoline_buffer_get_trampoline(tb, print_str_idx);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/aslevy/repos/wasmer/lib/runtime-c-api/tests/test-import-function.c:121:5: error: implicit declaration of function ‘wasmer_trampoline_buffer_destroy’ [-Werror=implicit-function-declaration]
121 | wasmer_trampoline_buffer_destroy(tb);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/test-import-function.dir/build.make:63: CMakeFiles/test-import-function.dir/test-import-function.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:220: CMakeFiles/test-import-function.dir/all] Error 2
make: *** [Makefile:95: all] Error 2
thread 'test_c_api' panicked at 'Command failed with exit status: ExitStatus(ExitStatus(512))', lib/runtime-c-api/tests/runtime_c_api_tests.rs:41:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
failures:
test_c_api
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
error: test failed, to rerun pass '--test runtime_c_api_tests'
It appears that a number of things aren't defined due to some macro guards that depend on __x86_64__ being defined prior to including the wasmer.h file. I'm on an x86_64 machine, why is this not working for me? Is this something I need to specify myself somehow?
The text was updated successfully, but these errors were encountered:
Summary
I am attempting to run the runtime-c-api tests but I'm running into this compilation issue. I'm on an up to date Arch Linux system. I've run
rustup default nightly
.It appears that a number of things aren't defined due to some macro guards that depend on
__x86_64__
being defined prior to including thewasmer.h
file. I'm on an x86_64 machine, why is this not working for me? Is this something I need to specify myself somehow?The text was updated successfully, but these errors were encountered: