From 7226bd64dc3b46a1ed361f1e9d7fb4a2a5b65200 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 23 Feb 2021 04:09:43 +0100 Subject: Improve error message for inconsistencies in package.py (#21811) * Improve error message for inconsistencies in package.py Sometimes directives refer to variants that do not exist. Make it such that: 1. The name of the variant 2. The name of the package which is supposed to have such variant 3. The name of the package making this assumption are all printed in the error message for easier debugging. * Add unit tests --- .../packages/wrong-variant-in-depends-on/package.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 var/spack/repos/builtin.mock/packages/wrong-variant-in-depends-on/package.py (limited to 'var/spack/repos/builtin.mock/packages/wrong-variant-in-depends-on/package.py') diff --git a/var/spack/repos/builtin.mock/packages/wrong-variant-in-depends-on/package.py b/var/spack/repos/builtin.mock/packages/wrong-variant-in-depends-on/package.py new file mode 100644 index 0000000000..628a761c7c --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/wrong-variant-in-depends-on/package.py @@ -0,0 +1,13 @@ +# Copyright 2013-2021 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) +class WrongVariantInDependsOn(Package): + """This package has a wrong variant spelled in a depends_on.""" + + homepage = "http://www.example.com" + url = "http://www.example.com/b-1.0.tar.gz" + + version('1.0', '0123456789abcdef0123456789abcdef') + + depends_on('b+doesnotexist') -- cgit v1.2.3-60-g2f50