CosmWasm / wasmvm

Go bindings to the running cosmwasm contracts with wasmer
Apache License 2.0
173 stars 99 forks source link

Add static build for macos #387

Closed helder-moreira closed 1 year ago

helder-moreira commented 1 year ago

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.

helder-moreira commented 1 year ago

@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 commented 1 year ago

This was merged right before the 1.2.1 release. So it should be usable now. Could you try it out? See https://github.com/CosmWasm/wasmvm/issues/407 for follow up discussions on that topic.