Upgrade to golang-with-libgit2:1.1.1.6 and use static libraries for in development#562
Upgrade to golang-with-libgit2:1.1.1.6 and use static libraries for in development#562hiddeco merged 7 commits intofluxcd:mainfrom pjbgf:test-alpine
Conversation
|
This fails on Apple Silicon with: $ uname -a
Darwin stefan-m1-max.lan 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 arm64
$ make test
IMG_TAG=ghcr.io/fluxcd/golang-with-libgit2:libgit2-1.1.1-4 ./hack/extract-libraries.sh
+ IMG_TAG=ghcr.io/fluxcd/golang-with-libgit2:libgit2-1.1.1-4
+ setup_current
+ '[' -d ./hack/libgit2 ']'
+ DIR=x86_64-alpine-linux-musl
+ PLATFORM=linux/amd64
++ uname -m
+ '[' arm64 = armv7l ']'
++ uname -m
+ '[' arm64 = aarch64 ']'
+ setup linux/amd64 x86_64-alpine-linux-musl
+ PLATFORM=linux/amd64
+ DIR=x86_64-alpine-linux-musl
+ extract linux/amd64 x86_64-alpine-linux-musl
+ PLATFORM=linux/amd64
+ DIR=x86_64-alpine-linux-musl
++ docker create --platform=linux/amd64 ghcr.io/fluxcd/golang-with-libgit2:libgit2-1.1.1-4
+ id=1a11d719c1ebf1b0b014a457670c22388b736a3c9926546133b69b2f738949c4
+ docker cp 1a11d719c1ebf1b0b014a457670c22388b736a3c9926546133b69b2f738949c4:/usr/local -
+ docker rm -v 1a11d719c1ebf1b0b014a457670c22388b736a3c9926546133b69b2f738949c4
1a11d719c1ebf1b0b014a457670c22388b736a3c9926546133b69b2f738949c4
+ tar -xf output.tar.gz local/x86_64-alpine-linux-musl --strip-component=1
tar: --strip-component=1: Not found in archive
tar: Error exit delayed from previous errors.
make: *** [Makefile:146: /Users/stefanprodan/go/src/github.com/fluxcd/source-controller/hack/libgit2/lib/libgit2.a] Error 1 |
@stefanprodan thank you for testing, the output was quite useful. Do you mind testing it again with the latest change? |
|
Now it fails with: |
|
75dee8f fails with: |
|
Running I initially thought the problem was the temporary folder was failing to be created, but then even after changing it to create the files at ./build/tmp/ it still errors. I removed the I executed the same command on a arm/v8 machine (rpi 4), and this worked fine (apart from some disk related tests): |
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
Fix issues developing in amd64, arm64 and apple silicon Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
https://github.com/onsi/ginkgo/blob/ver2/docs/MIGRATING_TO_V2.md\#removed-async-testing Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
|
This has been tested on the physical environments:
Pending the final test that @aryan9600 is going to run on |
|
92718e5 fails with: |
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
| mkdir tmp-download; cd tmp-download; go mod init go-download; | ||
| GOBIN="${GITHUB_WORKSPACE}/build/gobin" go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest | ||
| cd ..; rm -rf tmp-download |
There was a problem hiding this comment.
Our arm64 runners don't seem to be able to deal with Makefile's go-install-tool when installing setup-envtest. Although it works fine for all other targets.
hiddeco
left a comment
There was a problem hiding this comment.
This was quite something to review, but it looks all good to me!
Awesome job on fixing the wiring on the cross-compile to get the build times back to normal, and a stellar job on solving the build issues on MacOS 🙇 💯
stefanprodan
left a comment
There was a problem hiding this comment.
LGTM
Tested this on Apple Silicon and works great. Thanks @pjbgf 🏅
Main changes:
golang-with-libgit2:1.1.1.6to speed up build time when cross compiling. Previous version was compiling in emulation mode instead, which added +10x overhead.make testis executed against the exact same libraries that will be shipped on the built image.Makefileto reduce its complexity.linux-amd64download static libraries from the official container image.linux-arm64on top of the above, requires static musl tool chain (automatically downloaded).darwin-amd64anddarwin-arm64download universal static libraries fordarwinfrom https://github.com/fluxcd/golang-with-libgit2 releases.Depends on:
Fix: #568