You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Story:
As a developer who wants to use iotics-identity-go FFI wrapper
I want the FFI binaries pre-built and released
So that I can easily use them for my project in Rust language
We want to publish c-archive (go build -buildmode=c-archive) for the most common platform(s):
We thought that this should be easily achievable with GoReleaser which supports cross-compilation. But it didn't work, because of a mismatch of the required flags: CGO_ENABLED=1 and -buildmode=c-archive which fail the cross-compilation on some of the platforms.
We could use xgo, a more recent fork of the original xgo
I've tried this command locally which has built all the FFI binaries for almost all the required platforms… except darwin/arm64. It uses "small" docker containers for different OS/arch. For me, it meant >1GB download for each build on a clean system, so not ideal.
go get github.com/karalabe/xgo
xgo -out iotics-identity-ffi-$VERSION --pkg ffi --targets=\*/amd64,\*/arm64 -buildmode=c-archive github.com/Iotic-Labs/iotics-identity-go
Finally, I ran into zig - which seems to be able to cross-compile even for darwin/arm64
More here
Looks like Zig can be used together with GoReleaser (but the below links are for building Zig projects):
Story:
As a developer who wants to use iotics-identity-go FFI wrapper
I want the FFI binaries pre-built and released
So that I can easily use them for my project in Rust language
We want to publish c-archive (
go build -buildmode=c-archive
) for the most common platform(s):We thought that this should be easily achievable with GoReleaser which supports cross-compilation. But it didn't work, because of a mismatch of the required flags:
CGO_ENABLED=1
and-buildmode=c-archive
which fail the cross-compilation on some of the platforms.We could use xgo, a more recent fork of the original xgo
I've tried this command locally which has built all the FFI binaries for almost all the required platforms… except
darwin/arm64
. It uses "small" docker containers for different OS/arch. For me, it meant >1GB download for each build on a clean system, so not ideal.Finally, I ran into zig - which seems to be able to cross-compile even for
darwin/arm64
More here
Looks like Zig can be used together with GoReleaser (but the below links are for building Zig projects):
The text was updated successfully, but these errors were encountered: