-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Cross compile Skaffold, with CGO=1, using xgo #2006
Conversation
retriggered kokoro... |
e380dc0
to
0795316
Compare
Codecov Report
@@ Coverage Diff @@
## master #2006 +/- ##
=======================================
Coverage 58.55% 58.55%
=======================================
Files 188 188
Lines 7882 7882
=======================================
Hits 4615 4615
Misses 2877 2877
Partials 390 390 Continue to review full report at Codecov.
|
de11413
to
023061e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this in cloudbuild and can't get it to work with either cloudbuild.yaml
or cloudbuild_release.yaml
. not really sure what's going on but looks like the way the package is specified in the makefile is wrong?
Starting Step #2
Step #2: Already have image: gcr.io/nkubala-demo/skaffold-builder:latest
Step #2: go get github.com/karalabe/xgo
Step #2: mkdir -p ./out
Step #2: xgo -go 1.12 -dest ./out -out skaffold --pkg cmd/skaffold --targets=linux/amd64 -ldflags " -extldflags \"\" -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.version=test -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.buildDate=2019-05-21T20:05:34Z -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.gitCommit=023061e9263fe2aab321e29cb1bbc00b3583f992 -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.gitTreeState=dirty " .
Step #2: xgo -go 1.12 -dest ./out -out skaffold --pkg cmd/skaffold --targets=darwin/amd64 -ldflags " -extldflags \"\" -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.version=test -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.buildDate=2019-05-21T20:05:34Z -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.gitCommit=023061e9263fe2aab321e29cb1bbc00b3583f992 -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.gitTreeState=dirty " .
Step #2: xgo -go 1.12 -dest ./out -out skaffold --pkg cmd/skaffold --targets=windows/amd64 -ldflags " -extldflags \"\" -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.version=test -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.buildDate=2019-05-21T20:05:34Z -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.gitCommit=023061e9263fe2aab321e29cb1bbc00b3583f992 -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.gitTreeState=dirty " .
Step #2: Checking docker installation...
Step #2: Checking docker installation...
Step #2: Checking docker installation...
Step #2: Client:Client:
Step #2: Version: 17.12.0-ce
Step #2: API version: 1.35
Step #2: Version:
Step #2: Go version: go1.9.2
Step #2: Git commit: c97c6d6
Step #2: Built: Wed Dec 27 20:11:19 2017
Step #2: OS/Arch: 17.12.0-celinux/
Step #2: API version: amd641.35
Step #2: Go version: go1.9.2
Step #2: Git commit:
Step #2:
Step #2: Server:c97c6d6
Step #2: Built: Wed Dec 27 20:11:19 2017
Step #2: OS/Arch: Docker Engine - Communitylinux
Step #2: /Engineamd64:
Step #2: Version: 18.09.3
Step #2: API version: 1.39 (minimum version
Step #2:
Step #2: Server:1.12)
Step #2: Go version: go1.10.8
Step #2: Git commit: Docker Engine - Community774a1f4
Step #2: Built:
Step #2: EngineThu Feb 28 05:59:55 2019
Step #2: OS/Arch: :linux
Step #2: Version: /18.09.3
Step #2: API version: amd64
Step #2: Experimental: false
Step #2: 1.39 (minimum version 1.12)
Step #2: Go version: go1.10.8
Step #2: Git commit: 774a1f4
Step #2: Built: Thu Feb 28 05:59:55 2019
Step #2: OS/Arch: linux/amd64
Step #2: Experimental: false
Step #2: Client:
Step #2: Version: 17.12.0-ce
Step #2: API version: 1.35
Step #2: Go version: go1.9.2
Step #2: Git commit: c97c6d6
Step #2: Built: Wed Dec 27 20:11:19 2017
Step #2: OS/Arch: linux/amd64
Step #2:
Step #2: Server: Docker Engine - Community
Step #2: Engine:
Step #2: Version: 18.09.3
Step #2: API version: 1.39 (minimum version 1.12)
Step #2: Go version: go1.10.8
Step #2: Git commit: 774a1f4
Step #2: Built: Thu Feb 28 05:59:55 2019
Step #2: OS/Arch: linux/amd64
Step #2: Experimental: false
Step #2:
Step #2: Checking for required docker image karalabe/xgo-1.12...
Step #2: Checking for required docker image karalabe/xgo-1.12...
Step #2: Checking for required docker image karalabe/xgo-1.12... not found!
Step #2: Pulling karalabe/xgo-1.12 from docker registry...
...
Step #2: 71df745edc4b: Pull complete
Step #2: Digest: sha256:8ae9af35741b457f6796914c9e3c215b6cc31109c6c55562042c9e41d97821f5
Step #2: Digest: sha256:8ae9af35741b457f6796914c9e3c215b6cc31109c6c55562042c9e41d97821f5
Step #2: Digest: sha256:8ae9af35741b457f6796914c9e3c215b6cc31109c6c55562042c9e41d97821f5
Step #2: Status: Image is up to date for karalabe/xgo-1.12:latest
Step #2: Status: Downloaded newer image for karalabe/xgo-1.12:latest
Step #2: Status: Image is up to date for karalabe/xgo-1.12:latest
Step #2: Cross compiling ....
Step #2: Cross compiling ....
Step #2: Cross compiling ....
Step #2: Building locally ....
Step #2: Building locally ....
Step #2: Building locally ....
Step #2: Compiling for linux/amd64...
Step #2: Compiling for darwin-10.6/amd64...
Step #2: Compiling for windows-4.0/amd64...
Step #2: can't load package: package ./cmd/skaffold: cannot find package "./cmd/skaffold" in:
Step #2: /cmd/skaffold
Step #2: can't load package: package ./cmd/skaffold: cannot find package "./cmd/skaffold" in:
Step #2: /cmd/skaffold
Step #2: can't load package: package ./cmd/skaffold: cannot find package "./cmd/skaffold" in:
Step #2: /cmd/skaffold
Step #2: 2019/05/21 20:06:43 Failed to cross compile package: exit status 1.
Step #2: Makefile:62: recipe for target 'out/skaffold-darwin-amd64' failed
Step #2: make: *** [out/skaffold-darwin-amd64] Error 1
Step #2: make: *** Waiting for unfinished jobs....
Step #2: 2019/05/21 20:06:43 Failed to cross compile package: exit status 1.
Step #2: Makefile:62: recipe for target 'out/skaffold-linux-amd64' failed
Step #2: make: *** [out/skaffold-linux-amd64] Error 1
Step #2: 2019/05/21 20:06:44 Failed to cross compile package: exit status 1.
Step #2: make: *** [out/skaffold-windows-amd64] Error 1
Step #2: Makefile:62: recipe for target 'out/skaffold-windows-amd64' failed
Finished Step #2
ERROR
I have no idea why it works on my machine but not on cloud build... I spent an hour trying to understand. xgo runs containers so on Cloud Build, it's Docker in Docker. Maybe that's the source of the issue. I'll have to try again |
Turns out it's a docker in docker issue. I'll see if I can find a solution. |
4f464a1
to
69a183f
Compare
Fixes GoogleContainerTools#1936 Signed-off-by: David Gageot <david@gageot.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome!
This is very exciting, thank you for experimenting with it! |
Fixes #1936
Signed-off-by: David Gageot david@gageot.net