From 01a8d4537012ad93dc8510e9b762acdc8c4536c7 Mon Sep 17 00:00:00 2001 From: Jason Wessel Date: Wed, 13 Sep 2017 12:39:46 -0700 Subject: nets, docker, runc, oci-*tools: go.bbclass compile fixes Recently in the oe-core the go.bbclass changed and requires the defition of the GO_IMPORT variable. This was intended to simplify how the compilation works with go packages and it is still a work in progress. This patch set makes the recipes compatible to generate the same end result as before using the new go.bbclass from oe-core. Any patches that were included in the recipes had to have the paths adjusted because the new go.bbclass manipulates the notion of S to be S + "src" + "$GO_IMPORT" internally for the purpose of unpack, patch and compile. Signed-off-by: Jason Wessel Signed-off-by: Bruce Ashfield --- ...date-to-runtime-spec-198f23f827eea397d4331d7eb048d.patch | 8 ++++---- .../runc-docker/0001-runc-Add-console-socket-dev-null.patch | 4 ++-- .../0002-Remove-Platform-as-no-longer-in-OCI-spec.patch | 8 ++++---- .../0003-Update-memory-specs-to-use-int64-not-uint64.patch | 12 ++++++------ recipes-containers/runc/runc-docker_git.bb | 2 ++ recipes-containers/runc/runc.inc | 13 ++++++------- 6 files changed, 24 insertions(+), 23 deletions(-) (limited to 'recipes-containers/runc') diff --git a/recipes-containers/runc/runc-docker/0001-Update-to-runtime-spec-198f23f827eea397d4331d7eb048d.patch b/recipes-containers/runc/runc-docker/0001-Update-to-runtime-spec-198f23f827eea397d4331d7eb048d.patch index bc1e9a23..bcc76fc4 100644 --- a/recipes-containers/runc/runc-docker/0001-Update-to-runtime-spec-198f23f827eea397d4331d7eb048d.patch +++ b/recipes-containers/runc/runc-docker/0001-Update-to-runtime-spec-198f23f827eea397d4331d7eb048d.patch @@ -14,8 +14,8 @@ Signed-off-by: Justin Cormack diff --git a/vendor.conf b/vendor.conf index e23e7ea7..09a8a924 100644 ---- a/vendor.conf -+++ b/vendor.conf +--- a/src/import/vendor.conf ++++ b/src/import/vendor.conf @@ -1,7 +1,7 @@ # OCI runtime-spec. When updating this, make sure you use a version tag rather # than a commit ID so it's much more obvious what version of the spec we are @@ -27,8 +27,8 @@ index e23e7ea7..09a8a924 100644 github.com/opencontainers/selinux v1.0.0-rc1 diff --git a/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go b/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go index 8bf8d924..68ab112e 100644 ---- a/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go -+++ b/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go +--- a/src/import/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go ++++ b/src/import/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go @@ -6,8 +6,6 @@ import "os" type Spec struct { // Version of the Open Container Runtime Specification with which the bundle complies. diff --git a/recipes-containers/runc/runc-docker/0001-runc-Add-console-socket-dev-null.patch b/recipes-containers/runc/runc-docker/0001-runc-Add-console-socket-dev-null.patch index f49adfbf..48c1250d 100644 --- a/recipes-containers/runc/runc-docker/0001-runc-Add-console-socket-dev-null.patch +++ b/recipes-containers/runc/runc-docker/0001-runc-Add-console-socket-dev-null.patch @@ -14,8 +14,8 @@ Signed-off-by: Jason Wessel diff --git a/utils_linux.go b/utils_linux.go index 8085f7fe..e6d31b35 100644 ---- a/utils_linux.go -+++ b/utils_linux.go +--- a/src/import/utils_linux.go ++++ b/src/import/utils_linux.go @@ -227,6 +227,11 @@ type runner struct { } diff --git a/recipes-containers/runc/runc-docker/0002-Remove-Platform-as-no-longer-in-OCI-spec.patch b/recipes-containers/runc/runc-docker/0002-Remove-Platform-as-no-longer-in-OCI-spec.patch index 6ec286a8..7970dec3 100644 --- a/recipes-containers/runc/runc-docker/0002-Remove-Platform-as-no-longer-in-OCI-spec.patch +++ b/recipes-containers/runc/runc-docker/0002-Remove-Platform-as-no-longer-in-OCI-spec.patch @@ -13,8 +13,8 @@ Signed-off-by: Justin Cormack diff --git a/libcontainer/specconv/example.go b/libcontainer/specconv/example.go index 33134116..d6621194 100644 ---- a/libcontainer/specconv/example.go -+++ b/libcontainer/specconv/example.go +--- a/src/import/libcontainer/specconv/example.go ++++ b/src/import/libcontainer/specconv/example.go @@ -2,7 +2,6 @@ package specconv import ( @@ -36,8 +36,8 @@ index 33134116..d6621194 100644 Readonly: true, diff --git a/spec.go b/spec.go index 92d38f57..876937d2 100644 ---- a/spec.go -+++ b/spec.go +--- a/src/import/spec.go ++++ b/src/import/spec.go @@ -7,7 +7,6 @@ import ( "fmt" "io/ioutil" diff --git a/recipes-containers/runc/runc-docker/0003-Update-memory-specs-to-use-int64-not-uint64.patch b/recipes-containers/runc/runc-docker/0003-Update-memory-specs-to-use-int64-not-uint64.patch index 9cb34922..50a9b7fc 100644 --- a/recipes-containers/runc/runc-docker/0003-Update-memory-specs-to-use-int64-not-uint64.patch +++ b/recipes-containers/runc/runc-docker/0003-Update-memory-specs-to-use-int64-not-uint64.patch @@ -20,8 +20,8 @@ Signed-off-by: Justin Cormack diff --git a/libcontainer/cgroups/fs/memory.go b/libcontainer/cgroups/fs/memory.go index da2cc9f8..b739c631 100644 ---- a/libcontainer/cgroups/fs/memory.go -+++ b/libcontainer/cgroups/fs/memory.go +--- a/src/import/libcontainer/cgroups/fs/memory.go ++++ b/src/import/libcontainer/cgroups/fs/memory.go @@ -73,14 +73,14 @@ func EnableKernelMemoryAccounting(path string) error { // until a limit is set on the cgroup and limit cannot be set once the // cgroup has children, or if there are already tasks in the cgroup. @@ -123,8 +123,8 @@ index da2cc9f8..b739c631 100644 } diff --git a/libcontainer/configs/cgroup_linux.go b/libcontainer/configs/cgroup_linux.go index 3e0509de..e15a662f 100644 ---- a/libcontainer/configs/cgroup_linux.go -+++ b/libcontainer/configs/cgroup_linux.go +--- a/src/import/libcontainer/configs/cgroup_linux.go ++++ b/src/import/libcontainer/configs/cgroup_linux.go @@ -43,19 +43,19 @@ type Resources struct { Devices []*Device `json:"devices"` @@ -152,8 +152,8 @@ index 3e0509de..e15a662f 100644 CpuShares uint64 `json:"cpu_shares"` diff --git a/update.go b/update.go index 0ea90d60..133be999 100644 ---- a/update.go -+++ b/update.go +--- a/src/import/update.go ++++ b/src/import/update.go @@ -124,11 +124,11 @@ other options are ignored. r := specs.LinuxResources{ diff --git a/recipes-containers/runc/runc-docker_git.bb b/recipes-containers/runc/runc-docker_git.bb index f412c84b..97353254 100644 --- a/recipes-containers/runc/runc-docker_git.bb +++ b/recipes-containers/runc/runc-docker_git.bb @@ -10,6 +10,8 @@ SRC_URI = "git://github.com/docker/runc.git;nobranch=1;name=runc-docker \ file://0001-runc-Add-console-socket-dev-null.patch \ " +GO_IMPORT = "import" + RUNC_VERSION = "1.0.0-rc3" PROVIDES += "virtual/runc" RPROVIDES_${PN} = "virtual/runc" diff --git a/recipes-containers/runc/runc.inc b/recipes-containers/runc/runc.inc index dbc83c27..83d5f863 100644 --- a/recipes-containers/runc/runc.inc +++ b/recipes-containers/runc/runc.inc @@ -4,7 +4,7 @@ DESCRIPTION = "runc is a CLI tool for spawning and running containers according # Apache-2.0 for containerd LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=435b266b3899aa8a959f17d41c56def8" +LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=435b266b3899aa8a959f17d41c56def8" S = "${WORKDIR}/git" @@ -26,20 +26,19 @@ do_compile() { # Set GOPATH. See 'PACKAGERS.md'. Don't rely on # docker to download its dependencies but rather # use dependencies packaged independently. - cd ${S} + cd ${S}/src/import rm -rf .gopath dname=`dirname "${LIBCONTAINER_PACKAGE}"` bname=`basename "${LIBCONTAINER_PACKAGE}"` mkdir -p .gopath/src/${dname} (cd .gopath/src/${dname}; ln -sf ../../../../../${bname} ${bname}) - export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" + export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" - cd - # Fix up symlink for go-cross compiler - rm -f ${S}/vendor/src - ln -sf ./ ${S}/vendor/src + rm -f ${S}/src/import/vendor/src + ln -sf ./ ${S}/src/import/vendor/src # Pass the needed cflags/ldflags so that cgo # can find the needed headers files and libraries @@ -55,7 +54,7 @@ do_compile() { do_install() { mkdir -p ${D}/${bindir} - cp ${S}/runc ${D}/${bindir}/runc + cp ${S}/src/import/runc ${D}/${bindir}/runc ln -sf runc ${D}/${bindir}/docker-runc } -- cgit v1.2.3-54-g00ecf