Every old spec has empty compiler flags

This commit is contained in:
Gregory Becker 2016-05-05 17:49:30 -07:00
parent 1bb7bfaf7f
commit 9a39ccea8f

View file

@ -756,13 +756,15 @@ def dag_hash(self, length=None):
"""
yaml_text = yaml.dump(
self.to_node_dict(), default_flow_style=True, width=sys.maxint)
print yaml_text
sha = hashlib.sha1(yaml_text)
return base64.b32encode(sha.digest()).lower()[:length]
def to_node_dict(self):
params = dict( (name, v.value) for name, v in self.variants.items() )
params.update( dict( (name, value) for name, value in self.compiler_flags.items()) )
params.update( dict( (name, []) for name in FlagMap.valid_compiler_flags() ) )
params.update( dict( (name, value) for name, value in self.compiler_flags.items()) ) #override
d = {
'parameters' : params,
'arch' : self.architecture,
@ -817,8 +819,8 @@ def from_node_dict(node):
elif 'variants' in node:
for name, value in node['variants'].items():
spec.variants[name] = VariantSpec(name, value)
# for name in FlagMap.valid_compiler_flags():
# spec.compiler_flags[name] = []
for name in FlagMap.valid_compiler_flags():
spec.compiler_flags[name] = []
else:
raise SpackRecordError("Did not find a valid format for variants in YAML file")