summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2022-07-20 12:09:45 +0200
committerGitHub <noreply@github.com>2022-07-20 12:09:45 +0200
commite3aca44601b8eeedaddd25909e29a48b290c293e (patch)
treec4164a55f0eb2ef0f198f65ad281a3a13fc8a7e3 /lib
parent43673fee808f9e02efcb4330c6a7fa2c9b80c14c (diff)
downloadspack-e3aca44601b8eeedaddd25909e29a48b290c293e.tar.gz
spack-e3aca44601b8eeedaddd25909e29a48b290c293e.tar.bz2
spack-e3aca44601b8eeedaddd25909e29a48b290c293e.tar.xz
spack-e3aca44601b8eeedaddd25909e29a48b290c293e.zip
installer.py: require "explicit: True" in the install arguments to mark a package "explicit" (#31646)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/installer.py3
-rw-r--r--lib/spack/spack/test/installer.py12
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/spack/spack/installer.py b/lib/spack/spack/installer.py
index af34388eb4..6f6af97812 100644
--- a/lib/spack/spack/installer.py
+++ b/lib/spack/spack/installer.py
@@ -2212,7 +2212,8 @@ class BuildTask(object):
@property
def explicit(self):
"""The package was explicitly requested by the user."""
- return self.pkg == self.request.pkg
+ return self.pkg == self.request.pkg and \
+ self.request.install_args.get('explicit', True)
@property
def key(self):
diff --git a/lib/spack/spack/test/installer.py b/lib/spack/spack/test/installer.py
index f2bd5e1a10..8a36978cab 100644
--- a/lib/spack/spack/test/installer.py
+++ b/lib/spack/spack/test/installer.py
@@ -1176,6 +1176,18 @@ def test_install_skip_patch(install_mockery, mock_fetch):
assert inst.package_id(spec.package) in installer.installed
+def test_install_implicit(install_mockery, mock_fetch):
+ """Test the path skip_patch install path."""
+ spec_name = 'trivial-install-test-package'
+ const_arg = installer_args([spec_name],
+ {'fake': False})
+ installer = create_installer(const_arg)
+ pkg = installer.build_requests[0].pkg
+ assert not create_build_task(pkg, {'explicit': False}).explicit
+ assert create_build_task(pkg, {'explicit': True}).explicit
+ assert create_build_task(pkg).explicit
+
+
def test_overwrite_install_backup_success(temporary_store, config, mock_packages,
tmpdir):
"""