summaryrefslogtreecommitdiffstats
path: root/meta/classes/go.bbclass
diff options
context:
space:
mode:
authorMatt Madison <matt@madison.systems>2018-03-04 13:09:25 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-06 06:43:10 -0800
commit7a4ca89b557648d9aae30b405f6be09b4a383abe (patch)
treefb131b91c54b054ad525566d2da014abaa7c8f9f /meta/classes/go.bbclass
parent26227695b350056225e9d309defdcd66573b79bb (diff)
downloadpoky-7a4ca89b557648d9aae30b405f6be09b4a383abe.tar.gz
go: update go 1.9 -> go 1.10
* Patches and recipes reworked for go 1.10's significant changes to its bootstrap and build steps. * Update go1.4 source tarball used for go-native bootstrapping to the version recommended in the current go documentation * Remove test data from installed sources to eliminate some packaging QA warnings * Set GOCACHE to 'off' to disable 1.10's build caching in the go recipes and bbclass * Update go_do_compile to compile both static and dynamic objects dynamic linking is in use, since go1.10's build tool is pickier about this (From OE-Core rev: 4fd749ca6450a4870be1c1e13802f084b6eb0db6) Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/go.bbclass')
-rw-r--r--meta/classes/go.bbclass6
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index 7ecd8c9254..a01b28bccd 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -24,6 +24,7 @@ GO_LINKMODE ?= ""
24GO_LINKMODE_class-nativesdk = "--linkmode=external" 24GO_LINKMODE_class-nativesdk = "--linkmode=external"
25GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} -extldflags '${GO_EXTLDFLAGS}'"' 25GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} -extldflags '${GO_EXTLDFLAGS}'"'
26export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}" 26export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}"
27export GOPATH_OMIT_IN_ACTIONID ?= "1"
27export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c" 28export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c"
28export GOPTESTFLAGS ?= "-test.v" 29export GOPTESTFLAGS ?= "-test.v"
29GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} " 30GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} "
@@ -47,6 +48,7 @@ GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/"
47 48
48B = "${WORKDIR}/build" 49B = "${WORKDIR}/build"
49export GOPATH = "${B}" 50export GOPATH = "${B}"
51export GOCACHE = "off"
50GO_TMPDIR ?= "${WORKDIR}/go-tmp" 52GO_TMPDIR ?= "${WORKDIR}/go-tmp"
51GO_TMPDIR[vardepvalue] = "" 53GO_TMPDIR[vardepvalue] = ""
52 54
@@ -88,6 +90,10 @@ go_do_compile() {
88 export TMPDIR="${GO_TMPDIR}" 90 export TMPDIR="${GO_TMPDIR}"
89 ${GO} env 91 ${GO} env
90 if [ -n "${GO_INSTALL}" ]; then 92 if [ -n "${GO_INSTALL}" ]; then
93 if [ -n "${GO_LINKSHARED}" ]; then
94 ${GO} install ${GOBUILDFLAGS} `go_list_packages`
95 rm -rf ${B}/bin
96 fi
91 ${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} `go_list_packages` 97 ${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} `go_list_packages`
92 fi 98 fi
93} 99}