Fixed the way flags on deps are attached so that they aren't moved onto the root before normalize/concretize
This commit is contained in:
parent
342f4bc2e0
commit
16e9d658d5
2 changed files with 16 additions and 15 deletions
|
@ -1806,6 +1806,8 @@ def do_parse(self):
|
|||
|
||||
try:
|
||||
while self.next:
|
||||
if self.previous:
|
||||
specs.append(self.previous.value)
|
||||
if self.accept(ID):
|
||||
self.previous = self.token
|
||||
if self.accept(EQ):
|
||||
|
@ -1818,6 +1820,7 @@ def do_parse(self):
|
|||
specs[-1]._add_flag(self.previous.value, self.token.value)
|
||||
else:
|
||||
specs.append(self.spec(self.previous.value))
|
||||
self.previous = None
|
||||
elif self.accept(HASH):
|
||||
specs.append(self.spec_by_hash())
|
||||
|
||||
|
@ -1825,6 +1828,7 @@ def do_parse(self):
|
|||
if not specs:
|
||||
self.previous = self.token
|
||||
specs.append(self.spec(''))
|
||||
self.previous = None
|
||||
if self.accept(HASH):
|
||||
specs[-1]._add_dependency(self.spec_by_hash())
|
||||
else:
|
||||
|
@ -1911,17 +1915,6 @@ def spec(self, name, check_valid_token = False):
|
|||
check_valid_token = False
|
||||
|
||||
elif self.accept(ON):
|
||||
# self.expect(ID)
|
||||
# self.check_identifier()
|
||||
# option = self.token.value
|
||||
# if self.accept(EQ):
|
||||
# if self.accept(QT):
|
||||
# self.token.value = self.token.value[1:-1]
|
||||
# else:
|
||||
# self.expect(ID)
|
||||
# spec._add_flag(option,self.token.value)
|
||||
# else:
|
||||
# spec._add_variant(self.variant(option),True)
|
||||
spec._add_variant(self.variant(), True)
|
||||
check_valid_token = False
|
||||
|
||||
|
@ -1933,6 +1926,15 @@ def spec(self, name, check_valid_token = False):
|
|||
spec._set_compiler(self.compiler())
|
||||
check_valid_token = False
|
||||
|
||||
elif self.accept(ID):
|
||||
self.previous = self.token
|
||||
if self.accept(EQ):
|
||||
self.expect(ID)
|
||||
spec._add_flag(self.previous.value, self.token.value)
|
||||
self.previous = None
|
||||
else:
|
||||
return spec
|
||||
|
||||
else:
|
||||
if check_valid_token:
|
||||
self.unexpected_token()
|
||||
|
|
|
@ -243,9 +243,6 @@ def test_unsatisfiable_compiler_version(self):
|
|||
def test_unsatisfiable_architecture(self):
|
||||
set_pkg_dep('mpileaks', 'mpich arch=bgqos_0')
|
||||
spec = Spec('mpileaks ^mpich arch=sles_10_ppc64 ^callpath ^dyninst ^libelf ^libdwarf')
|
||||
print spec
|
||||
spec.normalize()
|
||||
print spec
|
||||
self.assertRaises(spack.spec.UnsatisfiableArchitectureSpecError, spec.normalize)
|
||||
|
||||
|
||||
|
@ -339,7 +336,7 @@ def test_normalize_mpileaks(self):
|
|||
self.assertEqual(lhs, rhs)
|
||||
self.assertEqual(str(lhs), str(rhs))
|
||||
|
||||
# Test that equal and equal_dag are doing the right thing
|
||||
# test that equal and equal_dag are doing the right thing
|
||||
self.assertEqual(spec, expected_flat)
|
||||
self.assertTrue(spec.eq_dag(expected_flat))
|
||||
|
||||
|
@ -440,3 +437,5 @@ def test_copy_concretized(self):
|
|||
orig_ids = set(id(s) for s in orig.traverse())
|
||||
copy_ids = set(id(s) for s in copy.traverse())
|
||||
self.assertFalse(orig_ids.intersection(copy_ids))
|
||||
|
||||
# LocalWords: libdwarf
|
||||
|
|
Loading…
Reference in a new issue