mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 18:49:32 +02:00
go.bbclass: set TMPDIR during compilation
The go build tool creates working directories under
$TMPDIR for all of its processing. Create a directory
under ${WORKDIR} for this and point TMPDIR at it during
compilation, so that systems that have a relatively
small /tmp filesystems can still compile larger Go
packages.
(From OE-Core rev: 5de3de12c70f01753491c46b5622b0d273c3257b)
Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
6590c03808
commit
e1fd36cd6d
@@ -61,6 +61,8 @@ GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/"
|
|||||||
|
|
||||||
B = "${WORKDIR}/build"
|
B = "${WORKDIR}/build"
|
||||||
export GOPATH = "${B}"
|
export GOPATH = "${B}"
|
||||||
|
GO_TMPDIR ?= "${WORKDIR}/go-tmp"
|
||||||
|
GO_TMPDIR[vardepvalue] = ""
|
||||||
|
|
||||||
python go_do_unpack() {
|
python go_do_unpack() {
|
||||||
src_uri = (d.getVar('SRC_URI') or "").split()
|
src_uri = (d.getVar('SRC_URI') or "").split()
|
||||||
@@ -97,14 +99,17 @@ go_do_configure() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
go_do_compile() {
|
go_do_compile() {
|
||||||
|
export TMPDIR="${GO_TMPDIR}"
|
||||||
${GO} env
|
${GO} env
|
||||||
if [ -n "${GO_INSTALL}" ]; then
|
if [ -n "${GO_INSTALL}" ]; then
|
||||||
${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} `go_list_packages`
|
${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} `go_list_packages`
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
do_compile[dirs] =+ "${GO_TMPDIR}"
|
||||||
do_compile[cleandirs] = "${B}/bin ${B}/pkg"
|
do_compile[cleandirs] = "${B}/bin ${B}/pkg"
|
||||||
|
|
||||||
do_compile_ptest() {
|
do_compile_ptest() {
|
||||||
|
export TMPDIR="${GO_TMPDIR}"
|
||||||
rm -f ${B}/.go_compiled_tests.list
|
rm -f ${B}/.go_compiled_tests.list
|
||||||
go_list_package_tests | while read pkg; do
|
go_list_package_tests | while read pkg; do
|
||||||
cd ${B}/src/$pkg
|
cd ${B}/src/$pkg
|
||||||
@@ -113,6 +118,7 @@ do_compile_ptest() {
|
|||||||
sed -e's,/\./,/,'>> ${B}/.go_compiled_tests.list
|
sed -e's,/\./,/,'>> ${B}/.go_compiled_tests.list
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
do_compile_ptest_base[dirs] =+ "${GO_TMPDIR}"
|
||||||
|
|
||||||
go_do_install() {
|
go_do_install() {
|
||||||
install -d ${D}${libdir}/go/src/${GO_IMPORT}
|
install -d ${D}${libdir}/go/src/${GO_IMPORT}
|
||||||
|
|||||||
Reference in New Issue
Block a user