From 9e18e63053d37f8833fafd6b6d6e6ce7da9737b2 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 3 Sep 2024 12:35:54 +0200 Subject: solver: minor cleanup and optimization (#46176) Signed-off-by: Massimiliano Culpo --- lib/spack/spack/solver/asp.py | 8 ++++---- lib/spack/spack/solver/concretize.lp | 11 ----------- 2 files changed, 4 insertions(+), 15 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index 9a36b0975b..b8d9eea037 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -1678,6 +1678,10 @@ class SpackSolverSetup: if pkg_name not in spack.repo.PATH: continue + # This package is not among possible dependencies + if pkg_name not in self.pkgs: + continue + # Check if the external package is buildable. If it is # not then "external()" is a fact, unless we can # reuse an already installed spec. @@ -3344,7 +3348,6 @@ class SpecBuilder: self._result = None self._command_line_specs = specs self._flag_sources = collections.defaultdict(lambda: set()) - self._flag_compiler_defaults = set() # Pass in as arguments reusable specs and plug them in # from this dictionary during reconstruction @@ -3402,9 +3405,6 @@ class SpecBuilder: self._specs[node].compiler = spack.spec.CompilerSpec(compiler) self._specs[node].compiler.versions = vn.VersionList([vn.Version(version)]) - def node_flag_compiler_default(self, node): - self._flag_compiler_defaults.add(node) - def node_flag(self, node, flag_type, flag): self._specs[node].compiler_flags.add_flag(flag_type, flag, False) diff --git a/lib/spack/spack/solver/concretize.lp b/lib/spack/spack/solver/concretize.lp index 18c82474c9..342620238f 100644 --- a/lib/spack/spack/solver/concretize.lp +++ b/lib/spack/spack/solver/concretize.lp @@ -43,8 +43,6 @@ internal_error("Only nodes can have node_compiler_version"). :- attr("variant_value", PackageNode, _, _), not attr("node", PackageNode), internal_error("variant_value true for a non-node"). -:- attr("node_flag_compiler_default", PackageNode), not attr("node", PackageNode), - internal_error("node_flag_compiler_default true for non-node"). :- attr("node_flag", PackageNode, _, _), not attr("node", PackageNode), internal_error("node_flag assigned for non-node"). :- attr("external_spec_selected", PackageNode, _), not attr("node", PackageNode), @@ -1366,15 +1364,6 @@ attr("node_flag", PackageNode, FlagType, Flag) compiler_name(CompilerID, CompilerName), compiler_version(CompilerID, Version). -attr("node_flag_compiler_default", PackageNode) - :- not attr("node_flag_set", PackageNode, FlagType, _), - compiler_flag(CompilerID, FlagType, Flag), - node_compiler(PackageNode, CompilerID), - flag_type(FlagType), - compiler_id(CompilerID), - compiler_name(CompilerID, CompilerName), - compiler_version(CompilerID, Version). - % Flag set to something attr("node_flag", PackageNode, FlagType, Flag) :- attr("node_flag_set", PackageNode, FlagType, Flag). -- cgit v1.2.3-70-g09d2