diff options
author | Greg Becker <becker33@llnl.gov> | 2024-04-23 08:42:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-23 17:42:14 +0200 |
commit | 978c20f35ad7f1c071ee88dddd00f7a46ba13d61 (patch) | |
tree | 5f13dfa793742ac1f0ecca2446c7ef2474a3cf8b /lib | |
parent | d535124500fcaedd0f347aebe7fb00283c652ec9 (diff) | |
download | spack-978c20f35ad7f1c071ee88dddd00f7a46ba13d61.tar.gz spack-978c20f35ad7f1c071ee88dddd00f7a46ba13d61.tar.bz2 spack-978c20f35ad7f1c071ee88dddd00f7a46ba13d61.tar.xz spack-978c20f35ad7f1c071ee88dddd00f7a46ba13d61.zip |
concretizer: update `reuse:` default to True (#41302)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/solver/asp.py | 2 | ||||
-rw-r--r-- | lib/spack/spack/test/cmd/common/arguments.py | 9 | ||||
-rw-r--r-- | lib/spack/spack/test/concretize.py | 9 | ||||
-rw-r--r-- | lib/spack/spack/test/data/config/concretizer.yaml | 2 |
4 files changed, 15 insertions, 7 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index 631dd835fc..dc79a7eead 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -3566,7 +3566,7 @@ class Solver: # These properties are settable via spack configuration, and overridable # by setting them directly as properties. - self.reuse = spack.config.get("concretizer:reuse", False) + self.reuse = spack.config.get("concretizer:reuse", True) @staticmethod def _check_input_and_extract_concrete_specs(specs): diff --git a/lib/spack/spack/test/cmd/common/arguments.py b/lib/spack/spack/test/cmd/common/arguments.py index c1f75e99f3..3d2deac479 100644 --- a/lib/spack/spack/test/cmd/common/arguments.py +++ b/lib/spack/spack/test/cmd/common/arguments.py @@ -123,17 +123,18 @@ def test_root_and_dep_match_returns_root(mock_packages, mutable_mock_env_path): @pytest.mark.parametrize( - "arg,config", [("--reuse", True), ("--fresh", False), ("--reuse-deps", "dependencies")] + "arg,conf", [("--reuse", True), ("--fresh", False), ("--reuse-deps", "dependencies")] ) -def test_concretizer_arguments(mutable_config, mock_packages, arg, config): +def test_concretizer_arguments(mutable_config, mock_packages, arg, conf): """Ensure that ConfigSetAction is doing the right thing.""" spec = spack.main.SpackCommand("spec") - assert spack.config.get("concretizer:reuse", None) is None + assert spack.config.get("concretizer:reuse", None, scope="command_line") is None spec(arg, "zlib") - assert spack.config.get("concretizer:reuse", None) == config + assert spack.config.get("concretizer:reuse", None) == conf + assert spack.config.get("concretizer:reuse", None, scope="command_line") == conf def test_use_buildcache_type(): diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py index 070e79da0f..9faaa08f06 100644 --- a/lib/spack/spack/test/concretize.py +++ b/lib/spack/spack/test/concretize.py @@ -1346,6 +1346,9 @@ class TestConcretize: def test_reuse_installed_packages_when_package_def_changes( self, context, mutable_database, repo_with_changing_recipe ): + # test applies only with reuse turned off in concretizer + spack.config.set("concretizer:reuse", False) + # Install a spec root = Spec("root").concretized() dependency = root["changing"].copy() @@ -2120,7 +2123,11 @@ class TestConcretize: # install python external python = Spec("python").concretized() - monkeypatch.setattr(spack.store.STORE.db, "query", lambda x: [python]) + + def query(*args, **kwargs): + return [python] + + monkeypatch.setattr(spack.store.STORE.db, "query", query) # ensure that we can't be faking this by getting it from config external_conf.pop("python") diff --git a/lib/spack/spack/test/data/config/concretizer.yaml b/lib/spack/spack/test/data/config/concretizer.yaml index 0dd810163d..538182c957 100644 --- a/lib/spack/spack/test/data/config/concretizer.yaml +++ b/lib/spack/spack/test/data/config/concretizer.yaml @@ -1,5 +1,5 @@ concretizer: - # reuse is missing on purpose, see "test_concretizer_arguments" + reuse: True targets: granularity: microarchitectures host_compatible: false |