diff options
Diffstat (limited to 'lib/spack/spack/package.py')
-rw-r--r-- | lib/spack/spack/package.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 86223688fa..897b5ea9bc 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -785,6 +785,14 @@ class PackageBase(with_metaclass(PackageMeta, object)): """Allow a stage object to be set to override the default.""" self._stage = stage + @property + def env_path(self): + return os.path.join(self.stage.source_path, 'spack-build.env') + + @property + def log_path(self): + return os.path.join(self.stage.source_path, 'spack-build.out') + def _make_fetcher(self): # Construct a composite fetcher that always contains at least # one element (the root package). In case there are resources @@ -1331,20 +1339,11 @@ class PackageBase(with_metaclass(PackageMeta, object)): self.stage.chdir_to_source() # Save the build environment in a file before building. - env_path = join_path(os.getcwd(), 'spack-build.env') - - # Redirect I/O to a build log (and optionally to - # the terminal) - log_path = join_path(os.getcwd(), 'spack-build.out') - - # FIXME : refactor this assignment - self.log_path = log_path - self.env_path = env_path - dump_environment(env_path) + dump_environment(self.env_path) # Spawn a daemon that reads from a pipe and redirects # everything to log_path - with log_output(log_path, echo, True) as logger: + with log_output(self.log_path, echo, True) as logger: for phase_name, phase_attr in zip( self.phases, self._InstallPhase_phases): |