From 23faffa2d0f18d95c6938c9da75ce6ae4818194a Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Mon, 9 Dec 2019 11:22:57 -0600 Subject: [PATCH] TensorFlow: don't override HOME env var (#14054) --- var/spack/repos/builtin/packages/py-tensorflow/package.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/py-tensorflow/package.py b/var/spack/repos/builtin/packages/py-tensorflow/package.py index fa76b31388..f139cf6cb3 100644 --- a/var/spack/repos/builtin/packages/py-tensorflow/package.py +++ b/var/spack/repos/builtin/packages/py-tensorflow/package.py @@ -487,9 +487,6 @@ def setup_build_environment(self, env): tmp_path = '/tmp/spack/tf' mkdirp(tmp_path) env.set('TEST_TMPDIR', tmp_path) - # TODO: Is setting this necessary? It breaks `spack build-env` - # because Bash can't find my .bashrc - env.set('HOME', tmp_path) def configure(self, spec, prefix): # NOTE: configure script is interactive. If you set the appropriate @@ -592,11 +589,15 @@ def post_configure_fixes(self): '.tf_configure.bazelrc') def build(self, spec, prefix): + tmp_path = env['TEST_TMPDIR'] + # https://docs.bazel.build/versions/master/command-line-reference.html args = [ # Don't allow user or system .bazelrc to override build settings '--nohome_rc', '--nosystem_rc', + # Bazel does not work properly on NFS, switch to /tmp + '--output_user_root=' + tmp_path, 'build', # Spack logs don't handle colored output well '--color=no', @@ -665,7 +666,6 @@ def build(self, spec, prefix): build_pip_package = Executable( 'bazel-bin/tensorflow/tools/pip_package/build_pip_package') - tmp_path = env['TEST_TMPDIR'] build_pip_package(tmp_path) def install(self, spec, prefix):