mirror of
git://git.yoctoproject.org/meta-virtualization.git
synced 2025-07-19 20:59:41 +02:00
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 <yunguo.wei@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
(cherry picked from commit 01aa8f1819
)
This commit is contained in:
parent
b38ebbee98
commit
ed7b8333e1
|
@ -80,6 +80,7 @@ do_compile() {
|
||||||
mkdir -p .gopath/src/"$(dirname "${DOCKER_PKG}")"
|
mkdir -p .gopath/src/"$(dirname "${DOCKER_PKG}")"
|
||||||
ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}"
|
ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}"
|
||||||
export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
|
export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
|
||||||
|
export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
# Pass the needed cflags/ldflags so that cgo
|
# Pass the needed cflags/ldflags so that cgo
|
||||||
|
|
Loading…
Reference in New Issue
Block a user