diff options
4 files changed, 58 insertions, 39 deletions
diff --git a/recipes-containers/containerd/containerd-opencontainers/0001-Add-build-option-GODEBUG-1.patch b/recipes-containers/containerd/containerd-opencontainers/0001-Add-build-option-GODEBUG-1.patch index 05c4f153..8b43c8a0 100644 --- a/recipes-containers/containerd/containerd-opencontainers/0001-Add-build-option-GODEBUG-1.patch +++ b/recipes-containers/containerd/containerd-opencontainers/0001-Add-build-option-GODEBUG-1.patch | |||
| @@ -15,28 +15,18 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | |||
| 15 | src/import/Makefile | 8 ++++++-- | 15 | src/import/Makefile | 8 ++++++-- |
| 16 | 1 file changed, 6 insertions(+), 2 deletions(-) | 16 | 1 file changed, 6 insertions(+), 2 deletions(-) |
| 17 | 17 | ||
| 18 | diff --git a/src/import/Makefile b/src/import/Makefile | 18 | Index: git/src/import/Makefile |
| 19 | index 4355395..4fb5d3b 100644 | 19 | =================================================================== |
| 20 | --- a/src/import/Makefile | 20 | --- git.orig/src/import/Makefile 2020-10-12 08:09:41.638977052 -0700 |
| 21 | +++ b/src/import/Makefile | 21 | +++ git/src/import/Makefile 2020-10-12 08:10:49.783074373 -0700 |
| 22 | @@ -75,11 +75,15 @@ TEST_REQUIRES_ROOT_PACKAGES=$(filter \ | 22 | @@ -72,6 +72,10 @@ |
| 23 | COMMANDS=ctr containerd containerd-stress | 23 | COMMANDS=ctr containerd containerd-stress |
| 24 | MANPAGES=ctr.1 containerd.1 containerd-config.1 containerd-config.toml.5 | 24 | MANPAGES=ctr.8 containerd.8 containerd-config.8 containerd-config.toml.5 |
| 25 | 25 | ||
| 26 | +ifndef GODEBUG | 26 | +ifndef GODEBUG |
| 27 | + EXTRA_LDFLAGS += -s -w | 27 | + EXTRA_LDFLAGS += -s -w |
| 28 | +endif | 28 | +endif |
| 29 | + | 29 | + |
| 30 | # Build tags seccomp and apparmor are needed by CRI plugin. | 30 | ifdef BUILDTAGS |
| 31 | BUILDTAGS ?= seccomp apparmor | 31 | GO_BUILDTAGS = ${BUILDTAGS} |
| 32 | GO_TAGS=$(if $(BUILDTAGS),-tags "$(BUILDTAGS)",) | 32 | endif |
| 33 | -GO_LDFLAGS=-ldflags '-s -w -X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) $(EXTRA_LDFLAGS)' | ||
| 34 | -SHIM_GO_LDFLAGS=-ldflags '-s -w -X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) -extldflags "-static"' | ||
| 35 | +GO_LDFLAGS=-ldflags '-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) $(EXTRA_LDFLAGS)' | ||
| 36 | +SHIM_GO_LDFLAGS=-ldflags '-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) -extldflags "-static" $(EXTRA_LDFLAGS)' | ||
| 37 | |||
| 38 | #Replaces ":" (*nix), ";" (windows) with newline for easy parsing | ||
| 39 | GOPATHS=$(shell echo ${GOPATH} | tr ":" "\n" | tr ";" "\n") | ||
| 40 | -- | ||
| 41 | 2.7.4 | ||
| 42 | |||
diff --git a/recipes-containers/containerd/containerd-opencontainers_git.bb b/recipes-containers/containerd/containerd-opencontainers_git.bb index 347eae5d..d0ea7153 100644 --- a/recipes-containers/containerd/containerd-opencontainers_git.bb +++ b/recipes-containers/containerd/containerd-opencontainers_git.bb | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | SRCREV = "fd103cb716352c7e19768e4fed057f71d68902a0" | 1 | SRCREV = "e44e8ebeaaa2d605f539dffa3788a53c92458c4d" |
| 2 | SRC_URI = "git://github.com/containerd/containerd;branch=release/1.2 \ | 2 | SRC_URI = "git://github.com/containerd/containerd;branch=release/1.4 \ |
| 3 | file://0001-build-use-oe-provided-GO-and-flags.patch \ | 3 | file://0001-build-use-oe-provided-GO-and-flags.patch \ |
| 4 | file://0001-Add-build-option-GODEBUG-1.patch \ | 4 | file://0001-Add-build-option-GODEBUG-1.patch \ |
| 5 | " | 5 | " |
| @@ -8,7 +8,7 @@ include containerd.inc | |||
| 8 | 8 | ||
| 9 | LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=1269f40c0d099c21a871163984590d89" | 9 | LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=1269f40c0d099c21a871163984590d89" |
| 10 | 10 | ||
| 11 | CONTAINERD_VERSION = "v1.2.7" | 11 | CONTAINERD_VERSION = "v1.4.1" |
| 12 | 12 | ||
| 13 | EXTRA_OEMAKE += "GODEBUG=1" | 13 | EXTRA_OEMAKE += "GODEBUG=1" |
| 14 | 14 | ||
diff --git a/recipes-containers/containerd/containerd.inc b/recipes-containers/containerd/containerd.inc index e226edf1..f825e550 100644 --- a/recipes-containers/containerd/containerd.inc +++ b/recipes-containers/containerd/containerd.inc | |||
| @@ -6,7 +6,7 @@ DESCRIPTION = "containerd is a daemon to control runC, built for performance and | |||
| 6 | 6 | ||
| 7 | # Apache-2.0 for containerd | 7 | # Apache-2.0 for containerd |
| 8 | LICENSE = "Apache-2.0" | 8 | LICENSE = "Apache-2.0" |
| 9 | LIC_FILES_CHKSUM = "file://src/import/LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7" | 9 | LIC_FILES_CHKSUM ?= "file://src/import/LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7" |
| 10 | 10 | ||
| 11 | SRC_URI += "file://containerd.service" | 11 | SRC_URI += "file://containerd.service" |
| 12 | 12 | ||
| @@ -38,7 +38,7 @@ do_compile() { | |||
| 38 | # without this, the stress test parts of the build fail | 38 | # without this, the stress test parts of the build fail |
| 39 | cp ${S}/src/import/*.go ${S}/src/import/vendor/src/github.com/containerd/containerd | 39 | cp ${S}/src/import/*.go ${S}/src/import/vendor/src/github.com/containerd/containerd |
| 40 | 40 | ||
| 41 | for c in content errdefs fs images mount snapshots linux api runtimes defaults progress \ | 41 | for c in content timeout ttrpcutil oom stdio process errdefs fs images mount snapshots linux api runtimes defaults progress \ |
| 42 | protobuf reference diff platforms runtime remotes version archive dialer gc metadata \ | 42 | protobuf reference diff platforms runtime remotes version archive dialer gc metadata \ |
| 43 | metrics filters identifiers labels leases plugin server services \ | 43 | metrics filters identifiers labels leases plugin server services \ |
| 44 | cmd cio containers namespaces oci events log reaper sys rootfs nvidia seed apparmor seccomp; do | 44 | cmd cio containers namespaces oci events log reaper sys rootfs nvidia seed apparmor seccomp; do |
| @@ -64,6 +64,7 @@ do_compile() { | |||
| 64 | export BUILDTAGS="no_btrfs static_build netgo" | 64 | export BUILDTAGS="no_btrfs static_build netgo" |
| 65 | export CFLAGS="${CFLAGS}" | 65 | export CFLAGS="${CFLAGS}" |
| 66 | export LDFLAGS="${LDFLAGS}" | 66 | export LDFLAGS="${LDFLAGS}" |
| 67 | export SHIM_CGO_ENABLED=${CGO_ENABLED} | ||
| 67 | 68 | ||
| 68 | cd ${S}/src/import | 69 | cd ${S}/src/import |
| 69 | oe_runmake binaries | 70 | oe_runmake binaries |
diff --git a/recipes-containers/containerd/files/0001-build-use-oe-provided-GO-and-flags.patch b/recipes-containers/containerd/files/0001-build-use-oe-provided-GO-and-flags.patch index d4d5973e..a709d125 100644 --- a/recipes-containers/containerd/files/0001-build-use-oe-provided-GO-and-flags.patch +++ b/recipes-containers/containerd/files/0001-build-use-oe-provided-GO-and-flags.patch | |||
| @@ -14,29 +14,57 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | |||
| 14 | 14 | ||
| 15 | Index: git/src/import/Makefile | 15 | Index: git/src/import/Makefile |
| 16 | =================================================================== | 16 | =================================================================== |
| 17 | --- git.orig/src/import/Makefile | 17 | --- git.orig/src/import/Makefile 2020-10-12 07:36:18.775820388 -0700 |
| 18 | +++ git/src/import/Makefile | 18 | +++ git/src/import/Makefile 2020-10-12 08:00:05.134151221 -0700 |
| 19 | @@ -166,19 +166,19 @@ | 19 | @@ -163,19 +163,19 @@ |
| 20 | |||
| 21 | build: ## build the go packages | ||
| 22 | @echo "$(WHALE) $@" | ||
| 23 | - @go build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} ${EXTRA_FLAGS} ${GO_LDFLAGS} ${PACKAGES} | ||
| 24 | + @$(GO) build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} ${EXTRA_FLAGS} ${GO_LDFLAGS} ${PACKAGES} | ||
| 25 | |||
| 26 | test: ## run tests, except integration tests and tests that require root | ||
| 27 | @echo "$(WHALE) $@" | ||
| 28 | - @go test ${TESTFLAGS} $(filter-out ${INTEGRATION_PACKAGE},${PACKAGES}) | ||
| 29 | + @$(GO) test ${TESTFLAGS} $(filter-out ${INTEGRATION_PACKAGE},${PACKAGES}) | ||
| 30 | |||
| 31 | root-test: ## run tests, except integration tests | ||
| 32 | @echo "$(WHALE) $@" | ||
| 33 | - @go test ${TESTFLAGS} $(filter-out ${INTEGRATION_PACKAGE},${TEST_REQUIRES_ROOT_PACKAGES}) -test.root | ||
| 34 | + @$(GO) test ${TESTFLAGS} $(filter-out ${INTEGRATION_PACKAGE},${TEST_REQUIRES_ROOT_PACKAGES}) -test.root | ||
| 35 | |||
| 36 | integration: ## run integration tests | ||
| 37 | @echo "$(WHALE) $@" | ||
| 38 | - @go test ${TESTFLAGS} -test.root -parallel ${TESTFLAGS_PARALLEL} | ||
| 39 | + @$(GO) test ${TESTFLAGS} -test.root -parallel ${TESTFLAGS_PARALLEL} | ||
| 40 | |||
| 41 | benchmark: ## run benchmarks tests | ||
| 42 | @echo "$(WHALE) $@" | ||
| 43 | @@ -185,7 +185,7 @@ | ||
| 44 | |||
| 45 | define BUILD_BINARY = | ||
| 46 | @echo "$(WHALE) $@" | ||
| 47 | -@go build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@ ${GO_LDFLAGS} ${GO_TAGS} ./$< | ||
| 48 | +@$(GO) build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@ ${GO_LDFLAGS} ${GO_TAGS} ./$< | ||
| 49 | endef | ||
| 50 | |||
| 20 | # Build a binary from a cmd. | 51 | # Build a binary from a cmd. |
| 21 | bin/%: cmd/% FORCE | 52 | @@ -194,15 +194,15 @@ |
| 22 | @echo "$(WHALE) $@${BINARY_SUFFIX}" | ||
| 23 | - @go build ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@${BINARY_SUFFIX} ${GO_LDFLAGS} ${GO_TAGS} ./$< | ||
| 24 | + @$(GO) build ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@${BINARY_SUFFIX} ${GO_LDFLAGS} ${GO_TAGS} ./$< | ||
| 25 | 53 | ||
| 26 | bin/containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220 | 54 | bin/containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220 |
| 27 | @echo "$(WHALE) bin/containerd-shim" | 55 | @echo "$(WHALE) bin/containerd-shim" |
| 28 | - @CGO_ENABLED=0 go build ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim | 56 | - @CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim |
| 29 | + @$(GO) build ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim | 57 | + @CGO_ENABLED=${SHIM_CGO_ENABLED} $(GO) build ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim |
| 30 | 58 | ||
| 31 | bin/containerd-shim-runc-v1: cmd/containerd-shim-runc-v1 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220 | 59 | bin/containerd-shim-runc-v1: cmd/containerd-shim-runc-v1 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220 |
| 32 | @echo "$(WHALE) bin/containerd-shim-runc-v1" | 60 | @echo "$(WHALE) bin/containerd-shim-runc-v1" |
| 33 | - @CGO_ENABLED=0 go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1 | 61 | - @CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1 |
| 34 | + @$(GO) build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1 | 62 | + @CGO_ENABLED=${SHIM_CGO_ENABLED} $(GO) build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1 |
| 35 | 63 | ||
| 36 | bin/containerd-shim-runhcs-v1: cmd/containerd-shim-runhcs-v1 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220 | 64 | bin/containerd-shim-runc-v2: cmd/containerd-shim-runc-v2 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220 |
| 37 | @echo "$(WHALE) bin/containerd-shim-runhcs-v1${BINARY_SUFFIX}" | 65 | @echo "$(WHALE) bin/containerd-shim-runc-v2" |
| 38 | - @CGO_ENABLED=0 go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runhcs-v1${BINARY_SUFFIX} ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runhcs-v1 | 66 | - @CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2 |
| 39 | + @$(GO) build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runhcs-v1${BINARY_SUFFIX} ${SHIM_GO_LDFLAGS} $(GOBUILDFLAGS) ${GO_TAGS} ./cmd/containerd-shim-runhcs-v1 | 67 | + @CGO_ENABLED=${SHIM_CGO_ENABLED} $(GO) build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2 |
| 40 | 68 | ||
| 41 | binaries: $(BINARIES) ## build binaries | 69 | binaries: $(BINARIES) ## build binaries |
| 42 | @echo "$(WHALE) $@" | 70 | @echo "$(WHALE) $@" |
