Added more comments
This commit is contained in:
parent
5c3c6e7f06
commit
bd7c189c12
1 changed files with 8 additions and 7 deletions
|
@ -661,12 +661,14 @@ def to_node_dict(self):
|
||||||
'dependencies' : dict((d, self.dependencies[d].dag_hash())
|
'dependencies' : dict((d, self.dependencies[d].dag_hash())
|
||||||
for d in sorted(self.dependencies))
|
for d in sorted(self.dependencies))
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.architecture:
|
if self.architecture:
|
||||||
# TODO: Fix the target.to_dict to account for the tuple
|
# TODO: Fix the target.to_dict to account for the tuple
|
||||||
# Want it to be a dict of dicts
|
# Want it to be a dict of dicts
|
||||||
d['architecture'] = self.architecture.target.to_dict()
|
d['architecture'] = spack.architecture.to_dict(self.architecture)
|
||||||
else:
|
else:
|
||||||
d['architecture'] = None
|
d['architecture'] = None
|
||||||
|
|
||||||
if self.compiler:
|
if self.compiler:
|
||||||
d.update(self.compiler.to_dict())
|
d.update(self.compiler.to_dict())
|
||||||
else:
|
else:
|
||||||
|
@ -693,8 +695,7 @@ def from_node_dict(node):
|
||||||
spec = Spec(name)
|
spec = Spec(name)
|
||||||
spec.versions = VersionList.from_dict(node)
|
spec.versions = VersionList.from_dict(node)
|
||||||
# TODO: Need to fix the architecture.Target.from_dict
|
# TODO: Need to fix the architecture.Target.from_dict
|
||||||
spec.architecture = spack.architecture.Target.from_dict(
|
spec.architecture = spack.architecture.from_dict(node['architecture'])
|
||||||
node['architecture'])
|
|
||||||
|
|
||||||
if node['compiler'] is None:
|
if node['compiler'] is None:
|
||||||
spec.compiler = None
|
spec.compiler = None
|
||||||
|
@ -1292,17 +1293,17 @@ def add_architecture_from_string(self, arch):
|
||||||
|
|
||||||
for entry in arch_list:
|
for entry in arch_list:
|
||||||
if self._is_valid_platform(entry, platform_names):
|
if self._is_valid_platform(entry, platform_names):
|
||||||
|
# If entry is different from platform name then create it.
|
||||||
|
# else just keep the already instantiated platform class
|
||||||
if entry != platform.name:
|
if entry != platform.name:
|
||||||
platform = platform_dict[entry]() # Create instance of platform
|
platform = platform_dict[entry]() # Create instance of platform
|
||||||
elif self._is_valid_target(entry, platform):
|
elif self._is_valid_target(entry, platform):
|
||||||
target = platform.target(entry)
|
target = platform.target(entry)
|
||||||
# Need to figure out if we're supporting arbitrary os's and how
|
# check if os is valid by checking platform operating sys dict
|
||||||
# to account for them
|
|
||||||
# Not really a good implementation since the user can add
|
|
||||||
# gibberish and spack will see it as an os
|
|
||||||
elif self._is_valid_os(entry, platform):
|
elif self._is_valid_os(entry, platform):
|
||||||
platform_os = platform.operating_system(entry)
|
platform_os = platform.operating_system(entry)
|
||||||
else:
|
else:
|
||||||
|
# throw error since entry is unknown
|
||||||
raise UnknownArchitectureSpecError(entry)
|
raise UnknownArchitectureSpecError(entry)
|
||||||
|
|
||||||
if target is None:
|
if target is None:
|
||||||
|
|
Loading…
Reference in a new issue