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

Add static build when tag "static_build" is used #40

Closed
wants to merge 10 commits into from

Conversation

yaslama
Copy link

@yaslama yaslama commented Jun 10, 2019

No description provided.

@Hywan Hywan self-assigned this Jun 11, 2019
@Hywan Hywan added 🎉 enhancement New feature or request 📦 component-runtime About the Wasm runtime labels Jun 11, 2019
@Hywan
Copy link
Contributor

Hywan commented Jun 11, 2019

Thanks for the proposal. I would suggest to find a way to avoid copying the bridge.go content as most as possible. I'm OK to support static builds though. Do you have a particular use case for that?

Copy link
Contributor

@Hywan Hywan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't copy the content of bridge.go in another file.

@yaslama yaslama changed the title Add static build when tag "static" is used Add static build when tag "static_build" is used Jun 11, 2019
@yaslama
Copy link
Author

yaslama commented Jun 11, 2019

I'm OK to support static builds though. Do you have a particular use case for that?

In some case, it's a lot easier to copy a single executable to another place without having to install a bunch of dependencies which need to be installed in the same place as the builder (wasmer_link_static.go in this case) unless chrpath is used.

@yaslama
Copy link
Author

yaslama commented Jun 11, 2019

Please, don't copy the content of bridge.go in another file.

No problem. I modified the PR.

@yaslama
Copy link
Author

yaslama commented Jun 11, 2019

BTW, I tested the static compilation in linux only and the .a file needs imo to be replaced by a release binary from https://github.com/wasmerio/wasmer

@Hywan
Copy link
Contributor

Hywan commented Jun 11, 2019

bors try

bors bot added a commit that referenced this pull request Jun 11, 2019
@bors
Copy link
Contributor

bors bot commented Jun 11, 2019

@Hywan
Copy link
Contributor

Hywan commented Jun 24, 2019

Can you update the CircleCI configuration to test the static build please?

@yaslama
Copy link
Author

yaslama commented Jul 2, 2019

Can you update the CircleCI configuration to test the static build please?

I modified the justfile to build and test using also the static library

@yaslama
Copy link
Author

yaslama commented Jul 17, 2019

Hi @Hywan, what is missing from this PR in order to be merged?

@Hywan
Copy link
Contributor

Hywan commented Jul 17, 2019

Yeah, after a quicklook, everything seems good! Thank you. I'll merge it as soon as possible (today or Friday).

@Hywan
Copy link
Contributor

Hywan commented Jul 31, 2019

Sorry, I'm in holidays, will merge it in few days!

Copy link
Contributor

@Hywan Hywan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you very much! And sorry for the delay.

@Hywan
Copy link
Contributor

Hywan commented Aug 14, 2019

bors r+

bors bot added a commit that referenced this pull request Aug 14, 2019
40: Add static build when tag "static_build" is used r=Hywan a=yaslama



Co-authored-by: Yaacov Akiba Slama <[email protected]>
@bors
Copy link
Contributor

bors bot commented Aug 14, 2019

Build failed

@yaslama
Copy link
Author

yaslama commented Aug 14, 2019

Can you retry please?

@Hywan
Copy link
Contributor

Hywan commented Aug 28, 2019

bors r+

bors bot added a commit that referenced this pull request Aug 28, 2019
40: Add static build when tag "static_build" is used r=Hywan a=yaslama



Co-authored-by: Yaacov Akiba Slama <[email protected]>
@bors
Copy link
Contributor

bors bot commented Aug 28, 2019

Build failed

@Hywan
Copy link
Contributor

Hywan commented Aug 28, 2019

I think the static lib is different for macOS or some Linux distrib. I wonder whether it's good to embed it directly in the repository 🤔?

@AdamSLevy
Copy link
Contributor

I really like the approach that this PR is taking, and a similar approach could be used for conditional compilation of various backends and metering features.

@Hywan
Copy link
Contributor

Hywan commented May 12, 2020

bors try

@bors
Copy link
Contributor

bors bot commented May 12, 2020

try

Merge conflict.

@Hywan
Copy link
Contributor

Hywan commented May 12, 2020

Please can you fix the conflicts with master, so that we can run the tests.

@FlorianFranzen
Copy link

@yaslama: Are you still working on this? I would love to see this merged.

@yaslama
Copy link
Author

yaslama commented Jun 21, 2020

@Hywan I fixed the conflicts with master.

The macos linker doesn't support the -l:<file> syntax, so the dynamic and
static libraries cannot be in the same directory.
@yaslama
Copy link
Author

yaslama commented Jun 29, 2020

@Hywan Do you think that this PR can be merged soon?

@FlorianFranzen
Copy link

@Hywan It has been another month with no movement. Could we please get this merged?

@Hywan
Copy link
Contributor

Hywan commented Aug 17, 2020

bors try

bors bot added a commit that referenced this pull request Aug 17, 2020
@Hywan
Copy link
Contributor

Hywan commented Aug 17, 2020

@FlorianFranzen The entire team was extremely busy for a giant set of improvements for Wasmer. Hence my silence on those projects. Now I'm back on tracks. Give me time please.

@Hywan
Copy link
Contributor

Hywan commented Aug 17, 2020

I don't think the provided .a static lib in this PR is compatible between macOS and Linux. We should find a way to differentiate them. What do you think @yaslama?

@bors
Copy link
Contributor

bors bot commented Aug 17, 2020

try

Build succeeded:

@yaslama
Copy link
Author

yaslama commented Aug 17, 2020

I don't think the provided .a static lib in this PR is compatible between macOS and Linux. We should find a way to differentiate them. What do you think @yaslama?

We can put the static libraries in a folder per arch. But on second thought, it's perhaps better to let the user build herself the static libraries. What do you think?

@FlorianFranzen
Copy link

FlorianFranzen commented Aug 17, 2020

@Hywan Of course, thank you for taking another look.

My main concern would be that it is easy to use with the default go tool chain. I am not sure how far that is possible if you are required to compile wasmer from source. But I am not really a go expert...

@FlorianFranzen
Copy link

@Hywan I know you have been working hard on the v1.0.0 release, but has there been any update on static builds?

@Hywan
Copy link
Contributor

Hywan commented Feb 16, 2021

Closing in favor of #190 and #193. With those PR, it's now possible to build your own custom libs (dylib or static lib) and link against wasmer-go. See https://github.com/wasmerio/wasmer-go#supported-platforms, then unfold the What to do if your platform is missing? Section.

@Hywan Hywan closed this Feb 16, 2021
@FlorianFranzen
Copy link

@Hywan Most go programs are statically linked i.e. do not depend on shared libraries. go-wasmer breaks with this and I am not sure why. To ship any go binary that uses go-wasmer, I have to fish libwasmer.so out of my go module path after building.

Would it really be to much to ask to use a static build libwasmer instead of the shared one. As far as I can tell you would only need to change the crate type from cdylib to staticlib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 component-runtime About the Wasm runtime 🎉 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants