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 for macos #387

Merged
merged 2 commits into from
Mar 8, 2023
Merged

Add static build for macos #387

merged 2 commits into from
Mar 8, 2023

Conversation

helder-moreira
Copy link
Contributor

@helder-moreira helder-moreira commented Jan 19, 2023

This PR adds support for building static wasmvm (universal) for darwin.

Here at Nibiru we would like to provide binaries for both linux and darwin, without requesting users to manually install libraries. We are aware that going fully static on macOS is hard (if not impossible), and we still need to link dynamically to system libraries, but at least libwasmvm can be statically linked to our executable.

With this changes, we can use a simple goreleaser config and goreleaser-cross to build binaries to all platforms.

NOTE:
I have included the built library under internal/api/static to make builds easier. But it is huge. If you prefer I can remove it and remove the cgo LDFLAGS and we add the flags to our build config instead.

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Cool stuff, thanks

libwasmvm/Cargo.toml Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@helder-moreira
Copy link
Contributor Author

@webmaster128 after this is merged, would it be possible to backport this to v1.2.0? Even it is just built and published in release assets would be nice.

@webmaster128 webmaster128 mentioned this pull request Mar 8, 2023
4 tasks
@webmaster128 webmaster128 merged commit 78f9a41 into CosmWasm:main Mar 8, 2023
@webmaster128
Copy link
Member

This was merged right before the 1.2.1 release. So it should be usable now. Could you try it out? See #407 for follow up discussions on that topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants