From 25f20b19673d71fb11ada83567c9e89de5555839 Mon Sep 17 00:00:00 2001 From: Gregory Becker Date: Wed, 2 Mar 2016 11:40:21 -0800 Subject: [PATCH] bug hunting --- lib/spack/spack/architecture.py | 5 ++++- lib/spack/spack/concretize.py | 15 ++++++--------- lib/spack/spack/spec.py | 1 - var/spack/mock_packages/multimethod/package.py | 7 ++++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py index 94bd59a9d5..c9e4eb132d 100644 --- a/lib/spack/spack/architecture.py +++ b/lib/spack/spack/architecture.py @@ -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): diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py index add3b8435d..37204e32a4 100644 --- a/lib/spack/spack/concretize.py +++ b/lib/spack/spack/concretize.py @@ -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!!! diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 169c06242e..fdc5e3bc96 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -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: diff --git a/var/spack/mock_packages/multimethod/package.py b/var/spack/mock_packages/multimethod/package.py index b926d42d7b..03da9ef69d 100644 --- a/var/spack/mock_packages/multimethod/package.py +++ b/var/spack/mock_packages/multimethod/package.py @@ -120,9 +120,10 @@ def has_a_default(self): for target in targets: @when('='+target.name) def different_by_target(self): - return self.spec.architecture.target.name - - + 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 #