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
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.
The text was updated successfully, but these errors were encountered:
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:
TL;DR: We need to look into building go-git2consul for different platforms without any external dependencies.
The text was updated successfully, but these errors were encountered: