'Checks that names and values in this spec are real. If they\'re not,
it will raise an appropriate exception.'

def validate_or_raise(self):

    for spec in self.traverse():
        if ((not spec.virtual) and spec.name):
            spack.repo.get(spec.fullname)
        if spec.compiler:
            if (not compilers.supported(spec.compiler)):
                raise UnsupportedCompilerError(spec.compiler.name)
        if (not spec.virtual):
            pkg_cls = spec.package_class
            pkg_variants = pkg_cls.variants
            not_existing = (set(spec.variants) - set(pkg_variants))
            if not_existing:
                raise UnknownVariantError(spec.name, not_existing)
            substitute_abstract_variants(spec)
