summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2017-10-15 23:57:01 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2017-10-17 01:26:31 -0700
commit44bebd7a8f0ed398abb12e20231e2acd2226c691 (patch)
tree2fac280ef5e18510ba03dbdc5098e02eaba093cb /lib
parent894a1a73a4871dc1b85e6763b870ef91a9e1bf46 (diff)
downloadspack-44bebd7a8f0ed398abb12e20231e2acd2226c691.tar.gz
spack-44bebd7a8f0ed398abb12e20231e2acd2226c691.tar.bz2
spack-44bebd7a8f0ed398abb12e20231e2acd2226c691.tar.xz
spack-44bebd7a8f0ed398abb12e20231e2acd2226c691.zip
``Package.stage`` no longer implicitly makes stage directory
- Be explicit about stage creation during the install process. - This avoids accidental creation of stages - e.g., during `spack install --fake`, stages were erroneously recreated after being destroyed
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/package.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index f895b4b6fb..e941aff499 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -771,16 +771,16 @@ class PackageBase(with_metaclass(PackageMeta, object)):
@property
def stage(self):
+ """Get the build staging area for this package.
+
+ This automatically instantiates a ``Stage`` object if the package
+ doesn't have one yet, but it does not create the Stage directory
+ on the filesystem.
+ """
if not self.spec.concrete:
raise ValueError("Can only get a stage for a concrete package.")
if self._stage is None:
self._stage = self._make_stage()
-
- # Create stage on first access. Needed because fetch, stage,
- # patch, and install can be called independently of each
- # other, so `with self.stage:` in do_install isn't sufficient.
- self._stage.create()
-
return self._stage
@stage.setter
@@ -974,8 +974,8 @@ class PackageBase(with_metaclass(PackageMeta, object)):
raise FetchError("Will not fetch %s" %
self.spec.format('$_$@'), ck_msg)
+ self.stage.create()
self.stage.fetch(mirror_only)
-
self._fetch_time = time.time() - start_time
if spack.do_checksum and self.version in self.versions:
@@ -988,7 +988,7 @@ class PackageBase(with_metaclass(PackageMeta, object)):
if not self.spec.concrete:
raise ValueError("Can only stage concrete packages.")
- self.do_fetch(mirror_only)
+ self.do_fetch(mirror_only) # this will create the stage
self.stage.expand_archive()
if not os.listdir(self.stage.path):
@@ -1033,7 +1033,7 @@ class PackageBase(with_metaclass(PackageMeta, object)):
if not self.spec.concrete:
raise ValueError("Can only patch concrete packages.")
- # Kick off the stage first.
+ # Kick off the stage first. This creates the stage.
self.do_stage()
# Package can add its own patch function.