From ed7b8333e1f09d59dbe96ec1258971ffb4e5af41 Mon Sep 17 00:00:00 2001 From: Yunguo Wei Date: Tue, 30 Jan 2018 16:02:20 -0200 Subject: docker: override GOROOT at build time Usually $GOROOT is set by go tool, but if sstate is specified, $GOROOT is set to the path in the first project. If docker is built in the another project(with same SSTATE_DIR) later, and the first project is removed, the following error will be seen: | go: cannot find GOROOT directory: /path/to/previous/project/bitbake_build/tmp/sysroots/x86_64-linux/usr/lib/x86_64-wrs-linux/go This commit is overriding $GOROOT stored in the go tool in sstate cache, making sure it is set to the correct path in current project. See more information here: https://golang.org/doc/install#install Signed-off-by: Yunguo Wei Signed-off-by: Bruce Ashfield (cherry picked from commit 01aa8f18196d76d4554649c47348fb68277574c5) --- recipes-containers/docker/docker_git.bb | 1 + 1 file changed, 1 insertion(+) (limited to 'recipes-containers/docker') diff --git a/recipes-containers/docker/docker_git.bb b/recipes-containers/docker/docker_git.bb index 42a336e5..898957be 100644 --- a/recipes-containers/docker/docker_git.bb +++ b/recipes-containers/docker/docker_git.bb @@ -80,6 +80,7 @@ do_compile() { mkdir -p .gopath/src/"$(dirname "${DOCKER_PKG}")" ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}" export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" + export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" cd - # Pass the needed cflags/ldflags so that cgo -- cgit v1.2.3-54-g00ecf