Remove "dir=/tmp" when using tempfile.mkdtemp in packages (#29866)
From the tempfile module docs: The default directory is chosen from a platform-dependent list, but the user of the application can control the directory location by setting the TMPDIR, TEMP or TMP environment variables
This commit is contained in:
parent
a3de8eb8bb
commit
fbf50fbfa8
@ -87,9 +87,9 @@ def patch(self):
|
||||
|
||||
def installcheck(self):
|
||||
# We have to clean this tmpdir ourself later as it contains readonly directories
|
||||
self.test_path = tempfile.mkdtemp(dir='/tmp',
|
||||
prefix='tmp-spack-check-nix-{0}-'.
|
||||
format(self.spec.version))
|
||||
self.test_path = tempfile.mkdtemp(
|
||||
prefix='tmp-spack-check-nix-{0}-'.format(self.spec.version)
|
||||
)
|
||||
mkdir(self.test_path + '/nix-test')
|
||||
mkdir(self.test_path + '/tests')
|
||||
os.environ['TMPDIR'] = self.test_path
|
||||
|
@ -28,7 +28,7 @@ def clean(self):
|
||||
remove_linked_tree(self.tmp_path)
|
||||
|
||||
def patch(self):
|
||||
self.tmp_path = tempfile.mkdtemp(dir='/tmp', prefix='spack')
|
||||
self.tmp_path = tempfile.mkdtemp(prefix='spack')
|
||||
env['TEST_TMPDIR'] = self.tmp_path
|
||||
env['HOME'] = self.tmp_path
|
||||
args = [
|
||||
|
@ -84,7 +84,7 @@ def patch(self):
|
||||
|
||||
@when('@2.5.0:')
|
||||
def install(self, spec, prefix):
|
||||
self.tmp_path = tempfile.mkdtemp(dir='/tmp', prefix='spack')
|
||||
self.tmp_path = tempfile.mkdtemp(prefix='spack')
|
||||
env['HOME'] = self.tmp_path
|
||||
|
||||
args = [
|
||||
|
@ -71,7 +71,7 @@ def patch(self):
|
||||
'.bazelrc')
|
||||
|
||||
def setup_build_environment(self, env):
|
||||
self.tmp_path = tempfile.mkdtemp(dir='/tmp', prefix='spack')
|
||||
self.tmp_path = tempfile.mkdtemp(prefix='spack')
|
||||
env.set('TEST_TMPDIR', self.tmp_path)
|
||||
|
||||
def configure(self, spec, prefix):
|
||||
|
@ -47,7 +47,7 @@ class PyTensorflowEstimator(Package):
|
||||
depends_on('py-funcsigs@1.0.2:', type=('build', 'run'), when='^python@:3.2')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
self.tmp_path = tempfile.mkdtemp(dir='/tmp', prefix='spack')
|
||||
self.tmp_path = tempfile.mkdtemp(prefix='spack')
|
||||
env['TEST_TMPDIR'] = self.tmp_path
|
||||
env['HOME'] = self.tmp_path
|
||||
|
||||
|
@ -44,7 +44,7 @@ class PyTensorflowProbability(Package):
|
||||
depends_on('bazel@3.2.0:', type='build')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
self.tmp_path = tempfile.mkdtemp(dir='/tmp', prefix='spack')
|
||||
self.tmp_path = tempfile.mkdtemp(prefix='spack')
|
||||
env['TEST_TMPDIR'] = self.tmp_path
|
||||
env['HOME'] = self.tmp_path
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user