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

Create crossbuild pipeline for binary distribution #7

Open
calvn opened this issue Jun 27, 2016 · 0 comments
Open

Create crossbuild pipeline for binary distribution #7

calvn opened this issue Jun 27, 2016 · 0 comments
Milestone

Comments

@calvn
Copy link
Contributor

calvn commented Jun 27, 2016

Currently, running make build to build the project generates a binary that is dynamically linked. This means that in order for go-git2consul to work, the machine needs libgit2 (and its dependencies). In order for go-git2consul to be compiled without any external depedencies, all those will have to be compiled statically.

There is currently no good story on crossbulding the project statically for different platforms, especially when the project requires static external cgo dependenies. Right now, the build scripts inside build/ can statically build a linux-amd64 binary, but we need to extend this for other platforms, which is non-trivial to say the least. This would require a gcc cross-compiler to build each dependency, and most likely other details that are specific to each platform which needs to be passed into the build. libgit2 and libssh2 uses cmake, which in turn calls pkg-config to resolve library and include paths. We would need to ensure that pkg-config point libraries and includes to the correct path for the specific platform.

At the end of the day we would want something like this, but for other platforms:

file build/bin/git2consul.linux.amd64
build/bin/git2consul.linux.amd64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped

TL;DR: We need to look into building go-git2consul for different platforms without any external dependencies.

@calvn calvn added this to the v0.1.0 milestone Aug 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant