Skip to content
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

[c-api] could not load symbol "wasm_importtype_copy": #3322

Closed
Pangoraw opened this issue Nov 17, 2022 · 1 comment · Fixed by #3403
Closed

[c-api] could not load symbol "wasm_importtype_copy": #3322

Pangoraw opened this issue Nov 17, 2022 · 1 comment · Fixed by #3403
Assignees
Labels
bug Something isn't working 📦 lib-c-api About wasmer-c-api priority-medium Medium priority issue
Milestone

Comments

@Pangoraw
Copy link
Contributor

Describe the bug

The c-api does not export the function wasm_importtype_copy even tough it is defined in the wasm.h header file.

echo "`wasmer -V` | `rustc -V` | `uname -m`"
# wasmer 3.0.0-rc.2 | rustc 1.61.0 (fe5b13d68 2022-05-18) | x86_64

Steps to reproduce

  1. Run make build-capi
  2. Test with nm target/release/libwasmer.so | grep wasm_importtype_copy which will fail

Expected behavior

The function should be implemented as per the wasm.h header.

Actual behavior

The function is not implemented.

Additional context

I suspect that adding the implementation can be fixed by adding this simple line:

From 49703d0d0db0a100c810660316560f05e165415d Mon Sep 17 00:00:00 2001
From: Paul <[email protected]>
Date: Thu, 17 Nov 2022 23:02:45 +0100
Subject: [PATCH] implement wasm_importtype_copy

---
 lib/c-api/src/wasm_c_api/types/import.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/c-api/src/wasm_c_api/types/import.rs b/lib/c-api/src/wasm_c_api/types/import.rs
index dc2e891d7..8be6b99c1 100644
--- a/lib/c-api/src/wasm_c_api/types/import.rs
+++ b/lib/c-api/src/wasm_c_api/types/import.rs
@@ -11,6 +11,7 @@ pub struct wasm_importtype_t {
 }
 
 wasm_declare_boxed_vec!(importtype);
+wasm_impl_copy!(importtype);
 
 #[no_mangle]
 pub extern "C" fn wasm_importtype_new(
-- 
2.38.1
@Pangoraw Pangoraw added the bug Something isn't working label Nov 17, 2022
@fschutt
Copy link
Contributor

fschutt commented Nov 22, 2022

Thank you for finding this bug, it's probably just a missing export on the API. We will fix this in the next version.

@fschutt fschutt self-assigned this Nov 22, 2022
@Michael-F-Bryan Michael-F-Bryan added 📦 lib-c-api About wasmer-c-api priority-medium Medium priority issue labels Nov 29, 2022
@ptitSeb ptitSeb added this to the v3.1 milestone Nov 30, 2022
@bors bors bot closed this as completed in ef8d2f6 Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📦 lib-c-api About wasmer-c-api priority-medium Medium priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants