Compare commits

...

6 Commits

Author SHA1 Message Date
Gregory Becker
5d0bb647a3 typo 2023-05-15 18:02:11 -07:00
Gregory Becker
bfb72c7fd6 update tests for new outputs 2023-05-15 18:00:02 -07:00
Gregory Becker
08a5a59b21 try adding all environment specs to installer 2023-05-15 10:38:11 -07:00
Gregory Becker
cebd482300 test 2023-05-01 12:39:33 -07:00
becker33
84a1fc415d [@spackbot] updating style on behalf of becker33 2023-04-11 18:34:35 +00:00
Gregory Becker
394f2a58d3 spack install --overwrite: envs respect option 2023-04-10 15:41:30 -07:00
3 changed files with 14 additions and 26 deletions

View File

@ -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)))

View File

@ -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):

View File

@ -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