#37834: Set TMPDIR --------------------------+-------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: 2.1.2 Keywords: | Port: --------------------------+-------------------------------- Clang has a bug (<rdar://problem/12479432>) in which the temporary file names it creates while compiling are predictable (i.e. based on the name of the file being compiled). Normally on OS X TMPDIR is set to a "random" value, so at least the temp files are unique for each user, so one user cannot DOS another user by creating temp files. But MacPorts clears the environment when it runs, so TMPDIR is empty, and thus defaults to /tmp. So while compiling, predictable file names are being created in /tmp. This could lead to collisions if multiple compiles are happening simultaneously (user runs two MacPorts processes in two terminals for example). I don't know if that has happened to me, but what does happen constantly is that a compile will fail because a ''directory'' already exists in /tmp with the name clang wanted to use for a temporary file. For example ccache failed to build right now with: {{{ ccache /usr/bin/clang -pipe -O2 -arch x86_64 -arch i386 -Wall -W -DHAVE_CONFIG_H -I/opt/local/include -I. -I. -c -o manifest.o manifest.c clang: error: unable to make temporary file: /tmp/manifest: can't make unique filename: Permission denied }}} (The directory /tmp/manifest existed because some 3rd-party installer package put it there during installation.) To avoid these issues, I would like to see MacPorts create a temporary directory inside workpath and set TMPDIR to its location. -- Ticket URL: <https://trac.macports.org/ticket/37834> MacPorts <http://www.macports.org/> Ports system for Mac OS