Change temporary directory used by go build

4,686 views
Skip to first unread message

Ignacio Grande

unread,
Jun 22, 2014, 6:10:34 AM6/22/14
to golan...@googlegroups.com
Hi everyone.

It is possible to change the base temporary directory used by go build command?

Right now, it uses /tmp and I like to use /run/shm (in RAM) because in the Raspberry Pi writing to the SD card is slow. Maybe I won't have any speedup, but I'd like to try.

Thank you.

T.J. Yang

unread,
Jun 22, 2014, 6:57:58 AM6/22/14
to golan...@googlegroups.com


On Sunday, June 22, 2014 5:10:34 AM UTC-5, Ignacio Grande wrote:
Hi everyone.

It is possible to change the base temporary directory used by go build command?

Tamás Gulácsi

unread,
Jun 22, 2014, 7:06:53 AM6/22/14
to golan...@googlegroups.com
export TMPDIR=/run/shm

Nacho

unread,
Jun 22, 2014, 7:26:56 AM6/22/14
to Tamás Gulácsi, golang-nuts
Thank you for the tips!

Usin TMPDIR=/run/shm now I can build on /run/shm, but I cannot run tests (or any program) there because it is mounted with noexec attribute. I know this is offtopic, but could you tell me how to mount /run/shm with exec permissions?

Thanks!




On Sun, Jun 22, 2014 at 1:06 PM, Tamás Gulácsi <tgula...@gmail.com> wrote:
export TMPDIR=/run/shm

--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/Kwuto2AzsKo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gulácsi Tamás

unread,
Jun 22, 2014, 8:00:10 AM6/22/14
to Nacho, golang-nuts
I think mounting /run/shm with exec permissions is a security hole;
why not mount a tmpfs?
mkdir /tmp/tmp; mount -o 4777,size=512M -t tmpfs tmpfs /tmp/tmp
Reply all
Reply to author
Forward
0 new messages