Refactor a few classes related to package repositories (#32273)

Caches used by repositories don't reference the global spack.repo.path instance
anymore, but get the repository they refer to during initialization.
 
Spec.virtual now use the index, and computation done to compute the index 
use Repository.is_virtual_safe. 

Code to construct mock packages and mock repository has been factored into 
a unique MockRepositoryBuilder that is used throughout the codebase.

Add debug print for pushing and popping config scopes.

Changed spack.repo.use_repositories so that it can override or not previous repos

spack.repo.use_repositories updates spack.config.config according to the modifications done

Removed a peculiar behavior from spack.config.Configuration where push would always 
bubble-up a scope named command_line if it existed
This commit is contained in:
Massimiliano Culpo
2022-10-11 19:28:27 +02:00
committed by GitHub
parent b594c0aee0
commit de8c827983
29 changed files with 476 additions and 675 deletions

View File

@@ -1,15 +0,0 @@
# Copyright 2013-2022 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 Concretizationroot(Package):
url = 'fake_url'
version('1.0')
{% for dep in specs %}
depends_on('{{ dep }}')
{% endfor %}

View File

@@ -0,0 +1,19 @@
class {{ cls_name }}(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/root-1.0.tar.gz"
version("3.0", sha256='abcde')
version("2.0", sha256='abcde')
version("1.0", sha256='abcde')
{% for dep_spec, dep_type, condition in dependencies %}
{% if dep_type and condition %}
depends_on("{{ dep_spec }}", type="{{ dep_type }}", when="{{ condition }}")
{% elif dep_type %}
depends_on("{{ dep_spec }}", type="{{ dep_type }}")
{% elif condition %}
depends_on("{{ dep_spec }}", when="{{ condition }}")
{% else %}
depends_on("{{ dep_spec }}")
{% endif %}
{% endfor %}