summaryrefslogtreecommitdiffstats
path: root/meta/classes/go.bbclass
diff options
context:
space:
mode:
authorMatt Madison <matt@madison.systems>2018-03-04 13:09:27 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-06 06:43:10 -0800
commit29af62dfa0b77125d95adc1f2468eb9bc6a5ca7c (patch)
tree0bfbc0d7d7d7b8bfe089ea9aa0f4e3e573d3dd69 /meta/classes/go.bbclass
parentdc2e108efe79e24acd47724af1ef9e672f8b4400 (diff)
downloadpoky-29af62dfa0b77125d95adc1f2468eb9bc6a5ca7c.tar.gz
go.bbclass: rename GO_TMPDIR -> GOTMPDIR
and export it. Go 1.10 now supports using this separate variable locating its temporary files. TMPDIR is still set, for compatibility with go1.9; that can be dropped once 1.9 is retired. (From OE-Core rev: ce9d70ae2f9981bf5b42641922c34c1ed54eeca3) 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.bbclass13
1 files changed, 7 insertions, 6 deletions
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index a01b28bccd..96302a187c 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -49,8 +49,8 @@ GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/"
49B = "${WORKDIR}/build" 49B = "${WORKDIR}/build"
50export GOPATH = "${B}" 50export GOPATH = "${B}"
51export GOCACHE = "off" 51export GOCACHE = "off"
52GO_TMPDIR ?= "${WORKDIR}/go-tmp" 52export GOTMPDIR ?= "${WORKDIR}/go-tmp"
53GO_TMPDIR[vardepvalue] = "" 53GOTMPDIR[vardepvalue] = ""
54 54
55python go_do_unpack() { 55python go_do_unpack() {
56 src_uri = (d.getVar('SRC_URI') or "").split() 56 src_uri = (d.getVar('SRC_URI') or "").split()
@@ -85,9 +85,10 @@ go_list_package_tests() {
85go_do_configure() { 85go_do_configure() {
86 ln -snf ${S}/src ${B}/ 86 ln -snf ${S}/src ${B}/
87} 87}
88do_configure[dirs] =+ "${GOTMPDIR}"
88 89
89go_do_compile() { 90go_do_compile() {
90 export TMPDIR="${GO_TMPDIR}" 91 export TMPDIR="${GOTMPDIR}"
91 ${GO} env 92 ${GO} env
92 if [ -n "${GO_INSTALL}" ]; then 93 if [ -n "${GO_INSTALL}" ]; then
93 if [ -n "${GO_LINKSHARED}" ]; then 94 if [ -n "${GO_LINKSHARED}" ]; then
@@ -97,11 +98,11 @@ go_do_compile() {
97 ${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} `go_list_packages` 98 ${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} `go_list_packages`
98 fi 99 fi
99} 100}
100do_compile[dirs] =+ "${GO_TMPDIR}" 101do_compile[dirs] =+ "${GOTMPDIR}"
101do_compile[cleandirs] = "${B}/bin ${B}/pkg" 102do_compile[cleandirs] = "${B}/bin ${B}/pkg"
102 103
103do_compile_ptest() { 104do_compile_ptest() {
104 export TMPDIR="${GO_TMPDIR}" 105 export TMPDIR="${GOTMPDIR}"
105 rm -f ${B}/.go_compiled_tests.list 106 rm -f ${B}/.go_compiled_tests.list
106 go_list_package_tests | while read pkg; do 107 go_list_package_tests | while read pkg; do
107 cd ${B}/src/$pkg 108 cd ${B}/src/$pkg
@@ -110,7 +111,7 @@ do_compile_ptest() {
110 sed -e's,/\./,/,'>> ${B}/.go_compiled_tests.list 111 sed -e's,/\./,/,'>> ${B}/.go_compiled_tests.list
111 done 112 done
112} 113}
113do_compile_ptest_base[dirs] =+ "${GO_TMPDIR}" 114do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
114 115
115go_do_install() { 116go_do_install() {
116 install -d ${D}${libdir}/go/src/${GO_IMPORT} 117 install -d ${D}${libdir}/go/src/${GO_IMPORT}