Fix for duplicate glibc in concretization
This commit is contained in:
parent
da06ad3303
commit
96b54ec59c
@ -280,12 +280,11 @@ def _create_counter(specs: List[spack.spec.Spec], tests: bool):
|
|||||||
def all_libcs() -> Set[spack.spec.Spec]:
|
def all_libcs() -> Set[spack.spec.Spec]:
|
||||||
"""Return a set of all libc specs targeted by any configured compiler. If none, fall back to
|
"""Return a set of all libc specs targeted by any configured compiler. If none, fall back to
|
||||||
libc determined from the current Python process if dynamically linked."""
|
libc determined from the current Python process if dynamically linked."""
|
||||||
|
libcs = set()
|
||||||
libcs = {
|
for c in spack.compilers.config.all_compilers_from(spack.config.CONFIG):
|
||||||
CompilerPropertyDetector(c).default_libc()
|
candidate = CompilerPropertyDetector(c).default_libc()
|
||||||
for c in spack.compilers.config.all_compilers_from(spack.config.CONFIG)
|
if candidate is not None:
|
||||||
}
|
libcs.add(candidate)
|
||||||
libcs.discard(None)
|
|
||||||
|
|
||||||
if libcs:
|
if libcs:
|
||||||
return libcs
|
return libcs
|
||||||
@ -598,9 +597,11 @@ def _external_config_with_implicit_externals(configuration):
|
|||||||
if not using_libc_compatibility():
|
if not using_libc_compatibility():
|
||||||
return packages_yaml
|
return packages_yaml
|
||||||
|
|
||||||
|
seen = set()
|
||||||
for compiler in spack.compilers.config.all_compilers_from(configuration):
|
for compiler in spack.compilers.config.all_compilers_from(configuration):
|
||||||
libc = CompilerPropertyDetector(compiler).default_libc()
|
libc = CompilerPropertyDetector(compiler).default_libc()
|
||||||
if libc:
|
if libc and libc not in seen:
|
||||||
|
seen.add(libc)
|
||||||
entry = {"spec": f"{libc}", "prefix": libc.external_path}
|
entry = {"spec": f"{libc}", "prefix": libc.external_path}
|
||||||
packages_yaml.setdefault(libc.name, {}).setdefault("externals", []).append(entry)
|
packages_yaml.setdefault(libc.name, {}).setdefault("externals", []).append(entry)
|
||||||
return packages_yaml
|
return packages_yaml
|
||||||
@ -1804,8 +1805,6 @@ def emit_facts_from_requirement_rules(self, rules: List[RequirementRule]):
|
|||||||
|
|
||||||
def external_packages(self):
|
def external_packages(self):
|
||||||
"""Facts on external packages, from packages.yaml and implicit externals."""
|
"""Facts on external packages, from packages.yaml and implicit externals."""
|
||||||
packages_yaml = _external_config_with_implicit_externals(spack.config.CONFIG)
|
|
||||||
|
|
||||||
self.gen.h1("External packages")
|
self.gen.h1("External packages")
|
||||||
spec_filters = []
|
spec_filters = []
|
||||||
concretizer_yaml = spack.config.get("concretizer")
|
concretizer_yaml = spack.config.get("concretizer")
|
||||||
@ -1813,7 +1812,6 @@ def external_packages(self):
|
|||||||
if isinstance(reuse_yaml, typing.Mapping):
|
if isinstance(reuse_yaml, typing.Mapping):
|
||||||
default_include = reuse_yaml.get("include", [])
|
default_include = reuse_yaml.get("include", [])
|
||||||
default_exclude = reuse_yaml.get("exclude", [])
|
default_exclude = reuse_yaml.get("exclude", [])
|
||||||
libc_externals = list(all_libcs())
|
|
||||||
for source in reuse_yaml.get("from", []):
|
for source in reuse_yaml.get("from", []):
|
||||||
if source["type"] != "external":
|
if source["type"] != "external":
|
||||||
continue
|
continue
|
||||||
@ -1821,7 +1819,7 @@ def external_packages(self):
|
|||||||
include = source.get("include", default_include)
|
include = source.get("include", default_include)
|
||||||
if include:
|
if include:
|
||||||
# Since libcs are implicit externals, we need to implicitly include them
|
# Since libcs are implicit externals, we need to implicitly include them
|
||||||
include = include + libc_externals
|
include = include + self.libcs
|
||||||
exclude = source.get("exclude", default_exclude)
|
exclude = source.get("exclude", default_exclude)
|
||||||
spec_filters.append(
|
spec_filters.append(
|
||||||
SpecFilter(
|
SpecFilter(
|
||||||
@ -1832,6 +1830,7 @@ def external_packages(self):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
packages_yaml = _external_config_with_implicit_externals(spack.config.CONFIG)
|
||||||
for pkg_name, data in packages_yaml.items():
|
for pkg_name, data in packages_yaml.items():
|
||||||
if pkg_name == "all":
|
if pkg_name == "all":
|
||||||
continue
|
continue
|
||||||
@ -2997,7 +2996,10 @@ def possible_compilers(*, configuration) -> List["spack.spec.Spec"]:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
result.add(c)
|
result.add(c)
|
||||||
return sorted(result)
|
|
||||||
|
result = list(result)
|
||||||
|
result.sort()
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
class RuntimePropertyRecorder:
|
class RuntimePropertyRecorder:
|
||||||
|
Loading…
Reference in New Issue
Block a user