diff options
author | Toyohisa Kameyama <kameyama@riken.jp> | 2020-12-02 23:45:30 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-02 08:45:30 -0600 |
commit | e575a38d967cd20c44fa4eb515d543f0a21127ec (patch) | |
tree | 854550a04aa8fcce4abe79aceb38df40764cab56 /var | |
parent | 954a3aab620ae9c07427dd6ba64e620e74fa9beb (diff) | |
download | spack-e575a38d967cd20c44fa4eb515d543f0a21127ec.tar.gz spack-e575a38d967cd20c44fa4eb515d543f0a21127ec.tar.bz2 spack-e575a38d967cd20c44fa4eb515d543f0a21127ec.tar.xz spack-e575a38d967cd20c44fa4eb515d543f0a21127ec.zip |
py-tensorlow: use mkdtemp for temporary directory. (#20212)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/py-tensorflow/package.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/py-tensorflow/package.py b/var/spack/repos/builtin/packages/py-tensorflow/package.py index a5c285fa01..d0b21d38e5 100644 --- a/var/spack/repos/builtin/packages/py-tensorflow/package.py +++ b/var/spack/repos/builtin/packages/py-tensorflow/package.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import sys +import tempfile class PyTensorflow(Package, CudaPackage): @@ -523,8 +524,7 @@ class PyTensorflow(Package, CudaPackage): # ]) # to not be nfs. This is only valid for Linux and we'd like to # stay at least also OSX compatible - tmp_path = '/tmp/spack/tf' - mkdirp(tmp_path) + tmp_path = tempfile.mkdtemp(dir='/tmp', prefix='spack') env.set('TEST_TMPDIR', tmp_path) env.set('TF_SYSTEM_LIBS', 'com_google_protobuf') @@ -743,11 +743,13 @@ class PyTensorflow(Package, CudaPackage): build_pip_package('--src', buildpath) def install(self, spec, prefix): + tmp_path = env['TEST_TMPDIR'] buildpath = join_path(self.stage.source_path, 'spack-build') with working_dir(buildpath): setup_py('install', '--prefix={0}'.format(prefix), '--single-version-externally-managed', '--root=/') + remove_linked_tree(tmp_path) @run_after('install') @on_package_attributes(run_tests=True) |