cri-o: fixup build

After oe-core commits

5f48939e2640 [goarch.bbclass: use MACHINEOVERRIDES and simplify go_map_arm()]
6300c4a83f7c [go.bbclass:Export more GO* environment variables]

we see a build failure with cri-o:
  | go build runtime/cgo: attempting to install package runtime/cgo into read-only GOROOT
  | Makefile:112: recipe for target 'conmon/config.h' failed
  | make: *** [conmon/config.h] Error 1

to avoid this we should not overwrite the GO* environment being setup
by the go.bbclass, so we drop most of our GO* exports here.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Mark Asselstine 2019-04-11 22:20:04 -04:00 committed by Bruce Ashfield
parent 69288b17c0
commit dfceafea9f

View File

@ -53,18 +53,8 @@ inherit pkgconfig
EXTRA_OEMAKE="BUILDTAGS=''" EXTRA_OEMAKE="BUILDTAGS=''"
do_compile() { do_compile() {
export GOARCH="${TARGET_GOARCH}"
export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
export GOPATH="${S}/src/import:${S}/src/import/vendor" export GOPATH="${S}/src/import:${S}/src/import/vendor"
# Pass the needed cflags/ldflags so that cgo
# can find the needed headers files and libraries
export CGO_ENABLED="1"
export CFLAGS=""
export LDFLAGS=""
export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
# link fixups for compilation # link fixups for compilation
rm -f ${S}/src/import/vendor/src rm -f ${S}/src/import/vendor/src
ln -sf ./ ${S}/src/import/vendor/src ln -sf ./ ${S}/src/import/vendor/src
@ -82,15 +72,6 @@ do_compile() {
ln -sf ../../../../version ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o/version ln -sf ../../../../version ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o/version
ln -sf ../../../../lib ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o/lib ln -sf ../../../../lib ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o/lib
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"
# Pass the needed cflags/ldflags so that cgo
# can find the needed headers files and libraries
export CGO_ENABLED="1"
export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
cd ${S}/src/import cd ${S}/src/import
oe_runmake binaries oe_runmake binaries