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

Release FFI binaries for other platforms #39

Open
mirogta opened this issue Jan 27, 2022 · 0 comments
Open

Release FFI binaries for other platforms #39

mirogta opened this issue Jan 27, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@mirogta
Copy link
Contributor

mirogta commented Jan 27, 2022

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):

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

No branches or pull requests

1 participant