From 284ae9d1ccac953600981b41b13effbf2385806b Mon Sep 17 00:00:00 2001 From: Peter Scheibel Date: Thu, 20 Jun 2019 11:09:31 -0700 Subject: Resources: use expanded archive name by default (#11688) For resources, it is desirable to use the expanded archive name of the resource as the name of the directory when adding it to the root staging area. #11528 established 'spack-src' as the universal directory where source files are placed, which also affected the behavior of resources managed with Stages. This adds a new property ('srcdir') to Stage to remember the name of the expanded source directory, and uses this as the default name when placing a resource directory in the root staging area. This also: * Ensures that downloaded sources are archived using the expanded archive name (otherwise Spack will not be able to determine the original directory name when using a cached archive). * Updates working_dir context manager to guarantee restoration of original working directory when an exception occurs * Adds a "temp_cwd" context manager which creates a temporary directory and sets it as the working directory --- var/spack/repos/builtin/packages/intel-xed/package.py | 2 +- var/spack/repos/builtin/packages/warpx/package.py | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/intel-xed/package.py b/var/spack/repos/builtin/packages/intel-xed/package.py index 586ea9d7ab..61030326da 100644 --- a/var/spack/repos/builtin/packages/intel-xed/package.py +++ b/var/spack/repos/builtin/packages/intel-xed/package.py @@ -41,7 +41,7 @@ class IntelXed(Package): version(vers, commit=xed_hash) resource(name='mbuild', git='https://github.com/intelxed/mbuild.git', - commit=mbuild_hash, placement='mbuild', + commit=mbuild_hash, when='@{0}'.format(vers)) variant('debug', default=False, description='Enable debug symbols') diff --git a/var/spack/repos/builtin/packages/warpx/package.py b/var/spack/repos/builtin/packages/warpx/package.py index 8d3d07d8b9..015c38406b 100644 --- a/var/spack/repos/builtin/packages/warpx/package.py +++ b/var/spack/repos/builtin/packages/warpx/package.py @@ -40,19 +40,16 @@ class Warpx(MakefilePackage): resource(name='amrex', git='https://github.com/AMReX-Codes/amrex.git', when='@master', - tag='master', - placement='amrex') + tag='master') resource(name='amrex', git='https://github.com/AMReX-Codes/amrex.git', when='@dev', - tag='development', - placement='amrex') + tag='development') resource(name='picsar', git='https://bitbucket.org/berkeleylab/picsar.git', - tag='master', - placement='picsar') + tag='master') @property def build_targets(self): -- cgit v1.2.3-60-g2f50