From 2e387ef5855d533f685478cc15e3d9bea799bf30 Mon Sep 17 00:00:00 2001 From: Peter Scheibel Date: Thu, 20 Feb 2020 13:45:58 -0800 Subject: Package hashing: fix detection of directives (#14763) The hashing logic looks for function calls that are Spack directives. It expects that when a Spack directive is used that it is referenced directly by name, and that the directive function is not itself retrieved by calling another function. When the hashing logic encountered a function call where the function was determined dynamically, it would fail (attempting to access a name attribute that does not happen to exist in this case). This updates the hashing logic to filter out function calls where the function is determined dynamically when looking for uses of Spack directives. --- .../builtin.mock/packages/hash-test4/package.py | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 var/spack/repos/builtin.mock/packages/hash-test4/package.py (limited to 'var') diff --git a/var/spack/repos/builtin.mock/packages/hash-test4/package.py b/var/spack/repos/builtin.mock/packages/hash-test4/package.py new file mode 100644 index 0000000000..4b7f4d40c0 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/hash-test4/package.py @@ -0,0 +1,27 @@ +# Copyright 2013-2020 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 * + + +class HashTest4(Package): + """This package isn't compared with others, but it contains constructs + that package hashing logic has tripped over in the past. + """ + + homepage = "http://www.hashtest4.org" + url = "http://www.hashtest1.org/downloads/hashtest4-1.1.tar.bz2" + + version('1.1', 'a' * 32) + + def install(self, spec, prefix): + pass + + @staticmethod + def examine_prefix(pkg): + pass + + run_after('install')( + examine_prefix) -- cgit v1.2.3-70-g09d2