From cf37e9276d826a4607afcc307f765c0708e83311 Mon Sep 17 00:00:00 2001 From: Ben Cowan Date: Fri, 11 Dec 2020 16:54:11 -0700 Subject: 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. --- lib/spack/spack/subprocess_context.py | 2 ++ 1 file changed, 2 insertions(+) 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: -- cgit v1.2.3-70-g09d2