diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2024-09-03 12:35:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-03 10:35:54 +0000 |
commit | 9e18e63053d37f8833fafd6b6d6e6ce7da9737b2 (patch) | |
tree | b67aac1bf55158901ed3ccfa2d554d10224712b1 /lib | |
parent | 069286bda74557f1e7dd823d7369106cc98c202a (diff) | |
download | spack-9e18e63053d37f8833fafd6b6d6e6ce7da9737b2.tar.gz spack-9e18e63053d37f8833fafd6b6d6e6ce7da9737b2.tar.bz2 spack-9e18e63053d37f8833fafd6b6d6e6ce7da9737b2.tar.xz spack-9e18e63053d37f8833fafd6b6d6e6ce7da9737b2.zip |
solver: minor cleanup and optimization (#46176)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/solver/asp.py | 8 | ||||
-rw-r--r-- | lib/spack/spack/solver/concretize.lp | 11 |
2 files changed, 4 insertions, 15 deletions
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(<pkg>)" 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). |