Compare commits
3 Commits
bugfix/rou
...
bugfix/msv
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68906f62c4 | ||
|
|
69f5908d40 | ||
|
|
b7f27d799a |
@@ -778,7 +778,7 @@ def _assign_dependencies(
|
|||||||
spec_node_dict = spec_node_dict[spec.name]
|
spec_node_dict = spec_node_dict[spec.name]
|
||||||
if "dependencies" in spec_node_dict:
|
if "dependencies" in spec_node_dict:
|
||||||
yaml_deps = spec_node_dict["dependencies"]
|
yaml_deps = spec_node_dict["dependencies"]
|
||||||
for dname, dhash, dtypes, _, virtuals, direct in spec_reader.read_specfile_dep_specs(
|
for dname, dhash, dtypes, _, virtuals in spec_reader.read_specfile_dep_specs(
|
||||||
yaml_deps
|
yaml_deps
|
||||||
):
|
):
|
||||||
# It is important that we always check upstream installations in the same order,
|
# It is important that we always check upstream installations in the same order,
|
||||||
@@ -797,9 +797,7 @@ def _assign_dependencies(
|
|||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
spec._add_dependency(
|
spec._add_dependency(child, depflag=dt.canonicalize(dtypes), virtuals=virtuals)
|
||||||
child, depflag=dt.canonicalize(dtypes), virtuals=virtuals, direct=direct
|
|
||||||
)
|
|
||||||
|
|
||||||
def _read_from_file(self, filename: pathlib.Path, *, reindex: bool = False) -> None:
|
def _read_from_file(self, filename: pathlib.Path, *, reindex: bool = False) -> None:
|
||||||
"""Fill database from file, do not maintain old data.
|
"""Fill database from file, do not maintain old data.
|
||||||
|
|||||||
@@ -543,6 +543,7 @@
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from .environment import (
|
from .environment import (
|
||||||
|
|||||||
@@ -2230,14 +2230,9 @@ def filter_specs(self, reader, json_specs_by_hash, order_concretized):
|
|||||||
# and add them to the spec, including build specs
|
# and add them to the spec, including build specs
|
||||||
for lockfile_key, node_dict in json_specs_by_hash.items():
|
for lockfile_key, node_dict in json_specs_by_hash.items():
|
||||||
name, data = reader.name_and_data(node_dict)
|
name, data = reader.name_and_data(node_dict)
|
||||||
for _, dep_hash, deptypes, _, virtuals, direct in reader.dependencies_from_node_dict(
|
for _, dep_hash, deptypes, _, virtuals in reader.dependencies_from_node_dict(data):
|
||||||
data
|
|
||||||
):
|
|
||||||
specs_by_hash[lockfile_key]._add_dependency(
|
specs_by_hash[lockfile_key]._add_dependency(
|
||||||
specs_by_hash[dep_hash],
|
specs_by_hash[dep_hash], depflag=dt.canonicalize(deptypes), virtuals=virtuals
|
||||||
depflag=dt.canonicalize(deptypes),
|
|
||||||
virtuals=virtuals,
|
|
||||||
direct=direct,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if "build_spec" in node_dict:
|
if "build_spec" in node_dict:
|
||||||
|
|||||||
@@ -2383,7 +2383,6 @@ def to_node_dict(self, hash=ht.dag_hash):
|
|||||||
"parameters": {
|
"parameters": {
|
||||||
"deptypes": dt.flag_to_tuple(dspec.depflag),
|
"deptypes": dt.flag_to_tuple(dspec.depflag),
|
||||||
"virtuals": dspec.virtuals,
|
"virtuals": dspec.virtuals,
|
||||||
"direct": dspec.direct,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for name, edges_for_name in sorted(deps.items())
|
for name, edges_for_name in sorted(deps.items())
|
||||||
@@ -4891,7 +4890,7 @@ def _load(cls, data):
|
|||||||
|
|
||||||
# Pass 0: Determine hash type
|
# Pass 0: Determine hash type
|
||||||
for node in nodes:
|
for node in nodes:
|
||||||
for _, _, _, dhash_type, _, _ in cls.dependencies_from_node_dict(node):
|
for _, _, _, dhash_type, _ in cls.dependencies_from_node_dict(node):
|
||||||
any_deps = True
|
any_deps = True
|
||||||
if dhash_type:
|
if dhash_type:
|
||||||
hash_type = dhash_type
|
hash_type = dhash_type
|
||||||
@@ -4922,12 +4921,11 @@ def _load(cls, data):
|
|||||||
# Pass 2: Finish construction of all DAG edges (including build specs)
|
# Pass 2: Finish construction of all DAG edges (including build specs)
|
||||||
for node_hash, node in hash_dict.items():
|
for node_hash, node in hash_dict.items():
|
||||||
node_spec = node["node_spec"]
|
node_spec = node["node_spec"]
|
||||||
for _, dhash, dtype, _, virtuals, direct in cls.dependencies_from_node_dict(node):
|
for _, dhash, dtype, _, virtuals in cls.dependencies_from_node_dict(node):
|
||||||
node_spec._add_dependency(
|
node_spec._add_dependency(
|
||||||
hash_dict[dhash]["node_spec"],
|
hash_dict[dhash]["node_spec"],
|
||||||
depflag=dt.canonicalize(dtype),
|
depflag=dt.canonicalize(dtype),
|
||||||
virtuals=virtuals,
|
virtuals=virtuals,
|
||||||
direct=direct,
|
|
||||||
)
|
)
|
||||||
if "build_spec" in node.keys():
|
if "build_spec" in node.keys():
|
||||||
_, bhash, _ = cls.extract_build_spec_info_from_node_dict(node, hash_type=hash_type)
|
_, bhash, _ = cls.extract_build_spec_info_from_node_dict(node, hash_type=hash_type)
|
||||||
@@ -4968,9 +4966,9 @@ def load(cls, data):
|
|||||||
for node in nodes:
|
for node in nodes:
|
||||||
# get dependency dict from the node.
|
# get dependency dict from the node.
|
||||||
name, data = cls.name_and_data(node)
|
name, data = cls.name_and_data(node)
|
||||||
for dname, _, dtypes, _, virtuals, direct in cls.dependencies_from_node_dict(data):
|
for dname, _, dtypes, _, virtuals in cls.dependencies_from_node_dict(data):
|
||||||
deps[name]._add_dependency(
|
deps[name]._add_dependency(
|
||||||
deps[dname], depflag=dt.canonicalize(dtypes), virtuals=virtuals, direct=direct
|
deps[dname], depflag=dt.canonicalize(dtypes), virtuals=virtuals
|
||||||
)
|
)
|
||||||
|
|
||||||
reconstruct_virtuals_on_edges(result)
|
reconstruct_virtuals_on_edges(result)
|
||||||
@@ -5008,7 +5006,7 @@ def read_specfile_dep_specs(cls, deps, hash_type=ht.dag_hash.name):
|
|||||||
raise spack.error.SpecError("Couldn't parse dependency spec.")
|
raise spack.error.SpecError("Couldn't parse dependency spec.")
|
||||||
else:
|
else:
|
||||||
raise spack.error.SpecError("Couldn't parse dependency types in spec.")
|
raise spack.error.SpecError("Couldn't parse dependency types in spec.")
|
||||||
yield dep_name, dep_hash, list(deptypes), hash_type, list(virtuals), True
|
yield dep_name, dep_hash, list(deptypes), hash_type, list(virtuals)
|
||||||
|
|
||||||
|
|
||||||
class SpecfileV2(SpecfileReaderBase):
|
class SpecfileV2(SpecfileReaderBase):
|
||||||
@@ -5045,15 +5043,13 @@ def read_specfile_dep_specs(cls, deps, hash_type=ht.dag_hash.name):
|
|||||||
# new format: elements of dependency spec are keyed.
|
# new format: elements of dependency spec are keyed.
|
||||||
for h in ht.HASHES:
|
for h in ht.HASHES:
|
||||||
if h.name in elt:
|
if h.name in elt:
|
||||||
dep_hash, deptypes, hash_type, virtuals, direct = (
|
dep_hash, deptypes, hash_type, virtuals = cls.extract_info_from_dep(elt, h)
|
||||||
cls.extract_info_from_dep(elt, h)
|
|
||||||
)
|
|
||||||
break
|
break
|
||||||
else: # We never determined a hash type...
|
else: # We never determined a hash type...
|
||||||
raise spack.error.SpecError("Couldn't parse dependency spec.")
|
raise spack.error.SpecError("Couldn't parse dependency spec.")
|
||||||
else:
|
else:
|
||||||
raise spack.error.SpecError("Couldn't parse dependency types in spec.")
|
raise spack.error.SpecError("Couldn't parse dependency types in spec.")
|
||||||
result.append((dep_name, dep_hash, list(deptypes), hash_type, list(virtuals), direct))
|
result.append((dep_name, dep_hash, list(deptypes), hash_type, list(virtuals)))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -5061,8 +5057,7 @@ def extract_info_from_dep(cls, elt, hash):
|
|||||||
dep_hash, deptypes = elt[hash.name], elt["type"]
|
dep_hash, deptypes = elt[hash.name], elt["type"]
|
||||||
hash_type = hash.name
|
hash_type = hash.name
|
||||||
virtuals = []
|
virtuals = []
|
||||||
direct = True
|
return dep_hash, deptypes, hash_type, virtuals
|
||||||
return dep_hash, deptypes, hash_type, virtuals, direct
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def extract_build_spec_info_from_node_dict(cls, node, hash_type=ht.dag_hash.name):
|
def extract_build_spec_info_from_node_dict(cls, node, hash_type=ht.dag_hash.name):
|
||||||
@@ -5083,8 +5078,7 @@ def extract_info_from_dep(cls, elt, hash):
|
|||||||
deptypes = elt["parameters"]["deptypes"]
|
deptypes = elt["parameters"]["deptypes"]
|
||||||
hash_type = hash.name
|
hash_type = hash.name
|
||||||
virtuals = elt["parameters"]["virtuals"]
|
virtuals = elt["parameters"]["virtuals"]
|
||||||
direct = True
|
return dep_hash, deptypes, hash_type, virtuals
|
||||||
return dep_hash, deptypes, hash_type, virtuals, direct
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, data):
|
def load(cls, data):
|
||||||
@@ -5098,15 +5092,6 @@ class SpecfileV5(SpecfileV4):
|
|||||||
def legacy_compiler(cls, node):
|
def legacy_compiler(cls, node):
|
||||||
raise RuntimeError("The 'compiler' option is unexpected in specfiles at v5 or greater")
|
raise RuntimeError("The 'compiler' option is unexpected in specfiles at v5 or greater")
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def extract_info_from_dep(cls, elt, hash):
|
|
||||||
dep_hash = elt[hash.name]
|
|
||||||
deptypes = elt["parameters"]["deptypes"]
|
|
||||||
hash_type = hash.name
|
|
||||||
virtuals = elt["parameters"]["virtuals"]
|
|
||||||
direct = elt["parameters"].get("direct", True)
|
|
||||||
return dep_hash, deptypes, hash_type, virtuals, direct
|
|
||||||
|
|
||||||
|
|
||||||
#: Alias to the latest version of specfiles
|
#: Alias to the latest version of specfiles
|
||||||
SpecfileLatest = SpecfileV5
|
SpecfileLatest = SpecfileV5
|
||||||
|
|||||||
@@ -494,10 +494,6 @@ def test_anchorify_2():
|
|||||||
"hdf5~~mpi++shared",
|
"hdf5~~mpi++shared",
|
||||||
"hdf5 cflags==-g foo==bar cxxflags==-O3",
|
"hdf5 cflags==-g foo==bar cxxflags==-O3",
|
||||||
"hdf5 cflags=-g foo==bar cxxflags==-O3",
|
"hdf5 cflags=-g foo==bar cxxflags==-O3",
|
||||||
"hdf5%gcc",
|
|
||||||
"hdf5%cmake",
|
|
||||||
"hdf5^gcc",
|
|
||||||
"hdf5^cmake",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_pickle_roundtrip_for_abstract_specs(spec_str):
|
def test_pickle_roundtrip_for_abstract_specs(spec_str):
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ def install(self, spec, prefix):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def determine_version(cls, exe):
|
def determine_version(cls, exe):
|
||||||
|
if not exe.endswith(".exe") and not exe.endswith(".bat"):
|
||||||
|
# Not on windows, can't possibly be msvc
|
||||||
|
return
|
||||||
|
|
||||||
# MSVC compiler does not have a proper version argument
|
# MSVC compiler does not have a proper version argument
|
||||||
# Errors out and prints version info with no args
|
# Errors out and prints version info with no args
|
||||||
is_ifx = "ifx.exe" in str(exe)
|
is_ifx = "ifx.exe" in str(exe)
|
||||||
|
|||||||
Reference in New Issue
Block a user