Compare commits
6 Commits
develop
...
bugfix/env
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5d0bb647a3 | ||
![]() |
bfb72c7fd6 | ||
![]() |
08a5a59b21 | ||
![]() |
cebd482300 | ||
![]() |
84a1fc415d | ||
![]() |
394f2a58d3 |
@ -1751,31 +1751,8 @@ def install_all(self, **install_args):
|
||||
self.install_specs(None, **install_args)
|
||||
|
||||
def install_specs(self, specs=None, **install_args):
|
||||
tty.debug("Assessing installation status of environment packages")
|
||||
# If "spack install" is invoked repeatedly for a large environment
|
||||
# where all specs are already installed, the operation can take
|
||||
# a large amount of time due to repeatedly acquiring and releasing
|
||||
# locks. As a small optimization, drop already installed root specs.
|
||||
installed_roots, uninstalled_roots = self._partition_roots_by_install_status()
|
||||
if specs:
|
||||
specs_to_install = [s for s in specs if s not in installed_roots]
|
||||
specs_dropped = [s for s in specs if s in installed_roots]
|
||||
else:
|
||||
specs_to_install = uninstalled_roots
|
||||
specs_dropped = installed_roots
|
||||
|
||||
# We need to repeat the work of the installer thanks to the above optimization:
|
||||
# Already installed root specs should be marked explicitly installed in the
|
||||
# database.
|
||||
if specs_dropped:
|
||||
with spack.store.db.write_transaction(): # do all in one transaction
|
||||
for spec in specs_dropped:
|
||||
spack.store.db.update_explicit(spec, True)
|
||||
|
||||
if not specs_to_install:
|
||||
tty.msg("All of the packages are already installed")
|
||||
else:
|
||||
tty.debug("Processing {0} uninstalled specs".format(len(specs_to_install)))
|
||||
specs_to_install = specs or [concrete for _, concrete in self.concretized_specs()]
|
||||
tty.debug("Processing {0} specs".format(len(specs_to_install)))
|
||||
|
||||
specs_to_overwrite = self._get_overwrite_specs()
|
||||
tty.debug("{0} specs need to be overwritten".format(len(specs_to_overwrite)))
|
||||
|
@ -295,7 +295,7 @@ def test_env_install_same_spec_twice(install_mockery, mock_fetch):
|
||||
|
||||
# The second installation reports all packages already installed
|
||||
out = install("cmake-client")
|
||||
assert "already installed" in out
|
||||
assert "Executing phase" not in out
|
||||
|
||||
|
||||
def test_env_definition_symlink(install_mockery, mock_fetch, tmpdir):
|
||||
|
@ -741,6 +741,17 @@ def test_install_deps_then_package(tmpdir, mock_fetch, install_mockery):
|
||||
assert os.path.exists(root.prefix)
|
||||
|
||||
|
||||
@pytest.mark.regression("30224")
|
||||
def test_install_overwrite_in_env(tmpdir, mock_fetch, install_mockery, mutable_mock_env_path):
|
||||
env("create", "test")
|
||||
|
||||
with ev.read("test"):
|
||||
install("--add", "dependency-install")
|
||||
output = install("-y", "--overwrite", "dependency-install")
|
||||
|
||||
assert "Executing phase" in output
|
||||
|
||||
|
||||
@pytest.mark.regression("12002")
|
||||
def test_install_only_dependencies_in_env(
|
||||
tmpdir, mock_fetch, install_mockery, mutable_mock_env_path
|
||||
|
Loading…
Reference in New Issue
Block a user