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

adding wasmer_runtime_c_api for musl #113

Open
diegobes opened this issue Feb 1, 2020 · 10 comments
Open

adding wasmer_runtime_c_api for musl #113

diegobes opened this issue Feb 1, 2020 · 10 comments
Assignees
Labels
🐞 bug Something isn't working 📦 component-runtime About the Wasm runtime

Comments

@diegobes
Copy link
Contributor

diegobes commented Feb 1, 2020

Thanks for the bug report!

Describe the bug

I create a wasmer_runtime_c_api for musl to be able to deploy my Wasmer Go application using the super small Alpine based Docker image.
I copied it to the wasmer directory, but CGO always select the wasmer_runtime_c_api.so instead of my static wasmer_runtime_c_api.a library.

Because Alpine is non glibc compatible, linking go-ext-wasm with wasmer_runtime_c_api.so fails.
But linking it with the static library I created for musl works fine.

Question

1-What is the best way to add the musl based static library and make bridge.go to link the right library ?
2- When linking with my static library int32_t is not recognized when I define an extern C based function. any clue why its that ?

Thanks
-- Diego

@diegobes diegobes added the 🐞 bug Something isn't working label Feb 1, 2020
@Hywan
Copy link
Contributor

Hywan commented Feb 5, 2020

Since 8 days, we officially support musl (see wasmerio/wasmer#1180). We can wait the next release (will happen in few days) to update go-ext-wasm and see if everything fits together. Thoughts?

@Hywan Hywan self-assigned this Feb 5, 2020
@Hywan Hywan added the 📦 component-runtime About the Wasm runtime label Feb 5, 2020
@diegobes
Copy link
Contributor Author

Any plan to update to the new wasmer capi from 0.14.1 ?

@syrusakbary
Copy link
Member

syrusakbary commented Feb 28, 2020

Yes, we are working on updating it.

More info: #120 (note: it should be merged soon)

@diegobes
Copy link
Contributor Author

diegobes commented Mar 1, 2020

thanks,
I don't see in #120 the static libwasmer library being added.
I think the only way to link on musl ( Alpine ) is with a static library.
It is still work in progress ?

@Hywan
Copy link
Contributor

Hywan commented Mar 3, 2020

It is still a WIP.

@diegobes
Copy link
Contributor Author

Hi, Any update on this ?
Thanks

@Hywan
Copy link
Contributor

Hywan commented Aug 17, 2020

Didn't make any progress on that front for the moment. I'm moving it on top of my todo list!

@Hywan
Copy link
Contributor

Hywan commented Feb 4, 2021

Waiting on wasmerio/wasmer#2003.

@blixt
Copy link

blixt commented Aug 17, 2021

It seems like everything is merged – how does one compile a Go binary using wasmer-go on Alpine (Docker alpine image in my case)?

@Hywan
Copy link
Contributor

Hywan commented Aug 17, 2021

I think we would need to support static lib (not a big deal) before proposing musl builds. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 📦 component-runtime About the Wasm runtime
Projects
None yet
Development

No branches or pull requests

4 participants