diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2020-10-21 22:20:29 +0200 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2020-11-17 10:04:13 -0800 |
commit | 58683b9e5625f7f48883ae01263a77ae22f2e124 (patch) | |
tree | 93bba31339abf82914d63bc10f4d5f3e67c6fc32 | |
parent | 3e4fd64169be7bbdc2a78bd5e27441f0200f90e2 (diff) | |
download | spack-58683b9e5625f7f48883ae01263a77ae22f2e124.tar.gz spack-58683b9e5625f7f48883ae01263a77ae22f2e124.tar.bz2 spack-58683b9e5625f7f48883ae01263a77ae22f2e124.tar.xz spack-58683b9e5625f7f48883ae01263a77ae22f2e124.zip |
conftest: hook the new solver in the config fixture
-rw-r--r-- | lib/spack/spack/concretize.py | 6 | ||||
-rw-r--r-- | lib/spack/spack/solver/concretize.lp | 1 | ||||
-rw-r--r-- | lib/spack/spack/spec.py | 6 | ||||
-rw-r--r-- | lib/spack/spack/test/concretize.py | 1 | ||||
-rw-r--r-- | lib/spack/spack/test/conftest.py | 3 | ||||
-rw-r--r-- | lib/spack/spack/test/data/config/config.yaml | 5 |
6 files changed, 12 insertions, 10 deletions
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py index 85c8022760..186cf8244f 100644 --- a/lib/spack/spack/concretize.py +++ b/lib/spack/spack/concretize.py @@ -786,10 +786,10 @@ class InsufficientArchitectureInfoError(spack.error.SpackError): % (spec.name, str(archs))) -class NoBuildError(spack.error.SpackError): +class NoBuildError(spack.error.SpecError): """Raised when a package is configured with the buildable option False, but - no satisfactory external versions can be found""" - + no satisfactory external versions can be found + """ def __init__(self, spec): msg = ("The spec\n '%s'\n is configured as not buildable, " "and no matching external installs were found") diff --git a/lib/spack/spack/solver/concretize.lp b/lib/spack/spack/solver/concretize.lp index 77bc45bcde..1cbccce74d 100644 --- a/lib/spack/spack/solver/concretize.lp +++ b/lib/spack/spack/solver/concretize.lp @@ -208,6 +208,7 @@ variant_default_value(Package, Variant, Value) #defined variant_default_value/3. #defined variant_possible_value/3. #defined variant_default_value_from_packages_yaml/3. +#defined variant_default_value_from_package_py/3. %----------------------------------------------------------------------------- % Platform semantics diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 5a9bb73ee1..e7cc1d7eaf 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -2456,10 +2456,10 @@ class Spec(object): #: choose your concretizer here. def concretize(self, tests=False): - if spack.config.get('config:concretizer') == "original": - self._old_concretize(tests) - else: + if spack.config.get('config:concretizer') == "clingo": self._new_concretize(tests) + else: + self._old_concretize(tests) def _mark_concrete(self, value=True): """Mark this spec and its dependencies as concrete. diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py index d2866697f5..7eed82568f 100644 --- a/lib/spack/spack/test/concretize.py +++ b/lib/spack/spack/test/concretize.py @@ -498,7 +498,6 @@ class TestConcretize(object): s = Spec(conflict_spec) with pytest.raises(spack.error.SpackError): s.concretize() - assert not s.concrete @pytest.mark.parametrize('spec_str', [ 'conflict@10.0%clang+foo' diff --git a/lib/spack/spack/test/conftest.py b/lib/spack/spack/test/conftest.py index 8a94f6e82a..30497fefd7 100644 --- a/lib/spack/spack/test/conftest.py +++ b/lib/spack/spack/test/conftest.py @@ -501,12 +501,13 @@ def configuration_dir(tmpdir_factory, linux_os): tmpdir.ensure('user', dir=True) # Slightly modify config.yaml and compilers.yaml + solver = os.environ.get('SPACK_TEST_SOLVER', 'original') config_yaml = test_config.join('config.yaml') modules_root = tmpdir_factory.mktemp('share') tcl_root = modules_root.ensure('modules', dir=True) lmod_root = modules_root.ensure('lmod', dir=True) content = ''.join(config_yaml.read()).format( - str(tcl_root), str(lmod_root) + solver, str(tcl_root), str(lmod_root) ) t = tmpdir.join('site', 'config.yaml') t.write(content) diff --git a/lib/spack/spack/test/data/config/config.yaml b/lib/spack/spack/test/data/config/config.yaml index 4e036a3d66..09ab7709a3 100644 --- a/lib/spack/spack/test/data/config/config.yaml +++ b/lib/spack/spack/test/data/config/config.yaml @@ -13,6 +13,7 @@ config: verify_ssl: true checksum: true dirty: false + concretizer: {0} module_roots: - tcl: {0} - lmod: {1} + tcl: {1} + lmod: {2} |