Fixed the first set of merge bugs
This commit is contained in:
parent
16431f7a4c
commit
01d5ffcd87
6 changed files with 16 additions and 20 deletions
|
@ -323,8 +323,8 @@ def to_dict(self):
|
||||||
target = self.target
|
target = self.target
|
||||||
|
|
||||||
d['platform'] = self.platform.name
|
d['platform'] = self.platform.name
|
||||||
d['platform_os'] = self.platform_os.to_dict()
|
d['platform_os'] = self.platform_os.to_dict() if self.platform_os else None
|
||||||
d['target'] = self.target.to_dict()
|
d['target'] = self.target.to_dict() if self.target else None
|
||||||
|
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
@ -362,8 +362,8 @@ def arch_from_dict(d):
|
||||||
os_dict = d['platform_os']
|
os_dict = d['platform_os']
|
||||||
target_dict = d['target']
|
target_dict = d['target']
|
||||||
|
|
||||||
target = _target_from_dict(target_dict)
|
target = _target_from_dict(target_dict) if os_dict else None
|
||||||
platform_os = _operating_system_from_dict(os_dict)
|
platform_os = _operating_system_from_dict(os_dict) if os_dict else None
|
||||||
arch.target = target
|
arch.target = target
|
||||||
arch.platform_os = platform_os
|
arch.platform_os = platform_os
|
||||||
|
|
||||||
|
|
|
@ -239,5 +239,5 @@ def find(parser, args):
|
||||||
mode=args.mode,
|
mode=args.mode,
|
||||||
long=args.long,
|
long=args.long,
|
||||||
very_long=args.very_long,
|
very_long=args.very_long,
|
||||||
show_flags=args.show_flags)
|
show_flags=args.show_flags,
|
||||||
namespace=args.namespace)
|
namespace=args.namespace)
|
||||||
|
|
|
@ -261,11 +261,7 @@ def get_compilers(cspec):
|
||||||
|
|
||||||
compilers.append(cls(cspec, operating_system, compiler_paths, mods, alias, **flags))
|
compilers.append(cls(cspec, operating_system, compiler_paths, mods, alias, **flags))
|
||||||
|
|
||||||
##ifdef NEW
|
return compilers
|
||||||
# return cls(cspec, *compiler_paths, **flags)
|
|
||||||
##else /* not NEW */
|
|
||||||
# return compilers
|
|
||||||
##endif /* not NEW */
|
|
||||||
|
|
||||||
matches = set(find(compiler_spec, scope))
|
matches = set(find(compiler_spec, scope))
|
||||||
compilers = []
|
compilers = []
|
||||||
|
|
|
@ -282,11 +282,8 @@ def _proper_compiler_style(cspec, architecture):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
#Find the another spec that has a compiler, or the root if none do
|
#Find the another spec that has a compiler, or the root if none do
|
||||||
#ifdef NEW
|
|
||||||
other_spec = spec if spec.compiler else find_spec(spec, lambda(x) : x.compiler)
|
other_spec = spec if spec.compiler else find_spec(spec, lambda(x) : x.compiler)
|
||||||
#else /* not NEW */
|
|
||||||
other_spec = find_spec(spec, lambda(x) : x.compiler)
|
|
||||||
#endif /* not NEW */
|
|
||||||
if not other_spec:
|
if not other_spec:
|
||||||
other_spec = spec.root
|
other_spec = spec.root
|
||||||
other_compiler = other_spec.compiler
|
other_compiler = other_spec.compiler
|
||||||
|
@ -321,6 +318,10 @@ def concretize_compiler_flags(self, spec):
|
||||||
compiler is used, defaulting to no compiler flags in the spec.
|
compiler is used, defaulting to no compiler flags in the spec.
|
||||||
Default specs set at the compiler level will still be added later.
|
Default specs set at the compiler level will still be added later.
|
||||||
"""
|
"""
|
||||||
|
if not spec.architecture.platform_os:
|
||||||
|
#Although this usually means changed, this means awaiting other changes
|
||||||
|
return True
|
||||||
|
|
||||||
ret = False
|
ret = False
|
||||||
for flag in spack.spec.FlagMap.valid_compiler_flags():
|
for flag in spack.spec.FlagMap.valid_compiler_flags():
|
||||||
try:
|
try:
|
||||||
|
@ -352,7 +353,7 @@ def concretize_compiler_flags(self, spec):
|
||||||
# Include the compiler flag defaults from the config files
|
# Include the compiler flag defaults from the config files
|
||||||
# This ensures that spack will detect conflicts that stem from a change
|
# This ensures that spack will detect conflicts that stem from a change
|
||||||
# in default compiler flags.
|
# in default compiler flags.
|
||||||
compiler = spack.compilers.compiler_for_spec(spec.compiler)
|
compiler = spack.compilers.compiler_for_spec(spec.compiler, spec.architecture.platform_os)
|
||||||
for flag in compiler.flags:
|
for flag in compiler.flags:
|
||||||
if flag not in spec.compiler_flags:
|
if flag not in spec.compiler_flags:
|
||||||
spec.compiler_flags[flag] = compiler.flags[flag]
|
spec.compiler_flags[flag] = compiler.flags[flag]
|
||||||
|
|
|
@ -1458,7 +1458,7 @@ def constrain(self, other, deps=True):
|
||||||
self.architecture = self.architecture or other.architecture
|
self.architecture = self.architecture or other.architecture
|
||||||
elif self.architecture.platform is None or other.architecture.platform is None:
|
elif self.architecture.platform is None or other.architecture.platform is None:
|
||||||
self.architecture.platform = self.architecture.platform or other.architecture.platform
|
self.architecture.platform = self.architecture.platform or other.architecture.platform
|
||||||
elif self.architecture.platform_os is None of other.architecture.platform_os is None:
|
elif self.architecture.platform_os is None or other.architecture.platform_os is None:
|
||||||
self.architecture.platform_os = self.architecture.platform_os or other.architecture.platform_os
|
self.architecture.platform_os = self.architecture.platform_os or other.architecture.platform_os
|
||||||
elif self.architecture.target is None or other.architecture.target is None:
|
elif self.architecture.target is None or other.architecture.target is None:
|
||||||
self.architecture.target = self.architecture.target or other.architecture.target
|
self.architecture.target = self.architecture.target or other.architecture.target
|
||||||
|
|
|
@ -72,7 +72,7 @@ def test_user_front_end_input(self):
|
||||||
"""
|
"""
|
||||||
frontend_os = self.platform.operating_system("frontend")
|
frontend_os = self.platform.operating_system("frontend")
|
||||||
frontend_target = self.platform.target("frontend")
|
frontend_target = self.platform.target("frontend")
|
||||||
frontend_spec = Spec("libelf=frontend")
|
frontend_spec = Spec("libelf os=frontend target=frontend")
|
||||||
frontend_spec.concretize()
|
frontend_spec.concretize()
|
||||||
self.assertEqual(frontend_os, frontend_spec.architecture.platform_os)
|
self.assertEqual(frontend_os, frontend_spec.architecture.platform_os)
|
||||||
self.assertEqual(frontend_target, frontend_spec.architecture.target)
|
self.assertEqual(frontend_target, frontend_spec.architecture.target)
|
||||||
|
@ -83,7 +83,7 @@ def test_user_back_end_input(self):
|
||||||
"""
|
"""
|
||||||
backend_os = self.platform.operating_system("backend")
|
backend_os = self.platform.operating_system("backend")
|
||||||
backend_target = self.platform.target("backend")
|
backend_target = self.platform.target("backend")
|
||||||
backend_spec = Spec("libelf=backend")
|
backend_spec = Spec("libelf os=backend target=backend")
|
||||||
backend_spec.concretize()
|
backend_spec.concretize()
|
||||||
self.assertEqual(backend_os, backend_spec.architecture.platform_os)
|
self.assertEqual(backend_os, backend_spec.architecture.platform_os)
|
||||||
self.assertEqual(backend_target, backend_spec.architecture.target)
|
self.assertEqual(backend_target, backend_spec.architecture.target)
|
||||||
|
@ -109,8 +109,7 @@ def test_user_input_combination(self):
|
||||||
results = []
|
results = []
|
||||||
for arch in combinations:
|
for arch in combinations:
|
||||||
o,t = arch
|
o,t = arch
|
||||||
arch_spec = "-".join(arch)
|
spec = Spec("libelf os=%s target=%s" % (o, t))
|
||||||
spec = Spec("libelf=%s" % arch_spec)
|
|
||||||
spec.concretize()
|
spec.concretize()
|
||||||
results.append(spec.architecture.platform_os == self.platform.operating_system(o))
|
results.append(spec.architecture.platform_os == self.platform.operating_system(o))
|
||||||
results.append(spec.architecture.target == self.platform.target(t))
|
results.append(spec.architecture.target == self.platform.target(t))
|
||||||
|
|
Loading…
Reference in a new issue