summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Cowan <benc@txcorp.com>2020-12-11 16:54:11 -0700
committerGitHub <noreply@github.com>2020-12-11 15:54:11 -0800
commitcf37e9276d826a4607afcc307f765c0708e83311 (patch)
tree466c3adf897eda06a04487d0a690e6272b842545
parent0924b209847e2d7284ff0ff2b234f8afd47e0921 (diff)
downloadspack-cf37e9276d826a4607afcc307f765c0708e83311.tar.gz
spack-cf37e9276d826a4607afcc307f765c0708e83311.tar.bz2
spack-cf37e9276d826a4607afcc307f765c0708e83311.tar.xz
spack-cf37e9276d826a4607afcc307f765c0708e83311.zip
Debugging support: fix compiler wrapper log on Mac OS (#20333)
This fixes a logging error observed on macOS 11.0.1 (Big Sur). When performing a Spack install in debugging mode (e.g. `spack -d install py-scipy`) Spack is supposed to write a log of compiler wrapper command line invocations to the current working directory. Due to a regression error introduced by #18205, these files were no-longer generated, and Spack was printing errors such as "No such file or directory: None/." This is because the log file directory gets set from `spack.main.spack_working_dir`, but that variable is not set in the spawned process. This PR ensures that the working directory (at the time of the "spack install" invocation) is persisted to the subprocess.
-rw-r--r--lib/spack/spack/subprocess_context.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/spack/spack/subprocess_context.py b/lib/spack/spack/subprocess_context.py
index b8e157740f..d9b23531ef 100644
--- a/lib/spack/spack/subprocess_context.py
+++ b/lib/spack/spack/subprocess_context.py
@@ -69,10 +69,12 @@ class PackageInstallContext(object):
self.serialized_pkg = serialize(pkg)
else:
self.pkg = pkg
+ self.spack_working_dir = spack.main.spack_working_dir
self.test_state = TestState()
def restore(self):
self.test_state.restore()
+ spack.main.spack_working_dir = self.spack_working_dir
if _serialize:
return pickle.load(self.serialized_pkg)
else: