summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorPeter Scheibel <scheibel1@llnl.gov>2019-12-14 14:31:39 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2019-12-14 14:31:39 -0800
commit60580f587179f57e182f9ff957dc96c3ac079c0a (patch)
tree054269feecab4700aaecda4de10866ebc4b1cfdd /var
parent410bce91d4f21c7870a13d223ba9fbc584cab478 (diff)
downloadspack-60580f587179f57e182f9ff957dc96c3ac079c0a.tar.gz
spack-60580f587179f57e182f9ff957dc96c3ac079c0a.tar.bz2
spack-60580f587179f57e182f9ff957dc96c3ac079c0a.tar.xz
spack-60580f587179f57e182f9ff957dc96c3ac079c0a.zip
package hash: gracefully handle @when with non-string args (#14153)
* when constructing package hash, default to including a method in the content hash if we can't determine whether it would be included by examining the AST * add a test for updated content-hash calculations * refactor content hash tests to eliminate repeated lines
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/hash-test1/package.py9
-rw-r--r--var/spack/repos/builtin.mock/packages/hash-test3/package.py42
2 files changed, 50 insertions, 1 deletions
diff --git a/var/spack/repos/builtin.mock/packages/hash-test1/package.py b/var/spack/repos/builtin.mock/packages/hash-test1/package.py
index 879e08147e..ffcaa89eb9 100644
--- a/var/spack/repos/builtin.mock/packages/hash-test1/package.py
+++ b/var/spack/repos/builtin.mock/packages/hash-test1/package.py
@@ -19,6 +19,9 @@ class HashTest1(Package):
version('1.2', 'b' * 32)
version('1.3', 'c' * 32)
version('1.4', 'd' * 32)
+ version('1.5', 'd' * 32)
+ version('1.6', 'e' * 32)
+ version('1.7', 'f' * 32)
patch('patch1.patch', when="@1.1")
patch('patch2.patch', when="@1.4")
@@ -34,6 +37,10 @@ class HashTest1(Package):
print("install 1")
os.listdir(os.getcwd())
- @when('@1.5')
+ @when('@1.5:')
def install(self, spec, prefix):
os.listdir(os.getcwd())
+
+ @when('@1.5,1.6')
+ def extra_phase(self, spec, prefix):
+ pass
diff --git a/var/spack/repos/builtin.mock/packages/hash-test3/package.py b/var/spack/repos/builtin.mock/packages/hash-test3/package.py
new file mode 100644
index 0000000000..345309a5eb
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/hash-test3/package.py
@@ -0,0 +1,42 @@
+# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+
+import os
+
+
+class HashTest3(Package):
+ """Used to test package hashing
+ """
+
+ homepage = "http://www.hashtest3.org"
+ url = "http://www.hashtest1.org/downloads/hashtest3-1.1.tar.bz2"
+
+ version('1.2', 'b' * 32)
+ version('1.3', 'c' * 32)
+ version('1.5', 'd' * 32)
+ version('1.6', 'e' * 32)
+ version('1.7', 'f' * 32)
+
+ variant('variantx', default=False, description='Test variant X')
+ variant('varianty', default=False, description='Test variant Y')
+
+ def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
+ pass
+
+ @when('@:1.4')
+ def install(self, spec, prefix):
+ print("install 1")
+ os.listdir(os.getcwd())
+
+ @when('@1.5:')
+ def install(self, spec, prefix):
+ os.listdir(os.getcwd())
+
+ for _version_constraint in ['@1.5', '@1.6']:
+ @when(_version_constraint)
+ def extra_phase(self, spec, prefix):
+ pass