| Index: client/run_isolated.py
|
| diff --git a/client/run_isolated.py b/client/run_isolated.py
|
| index dce643f110afd779391d9143572248a4dad9d60d..f964384181be76754d458645badd1640112d3292 100755
|
| --- a/client/run_isolated.py
|
| +++ b/client/run_isolated.py
|
| @@ -88,11 +88,20 @@ def make_temp_dir(prefix, root_dir=None):
|
|
|
| If root_dir is given and /tmp is on same file system as root_dir, uses /tmp.
|
| Otherwise makes a new temp directory under root_dir.
|
| +
|
| + Except on OSX, because it's dangerous to create hardlinks in $TMPDIR on OSX!
|
| + /System/Library/LaunchDaemons/com.apple.bsd.dirhelper.plist runs every day at
|
| + 3:35am and deletes all files older than 3 days in $TMPDIR, but hardlinks do
|
| + not have the inode modification time updated, so they tend to be old, thus
|
| + they get deleted.
|
| """
|
| base_temp_dir = None
|
| - if (root_dir and
|
| - not file_path.is_same_filesystem(
|
| - root_dir, unicode(tempfile.gettempdir()))):
|
| + real_temp_dir = unicode(tempfile.gettempdir())
|
| + if sys.platform == 'darwin':
|
| + # Nope! Nope! Nope!
|
| + assert root_dir, 'It is unsafe to create hardlinks in $TMPDIR'
|
| + base_temp_dir = root_dir
|
| + elif root_dir and not file_path.is_same_filesystem(root_dir, real_temp_dir):
|
| base_temp_dir = root_dir
|
| return unicode(tempfile.mkdtemp(prefix=prefix, dir=base_temp_dir))
|
|
|
|
|