Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
460d496d5d | ||
![]() |
038fee62e0 | ||
![]() |
60d36dd7c5 | ||
![]() |
dee379d3fc |
@ -98,8 +98,9 @@ def do_mark(specs, explicit):
|
|||||||
specs (list): list of specs to be marked
|
specs (list): list of specs to be marked
|
||||||
explicit (bool): whether to mark specs as explicitly installed
|
explicit (bool): whether to mark specs as explicitly installed
|
||||||
"""
|
"""
|
||||||
|
with spack.store.STORE.db.write_transaction():
|
||||||
for spec in specs:
|
for spec in specs:
|
||||||
spack.store.STORE.db.update_explicit(spec, explicit)
|
spack.store.STORE.db.mark(spec, "explicit", explicit)
|
||||||
|
|
||||||
|
|
||||||
def mark_specs(args, specs):
|
def mark_specs(args, specs):
|
||||||
|
@ -1381,7 +1381,7 @@ def _deprecate(self, spec: "spack.spec.Spec", deprecator: "spack.spec.Spec") ->
|
|||||||
self._data[spec_key] = spec_rec
|
self._data[spec_key] = spec_rec
|
||||||
|
|
||||||
@_autospec
|
@_autospec
|
||||||
def mark(self, spec: "spack.spec.Spec", key, value) -> None:
|
def mark(self, spec: "spack.spec.Spec", key: str, value: Any) -> None:
|
||||||
"""Mark an arbitrary record on a spec."""
|
"""Mark an arbitrary record on a spec."""
|
||||||
with self.write_transaction():
|
with self.write_transaction():
|
||||||
return self._mark(spec, key, value)
|
return self._mark(spec, key, value)
|
||||||
@ -1719,24 +1719,6 @@ def root(key, record):
|
|||||||
if id(rec.spec) not in needed and rec.installed
|
if id(rec.spec) not in needed and rec.installed
|
||||||
]
|
]
|
||||||
|
|
||||||
def update_explicit(self, spec, explicit):
|
|
||||||
"""
|
|
||||||
Update the spec's explicit state in the database.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
spec (spack.spec.Spec): the spec whose install record is being updated
|
|
||||||
explicit (bool): ``True`` if the package was requested explicitly
|
|
||||||
by the user, ``False`` if it was pulled in as a dependency of
|
|
||||||
an explicit package.
|
|
||||||
"""
|
|
||||||
rec = self.get_record(spec)
|
|
||||||
if explicit != rec.explicit:
|
|
||||||
with self.write_transaction():
|
|
||||||
message = "{s.name}@{s.version} : marking the package {0}"
|
|
||||||
status = "explicit" if explicit else "implicit"
|
|
||||||
tty.debug(message.format(status, s=spec))
|
|
||||||
rec.explicit = explicit
|
|
||||||
|
|
||||||
|
|
||||||
class NoUpstreamVisitor:
|
class NoUpstreamVisitor:
|
||||||
"""Gives edges to upstream specs, but does follow edges from upstream specs."""
|
"""Gives edges to upstream specs, but does follow edges from upstream specs."""
|
||||||
|
@ -1956,17 +1956,16 @@ def install_specs(self, specs: Optional[List[Spec]] = None, **install_args):
|
|||||||
specs = specs if specs is not None else roots
|
specs = specs if specs is not None else roots
|
||||||
|
|
||||||
# Extend the set of specs to overwrite with modified dev specs and their parents
|
# Extend the set of specs to overwrite with modified dev specs and their parents
|
||||||
overwrite: Set[str] = set()
|
install_args["overwrite"] = {
|
||||||
overwrite.update(install_args.get("overwrite", []), self._dev_specs_that_need_overwrite())
|
*install_args.get("overwrite", ()),
|
||||||
install_args["overwrite"] = overwrite
|
*self._dev_specs_that_need_overwrite(),
|
||||||
|
}
|
||||||
|
|
||||||
explicit: Set[str] = set()
|
# Only environment roots are marked explicit
|
||||||
explicit.update(
|
install_args["explicit"] = {
|
||||||
install_args.get("explicit", []),
|
*install_args.get("explicit", ()),
|
||||||
(s.dag_hash() for s in specs),
|
*(s.dag_hash() for s in roots),
|
||||||
(s.dag_hash() for s in roots),
|
}
|
||||||
)
|
|
||||||
install_args["explicit"] = explicit
|
|
||||||
|
|
||||||
PackageInstaller([spec.package for spec in specs], **install_args).install()
|
PackageInstaller([spec.package for spec in specs], **install_args).install()
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ def _process_external_package(pkg: "spack.package_base.PackageBase", explicit: b
|
|||||||
tty.debug(f"{pre} already registered in DB")
|
tty.debug(f"{pre} already registered in DB")
|
||||||
record = spack.store.STORE.db.get_record(spec)
|
record = spack.store.STORE.db.get_record(spec)
|
||||||
if explicit and not record.explicit:
|
if explicit and not record.explicit:
|
||||||
spack.store.STORE.db.update_explicit(spec, explicit)
|
spack.store.STORE.db.mark(spec, "explicit", True)
|
||||||
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
# If not, register it and generate the module file.
|
# If not, register it and generate the module file.
|
||||||
@ -1507,8 +1507,8 @@ def _prepare_for_install(self, task: Task) -> None:
|
|||||||
self._update_installed(task)
|
self._update_installed(task)
|
||||||
|
|
||||||
# Only update the explicit entry once for the explicit package
|
# Only update the explicit entry once for the explicit package
|
||||||
if task.explicit:
|
if task.explicit and not rec.explicit:
|
||||||
spack.store.STORE.db.update_explicit(task.pkg.spec, True)
|
spack.store.STORE.db.mark(task.pkg.spec, "explicit", True)
|
||||||
|
|
||||||
def _cleanup_all_tasks(self) -> None:
|
def _cleanup_all_tasks(self) -> None:
|
||||||
"""Cleanup all tasks to include releasing their locks."""
|
"""Cleanup all tasks to include releasing their locks."""
|
||||||
|
@ -892,3 +892,17 @@ def test_stack_enforcement_is_strict(tmp_path, matrix_line, config, mock_package
|
|||||||
with pytest.raises(Exception):
|
with pytest.raises(Exception):
|
||||||
with ev.Environment(tmp_path) as e:
|
with ev.Environment(tmp_path) as e:
|
||||||
e.concretize()
|
e.concretize()
|
||||||
|
|
||||||
|
|
||||||
|
def test_only_roots_are_explicitly_installed(tmp_path, mock_packages, config, temporary_store):
|
||||||
|
"""When installing specific non-root specs from an environment, we continue to mark them
|
||||||
|
as implicitly installed. What makes installs explicit is that they are root of the env."""
|
||||||
|
env = ev.create_in_dir(tmp_path)
|
||||||
|
env.add("mpileaks")
|
||||||
|
env.concretize()
|
||||||
|
mpileaks = env.concrete_roots()[0]
|
||||||
|
callpath = mpileaks["callpath"]
|
||||||
|
env.install_specs([callpath], fake=True)
|
||||||
|
assert callpath in temporary_store.db.query(explicit=False)
|
||||||
|
env.install_specs([mpileaks], fake=True)
|
||||||
|
assert temporary_store.db.query(explicit=True) == [mpileaks]
|
||||||
|
@ -28,6 +28,7 @@ class Tau(Package):
|
|||||||
license("MIT")
|
license("MIT")
|
||||||
|
|
||||||
version("master", branch="master")
|
version("master", branch="master")
|
||||||
|
version("2.34", sha256="229ab425e0532e635a0be76d60b8aa613adf7596d15a9ced0b87e7f243bb2132")
|
||||||
version("2.33.2", sha256="8ee81fe75507612379f70033183bed2a90e1245554b2a78196b6c5145da44f27")
|
version("2.33.2", sha256="8ee81fe75507612379f70033183bed2a90e1245554b2a78196b6c5145da44f27")
|
||||||
version("2.33.1", sha256="13cc5138e110932f34f02ddf548db91d8219ccb7ff9a84187f0790e40a502403")
|
version("2.33.1", sha256="13cc5138e110932f34f02ddf548db91d8219ccb7ff9a84187f0790e40a502403")
|
||||||
version("2.33", sha256="04d9d67adb495bc1ea56561f33c5ce5ba44f51cc7f64996f65bd446fac5483d9")
|
version("2.33", sha256="04d9d67adb495bc1ea56561f33c5ce5ba44f51cc7f64996f65bd446fac5483d9")
|
||||||
@ -427,8 +428,14 @@ def install(self, spec, prefix):
|
|||||||
# Link arch-specific directories into prefix since there is
|
# Link arch-specific directories into prefix since there is
|
||||||
# only one arch per prefix the way spack installs.
|
# only one arch per prefix the way spack installs.
|
||||||
self.link_tau_arch_dirs()
|
self.link_tau_arch_dirs()
|
||||||
# TAU may capture Spack's internal compiler wrapper. Replace
|
# TAU may capture Spack's internal compiler wrapper. Fixed
|
||||||
# it with the correct compiler.
|
# by filter_compiler_wrappers. Switch back the environment
|
||||||
|
# variables the filter uses.
|
||||||
|
if "+mpi" in spec:
|
||||||
|
env["CC"] = spack_cc
|
||||||
|
env["CXX"] = spack_cxx
|
||||||
|
env["FC"] = spack_fc
|
||||||
|
env["F77"] = spack_f77
|
||||||
|
|
||||||
def link_tau_arch_dirs(self):
|
def link_tau_arch_dirs(self):
|
||||||
for subdir in os.listdir(self.prefix):
|
for subdir in os.listdir(self.prefix):
|
||||||
|
Loading…
Reference in New Issue
Block a user