diff options
| author | Paul Barker <pbarker@toganlabs.com> | 2017-10-05 13:38:18 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-10-05 10:44:04 -0400 |
| commit | a1085de5319d1ad5a5227c7f1cb44cef2a6bb085 (patch) | |
| tree | fa90a8f8790ce4f959f8c57e66408c67e8397c3d | |
| parent | 9a24b3eb635ef745f5ea5b567d900c8659c02097 (diff) | |
| download | meta-virtualization-a1085de5319d1ad5a5227c7f1cb44cef2a6bb085.tar.gz | |
runc: Use correct go cross-compiler
The makefiles for both providers of runc need to be patched in similar ways to
ensure that we use the binaries from go-cross and not go-native.
Signed-off-by: Paul Barker <pbarker@toganlabs.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
4 files changed, 177 insertions, 1 deletions
diff --git a/recipes-containers/runc/runc-docker/0001-Use-correct-go-cross-compiler.patch b/recipes-containers/runc/runc-docker/0001-Use-correct-go-cross-compiler.patch new file mode 100644 index 00000000..8f5171ab --- /dev/null +++ b/recipes-containers/runc/runc-docker/0001-Use-correct-go-cross-compiler.patch | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | From 037c20b3b3ef5e9ead0282aa64f9b88c0c18934d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Paul Barker <pbarker@toganlabs.com> | ||
| 3 | Date: Thu, 5 Oct 2017 13:14:40 +0000 | ||
| 4 | Subject: [PATCH] Use correct go cross-compiler | ||
| 5 | |||
| 6 | We need to use '${GO}' as set by OpenEmbedded instead of just 'go'. Just using | ||
| 7 | 'go' will invoke go-native. | ||
| 8 | |||
| 9 | Signed-off-by: Paul Barker <pbarker@toganlabs.com> | ||
| 10 | Upstream-status: Inappropriate | ||
| 11 | --- | ||
| 12 | Makefile | 20 ++++++++++---------- | ||
| 13 | 1 file changed, 10 insertions(+), 10 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/Makefile b/Makefile | ||
| 16 | index 8117892..0fcf508 100644 | ||
| 17 | --- a/src/import/Makefile | ||
| 18 | +++ b/src/import/Makefile | ||
| 19 | @@ -27,18 +27,18 @@ SHELL := $(shell command -v bash 2>/dev/null) | ||
| 20 | .DEFAULT: runc | ||
| 21 | |||
| 22 | runc: $(SOURCES) | ||
| 23 | - go build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o runc . | ||
| 24 | + $(GO) build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o runc . | ||
| 25 | |||
| 26 | all: runc recvtty | ||
| 27 | |||
| 28 | recvtty: contrib/cmd/recvtty/recvtty | ||
| 29 | |||
| 30 | contrib/cmd/recvtty/recvtty: $(SOURCES) | ||
| 31 | - go build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty | ||
| 32 | + $(GO) build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty | ||
| 33 | |||
| 34 | static: $(SOURCES) | ||
| 35 | - CGO_ENABLED=1 go build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o runc . | ||
| 36 | - CGO_ENABLED=1 go build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty | ||
| 37 | + CGO_ENABLED=1 $(GO) build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o runc . | ||
| 38 | + CGO_ENABLED=1 $(GO) build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty | ||
| 39 | |||
| 40 | release: | ||
| 41 | @flag_list=(seccomp selinux apparmor static); \ | ||
| 42 | @@ -62,15 +62,15 @@ release: | ||
| 43 | CGO_ENABLED=1; \ | ||
| 44 | }; \ | ||
| 45 | echo "Building target: $$output"; \ | ||
| 46 | - go build -i $(EXTRA_FLAGS) -ldflags "$$ldflags $(EXTRA_LDFLAGS)" -tags "$$tags" -o "$$output" .; \ | ||
| 47 | + $(GO) build -i $(EXTRA_FLAGS) -ldflags "$$ldflags $(EXTRA_LDFLAGS)" -tags "$$tags" -o "$$output" .; \ | ||
| 48 | done | ||
| 49 | |||
| 50 | dbuild: runcimage | ||
| 51 | docker run --rm -v $(CURDIR):/go/src/$(PROJECT) --privileged $(RUNC_IMAGE) make clean all | ||
| 52 | |||
| 53 | lint: | ||
| 54 | - go vet $(allpackages) | ||
| 55 | - go fmt $(allpackages) | ||
| 56 | + $(GO) vet $(allpackages) | ||
| 57 | + $(GO) fmt $(allpackages) | ||
| 58 | |||
| 59 | man: | ||
| 60 | man/md2man-all.sh | ||
| 61 | @@ -88,7 +88,7 @@ unittest: runcimage | ||
| 62 | docker run -e TESTFLAGS -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localunittest | ||
| 63 | |||
| 64 | localunittest: all | ||
| 65 | - go test -timeout 3m -tags "$(BUILDTAGS)" ${TESTFLAGS} -v $(allpackages) | ||
| 66 | + $(GO) test -timeout 3m -tags "$(BUILDTAGS)" ${TESTFLAGS} -v $(allpackages) | ||
| 67 | |||
| 68 | integration: runcimage | ||
| 69 | docker run -e TESTFLAGS -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localintegration | ||
| 70 | @@ -134,10 +134,10 @@ clean: | ||
| 71 | validate: | ||
| 72 | script/validate-gofmt | ||
| 73 | script/validate-shfmt | ||
| 74 | - go vet $(allpackages) | ||
| 75 | + $(GO) vet $(allpackages) | ||
| 76 | |||
| 77 | ci: validate localtest | ||
| 78 | |||
| 79 | # memoize allpackages, so that it's executed only once and only if used | ||
| 80 | -_allpackages = $(shell go list ./... | grep -v vendor) | ||
| 81 | +_allpackages = $(shell $(GO) list ./... | grep -v vendor) | ||
| 82 | allpackages = $(if $(__allpackages),,$(eval __allpackages := $$(_allpackages)))$(__allpackages) | ||
| 83 | -- | ||
| 84 | 2.7.4 | ||
| 85 | |||
diff --git a/recipes-containers/runc/runc-docker_git.bb b/recipes-containers/runc/runc-docker_git.bb index 97353254..01986528 100644 --- a/recipes-containers/runc/runc-docker_git.bb +++ b/recipes-containers/runc/runc-docker_git.bb | |||
| @@ -8,10 +8,13 @@ SRC_URI = "git://github.com/docker/runc.git;nobranch=1;name=runc-docker \ | |||
| 8 | file://0002-Remove-Platform-as-no-longer-in-OCI-spec.patch \ | 8 | file://0002-Remove-Platform-as-no-longer-in-OCI-spec.patch \ |
| 9 | file://0003-Update-memory-specs-to-use-int64-not-uint64.patch \ | 9 | file://0003-Update-memory-specs-to-use-int64-not-uint64.patch \ |
| 10 | file://0001-runc-Add-console-socket-dev-null.patch \ | 10 | file://0001-runc-Add-console-socket-dev-null.patch \ |
| 11 | file://0001-Use-correct-go-cross-compiler.patch \ | ||
| 11 | " | 12 | " |
| 12 | 13 | ||
| 13 | GO_IMPORT = "import" | 14 | GO_IMPORT = "import" |
| 14 | 15 | ||
| 16 | EXTRA_FLAGS = "-v -x -work" | ||
| 17 | |||
| 15 | RUNC_VERSION = "1.0.0-rc3" | 18 | RUNC_VERSION = "1.0.0-rc3" |
| 16 | PROVIDES += "virtual/runc" | 19 | PROVIDES += "virtual/runc" |
| 17 | RPROVIDES_${PN} = "virtual/runc" | 20 | RPROVIDES_${PN} = "virtual/runc" |
diff --git a/recipes-containers/runc/runc-opencontainers/0001-Use-correct-go-cross-compiler.patch b/recipes-containers/runc/runc-opencontainers/0001-Use-correct-go-cross-compiler.patch new file mode 100644 index 00000000..67d70148 --- /dev/null +++ b/recipes-containers/runc/runc-opencontainers/0001-Use-correct-go-cross-compiler.patch | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | From 621e5e9a196daaaf5eb430a413fe51218cf42c89 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Paul Barker <pbarker@toganlabs.com> | ||
| 3 | Date: Wed, 4 Oct 2017 15:45:27 +0000 | ||
| 4 | Subject: [PATCH] Use correct go cross-compiler | ||
| 5 | |||
| 6 | We need to use '${GO}' as set by OpenEmbedded instead of just 'go'. Just using | ||
| 7 | 'go' will invoke go-native. | ||
| 8 | |||
| 9 | Signed-off-by: Paul Barker <pbarker@toganlabs.com> | ||
| 10 | Upstream-status: Inappropriate | ||
| 11 | --- | ||
| 12 | Makefile | 20 ++++++++++---------- | ||
| 13 | 1 file changed, 10 insertions(+), 10 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/Makefile b/Makefile | ||
| 16 | index 6781ac7..74e551d 100644 | ||
| 17 | --- a/src/import/Makefile | ||
| 18 | +++ b/src/import/Makefile | ||
| 19 | @@ -27,18 +27,18 @@ SHELL := $(shell command -v bash 2>/dev/null) | ||
| 20 | .DEFAULT: runc | ||
| 21 | |||
| 22 | runc: $(SOURCES) | ||
| 23 | - go build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o runc . | ||
| 24 | + $(GO) build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o runc . | ||
| 25 | |||
| 26 | all: runc recvtty | ||
| 27 | |||
| 28 | recvtty: contrib/cmd/recvtty/recvtty | ||
| 29 | |||
| 30 | contrib/cmd/recvtty/recvtty: $(SOURCES) | ||
| 31 | - go build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty | ||
| 32 | + $(GO) build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty | ||
| 33 | |||
| 34 | static: $(SOURCES) | ||
| 35 | - CGO_ENABLED=1 go build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o runc . | ||
| 36 | - CGO_ENABLED=1 go build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty | ||
| 37 | + CGO_ENABLED=1 $(GO) build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o runc . | ||
| 38 | + CGO_ENABLED=1 $(GO) build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty | ||
| 39 | |||
| 40 | release: | ||
| 41 | @flag_list=(seccomp selinux apparmor static); \ | ||
| 42 | @@ -62,15 +62,15 @@ release: | ||
| 43 | CGO_ENABLED=1; \ | ||
| 44 | }; \ | ||
| 45 | echo "Building target: $$output"; \ | ||
| 46 | - go build -i $(EXTRA_FLAGS) -ldflags "$$ldflags $(EXTRA_LDFLAGS)" -tags "$$tags" -o "$$output" .; \ | ||
| 47 | + $(GO) build -i $(EXTRA_FLAGS) -ldflags "$$ldflags $(EXTRA_LDFLAGS)" -tags "$$tags" -o "$$output" .; \ | ||
| 48 | done | ||
| 49 | |||
| 50 | dbuild: runcimage | ||
| 51 | docker run --rm -v $(CURDIR):/go/src/$(PROJECT) --privileged $(RUNC_IMAGE) make clean all | ||
| 52 | |||
| 53 | lint: | ||
| 54 | - go vet $(allpackages) | ||
| 55 | - go fmt $(allpackages) | ||
| 56 | + $(GO) vet $(allpackages) | ||
| 57 | + $(GO) fmt $(allpackages) | ||
| 58 | |||
| 59 | man: | ||
| 60 | man/md2man-all.sh | ||
| 61 | @@ -88,7 +88,7 @@ unittest: runcimage | ||
| 62 | docker run -e TESTFLAGS -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localunittest | ||
| 63 | |||
| 64 | localunittest: all | ||
| 65 | - go test -timeout 3m -tags "$(BUILDTAGS)" ${TESTFLAGS} -v $(allpackages) | ||
| 66 | + $(GO) test -timeout 3m -tags "$(BUILDTAGS)" ${TESTFLAGS} -v $(allpackages) | ||
| 67 | |||
| 68 | integration: runcimage | ||
| 69 | docker run -e TESTFLAGS -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localintegration | ||
| 70 | @@ -133,10 +133,10 @@ clean: | ||
| 71 | |||
| 72 | validate: | ||
| 73 | script/validate-gofmt | ||
| 74 | - go vet $(allpackages) | ||
| 75 | + $(GO) vet $(allpackages) | ||
| 76 | |||
| 77 | ci: validate localtest | ||
| 78 | |||
| 79 | # memoize allpackages, so that it's executed only once and only if used | ||
| 80 | -_allpackages = $(shell go list ./... | grep -v vendor) | ||
| 81 | +_allpackages = $(shell $(GO) list ./... | grep -v vendor) | ||
| 82 | allpackages = $(if $(__allpackages),,$(eval __allpackages := $$(_allpackages)))$(__allpackages) | ||
| 83 | -- | ||
| 84 | 2.7.4 | ||
| 85 | |||
diff --git a/recipes-containers/runc/runc-opencontainers_git.bb b/recipes-containers/runc/runc-opencontainers_git.bb index 902a93da..2cfceea8 100644 --- a/recipes-containers/runc/runc-opencontainers_git.bb +++ b/recipes-containers/runc/runc-opencontainers_git.bb | |||
| @@ -1,7 +1,10 @@ | |||
| 1 | include runc.inc | 1 | include runc.inc |
| 2 | 2 | ||
| 3 | SRCREV = "2e7cfe036e2c6dc51ccca6eb7fa3ee6b63976dcd" | 3 | SRCREV = "2e7cfe036e2c6dc51ccca6eb7fa3ee6b63976dcd" |
| 4 | SRC_URI = "git://github.com/opencontainers/runc;branch=master" | 4 | SRC_URI = " \ |
| 5 | git://github.com/opencontainers/runc;branch=master \ | ||
| 6 | file://0001-Use-correct-go-cross-compiler.patch \ | ||
| 7 | " | ||
| 5 | RUNC_VERSION = "1.0.0-rc4" | 8 | RUNC_VERSION = "1.0.0-rc4" |
| 6 | PROVIDES += "virtual/runc" | 9 | PROVIDES += "virtual/runc" |
| 7 | RPROVIDES_${PN} = "virtual/runc" | 10 | RPROVIDES_${PN} = "virtual/runc" |
