Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1aa900668d | ||
![]() |
76da5a1141 | ||
![]() |
6d9a214339 | ||
![]() |
17713c0151 | ||
![]() |
f383ca40db | ||
![]() |
453d36ca00 | ||
![]() |
eb95a50e08 |
@@ -1668,13 +1668,15 @@ def define_installed_packages(self, specs, possible):
|
||||
# Specs from local store
|
||||
with spack.store.db.read_transaction():
|
||||
for spec in spack.store.db.query(installed=True):
|
||||
self._facts_from_concrete_spec(spec, possible)
|
||||
if not spec.satisfies('dev_path=*'):
|
||||
self._facts_from_concrete_spec(spec, possible)
|
||||
|
||||
# Specs from configured buildcaches
|
||||
try:
|
||||
index = spack.binary_distribution.update_cache_and_get_specs()
|
||||
for spec in index:
|
||||
self._facts_from_concrete_spec(spec, possible)
|
||||
if not spec.satisfies('dev_path=*'):
|
||||
self._facts_from_concrete_spec(spec, possible)
|
||||
except (spack.binary_distribution.FetchCacheError, IndexError):
|
||||
# this is raised when no mirrors had indices.
|
||||
# TODO: update mirror configuration so it can indicate that the source cache
|
||||
|
@@ -827,6 +827,9 @@ no_flags(Package, FlagType)
|
||||
{ hash(Package, Hash) : installed_hash(Package, Hash) } 1
|
||||
:- node(Package), error("Internal error: package must resolve to at most one hash").
|
||||
|
||||
% you can't choose an installed hash for a dev spec
|
||||
:- hash(Package, Hash), variant_set(Package, "dev_path", _).
|
||||
|
||||
% if a hash is selected, we impose all the constraints that implies
|
||||
impose(Hash) :- hash(Package, Hash).
|
||||
|
||||
|
@@ -332,7 +332,6 @@ def concretize_difficult_packages(self, a, b):
|
||||
assert s[a].version == ver(b)
|
||||
|
||||
def test_concretize_two_virtuals(self):
|
||||
|
||||
"""Test a package with multiple virtual dependencies."""
|
||||
Spec('hypre').concretize()
|
||||
|
||||
@@ -1138,6 +1137,38 @@ def test_external_package_versions(self, spec_str, is_external, expected):
|
||||
assert s.external == is_external
|
||||
assert s.satisfies(expected)
|
||||
|
||||
@pytest.mark.parametrize('dev_first,spec', [
|
||||
(True, 'dev-build-test-install'),
|
||||
(True, 'dev-build-test-dependent'),
|
||||
(False, 'dev-build-test-install'),
|
||||
(False, 'dev-build-test-dependent')
|
||||
])
|
||||
def test_reuse_does_not_overwrite_dev_specs(
|
||||
self, dev_first, spec, tmpdir, mock_packages, install_mockery, mock_fetch):
|
||||
"""Test that reuse does not mix dev specs with non-dev specs.
|
||||
|
||||
Tests for either order (dev specs are not reused for non-dev, and
|
||||
non-dev specs are not reused for dev specs)
|
||||
Tests for a spec in which the root is developed and a spec in
|
||||
which a dep is developed."""
|
||||
# dev and non-dev specs that are otherwise identical
|
||||
spec = Spec(spec).normalized() # ensure dependencies present
|
||||
dev_spec = spec.copy()
|
||||
dev_constraint = 'dev_path=%s' % tmpdir.strpath
|
||||
dev_spec['dev-build-test-install'].constrain(dev_constraint)
|
||||
|
||||
# run the test in both orders
|
||||
first_spec = dev_spec if dev_first else spec
|
||||
second_spec = spec if dev_first else dev_spec
|
||||
|
||||
# concretize and install a non-dev version
|
||||
first_spec.concretize()
|
||||
first_spec.package.do_install(fake=True)
|
||||
# concretize a dev version
|
||||
with spack.config.override("concretizer:reuse", True):
|
||||
second_spec.concretize()
|
||||
assert first_spec.dag_hash() != second_spec.dag_hash()
|
||||
|
||||
@pytest.mark.regression('20292')
|
||||
@pytest.mark.parametrize('context', [
|
||||
{'add_variant': True, 'delete_variant': False},
|
||||
@@ -1145,7 +1176,7 @@ def test_external_package_versions(self, spec_str, is_external, expected):
|
||||
{'add_variant': True, 'delete_variant': True}
|
||||
])
|
||||
@pytest.mark.xfail()
|
||||
def test_reuse_installed_packages(
|
||||
def test_reuse_installed_packages_when_package_def_changes(
|
||||
self, context, mutable_database, repo_with_changing_recipe
|
||||
):
|
||||
# Install a spec
|
||||
|
Reference in New Issue
Block a user