Skip to contentSkip to conversation

go-native: don't use host /var/tmp for temp build artifacts

PATCH In review Mark Asselstine 2 participants 2 messages May 20, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 go-native: don't use host /var/tmp for temp build artifacts

Similar to a recent change for go-cross we can potentially run in to a build failure:

go tool dist: mkdtemp(/var/tmp/go-cbuild-A0rrP5): No such file or directory

when the host doesn't have a /var/tmp or when the permissions don't allow for the creation of the temporary directory. Instead of relying on /var/tmp we create and use a temporary directory in the $WORKDIR to work around this issue. This is passed to the build via the TMPDIR environment variable.

---
 recipes-devtools/go-cross/go-native.inc | 4 ++++
 1 file changed, 4 insertions(+)
recipes-devtools/go-cross/go-native.inc +4 -0
index ae3dc83..e431b48 100644
@@ -11,6 +11,10 @@ do_compile() {
     export GOBIN="${B}/bin"
     rm -rf ${GOBIN}
     mkdir ${GOBIN}
+
+    export TMPDIR=${WORKDIR}/build-tmp
+    mkdir ${WORKDIR}/build-tmp
+
     cd src
     ./make.bash --host-only
 }
Signature · 1 line
2.1.4
#1 lore raw

merged.

Bruce

Quoted 42 lines · Mark Asselstine

Similar to a recent change for go-cross we can potentially run in to a build failure:

go tool dist: mkdtemp(/var/tmp/go-cbuild-A0rrP5): No such file or
directory

when the host doesn't have a /var/tmp or when the permissions don't allow for the creation of the temporary directory. Instead of relying on /var/tmp we create and use a temporary directory in the $WORKDIR to work around this issue. This is passed to the build via the TMPDIR environment variable.

---
 recipes-devtools/go-cross/go-native.inc | 4 ++++
 1 file changed, 4 insertions(+)
recipes-devtools/go-cross/go-native.inc +4 -1
index ae3dc83..e431b48 100644
@@ -11,6 +11,10 @@ do_compile() {
     export GOBIN="${B}/bin"
     rm -rf ${GOBIN}
     mkdir ${GOBIN}
+
+    export TMPDIR=${WORKDIR}/build-tmp
+    mkdir ${WORKDIR}/build-tmp
+
     cd src
     ./make.bash --host-only
 }
--

2.1.4

--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"