bug hunting

This commit is contained in:
Gregory Becker 2016-03-02 11:40:21 -08:00
parent 340ecf6e9a
commit 25f20b1967
4 changed files with 14 additions and 14 deletions

View file

@ -209,7 +209,10 @@ def __str__(self):
str(self.platform_os) + "-" + str(self.target) )
def _cmp_key(self):
return (self.platform, self.platform_os, self.target)
platform = self.platform.name
os = self.platform_os.name if isinstance(self.platform_os, OperatingSystem) else self.platform_os
target = self.target.name if isinstance(self.target, Target) else self.target
return (platform, os, target)
def _helper_to_dict(arch_field_dict, arch_field_name, *args):

View file

@ -210,7 +210,7 @@ def concretize_version(self, spec):
return True # Things changed
def _concretize_operating_system(self, spec, platform):
def _concretize_operating_system(self, spec):
if spec.architecture.platform_os is not None:
if isinstance(spec.architecture.platform_os,spack.architecture.OperatingSystem):
return False
@ -223,8 +223,7 @@ def _concretize_operating_system(self, spec, platform):
else:
spec.add_operating_system_from_string(spec.root.architecture.platform_os)
else:
platform = spack.architecture.sys_type()
spec.architecture.platform_os = platform.operating_system('default_os')
spec.architecture.platform_os = spec.architecture.platform.operating_system('default_os')
return True #changed
@ -236,7 +235,7 @@ def _concretize_operating_system(self, spec, platform):
# return True
def _concretize_target(self, spec, platform):
def _concretize_target(self, spec):
if spec.architecture.target is not None:
if isinstance(spec.architecture.target,spack.architecture.Target):
return False
@ -250,8 +249,7 @@ def _concretize_target(self, spec, platform):
else:
spec.add_target_from_string(spec.root.architecture.target)
else:
platform = spack.architecture.sys_type()
spec.architecture.target = platform.target('default')
spec.architecture.target = spec.architecture.platform.target('default')
return True #changed
@ -280,11 +278,10 @@ def concretize_architecture(self, spec):
#False
# if isinstance(spec.architecture, basestring):
# spec.split_architecture_string(spec.architecture)
print spec.architecture
ret = any((
self._concretize_operating_system(spec, platform),
self._concretize_target(spec, platform)))
self._concretize_operating_system(spec),
self._concretize_target(spec)))
# Does not look pretty at all!!!

View file

@ -462,7 +462,6 @@ def _set_architecture(self, architecture):
if self.architecture: raise DuplicateArchitectureError(
"Spec for '%s' cannot have two architectures." % self.name)
platform = spack.architecture.sys_type()
print architecture
if '-' in architecture:
os, target = architecture.split('-')
else:

View file

@ -120,9 +120,10 @@ def has_a_default(self):
for target in targets:
@when('='+target.name)
def different_by_target(self):
if isinstance(self.spec.architecture.target,basestring):
return self.spec.architecture.target
else:
return self.spec.architecture.target.name
#
# Make sure we can switch methods on different dependencies
#