All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] docker: override GOROOT at build time
@ 2016-05-30  7:34 Yunguo Wei
  2016-05-30 18:19 ` Bruce Ashfield
  0 siblings, 1 reply; 2+ messages in thread
From: Yunguo Wei @ 2016-05-30  7:34 UTC (permalink / raw)
  To: bruce.ashfield; +Cc: meta-virtualization

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>
---
 recipes-containers/docker/docker_git.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/recipes-containers/docker/docker_git.bb b/recipes-containers/docker/docker_git.bb
index 597ff4f..4eea3f4 100644
--- a/recipes-containers/docker/docker_git.bb
+++ b/recipes-containers/docker/docker_git.bb
@@ -82,6 +82,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
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] docker: override GOROOT at build time
  2016-05-30  7:34 [PATCH] docker: override GOROOT at build time Yunguo Wei
@ 2016-05-30 18:19 ` Bruce Ashfield
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2016-05-30 18:19 UTC (permalink / raw)
  To: Yunguo Wei; +Cc: meta-virtualization

[-- Attachment #1: Type: text/plain, Size: 1641 bytes --]

merged.

Bruce

On Mon, May 30, 2016 at 3:34 AM, Yunguo Wei <yunguo.wei@windriver.com>
wrote:

> 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>
> ---
>  recipes-containers/docker/docker_git.bb | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/recipes-containers/docker/docker_git.bb
> b/recipes-containers/docker/docker_git.bb
> index 597ff4f..4eea3f4 100644
> --- a/recipes-containers/docker/docker_git.bb
> +++ b/recipes-containers/docker/docker_git.bb
> @@ -82,6 +82,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
> --
> 1.9.1
>
>


-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"

[-- Attachment #2: Type: text/html, Size: 2715 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-30 18:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-30  7:34 [PATCH] docker: override GOROOT at build time Yunguo Wei
2016-05-30 18:19 ` Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.