rebase fixup
This commit is contained in:
parent
04f8ebd1eb
commit
a3b6b873da
@ -868,7 +868,6 @@ def __init__(
|
|||||||
pkg: "spack.package_base.PackageBase",
|
pkg: "spack.package_base.PackageBase",
|
||||||
request: BuildRequest,
|
request: BuildRequest,
|
||||||
*,
|
*,
|
||||||
compiler: bool = False,
|
|
||||||
start: float = 0.0,
|
start: float = 0.0,
|
||||||
attempts: int = 0,
|
attempts: int = 0,
|
||||||
status: BuildStatus = BuildStatus.QUEUED,
|
status: BuildStatus = BuildStatus.QUEUED,
|
||||||
@ -1198,15 +1197,15 @@ def execute(self, install_status):
|
|||||||
|
|
||||||
tty.msg(install_msg(pkg_id, self.pid, install_status))
|
tty.msg(install_msg(pkg_id, self.pid, install_status))
|
||||||
self.start = self.start or time.time()
|
self.start = self.start or time.time()
|
||||||
self.status = STATUS_INSTALLING
|
self.status = BuildStatus.INSTALLING
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if _install_from_cache(pkg, self.explicit, unsigned):
|
if _install_from_cache(pkg, self.explicit, unsigned):
|
||||||
if self.compiler:
|
|
||||||
_add_compiler_package_to_config(pkg)
|
|
||||||
return ExecuteResult.SUCCESS
|
return ExecuteResult.SUCCESS
|
||||||
elif self.cache_only:
|
elif self.cache_only:
|
||||||
raise InstallError("No binary found when cache-only was specified", pkg=pkg)
|
raise spack.error.InstallError(
|
||||||
|
"No binary found when cache-only was specified", pkg=pkg
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
tty.msg(f"No binary for {pkg_id} found: installing from source")
|
tty.msg(f"No binary for {pkg_id} found: installing from source")
|
||||||
return ExecuteResult.MISSING_BINARY
|
return ExecuteResult.MISSING_BINARY
|
||||||
@ -1224,10 +1223,9 @@ def build_task(self, installed):
|
|||||||
build_task = BuildTask(
|
build_task = BuildTask(
|
||||||
pkg=self.pkg,
|
pkg=self.pkg,
|
||||||
request=self.request,
|
request=self.request,
|
||||||
compiler=self.compiler,
|
|
||||||
start=0,
|
start=0,
|
||||||
attempts=self.attempts,
|
attempts=self.attempts,
|
||||||
status=STATUS_ADDED,
|
status=BuildStatus.QUEUED,
|
||||||
installed=installed,
|
installed=installed,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1756,7 +1754,7 @@ def _requeue_as_build_task(self, task):
|
|||||||
|
|
||||||
# Add a new task if we need one
|
# Add a new task if we need one
|
||||||
if dep_id not in self.build_tasks and dep_id not in self.installed:
|
if dep_id not in self.build_tasks and dep_id not in self.installed:
|
||||||
self._add_init_task(dep_pkg, task.request, False, self.all_dependencies)
|
self._add_init_task(dep_pkg, task.request, self.all_dependencies)
|
||||||
# Add edges for an existing task if it exists
|
# Add edges for an existing task if it exists
|
||||||
elif dep_id in self.build_tasks:
|
elif dep_id in self.build_tasks:
|
||||||
for parent in dep.dependents():
|
for parent in dep.dependents():
|
||||||
@ -1862,28 +1860,6 @@ def _overwrite_install_task(self, task: Task, install_status: InstallStatus) ->
|
|||||||
too, mark the spec as uninstalled. This function always the original
|
too, mark the spec as uninstalled. This function always the original
|
||||||
install error if installation fails.
|
install error if installation fails.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class OverwriteInstall:
|
|
||||||
def __init__(
|
|
||||||
self,
|
|
||||||
installer: PackageInstaller,
|
|
||||||
database: spack.database.Database,
|
|
||||||
task: Task,
|
|
||||||
install_status: InstallStatus,
|
|
||||||
):
|
|
||||||
self.installer = installer
|
|
||||||
self.database = database
|
|
||||||
self.task = task
|
|
||||||
self.install_status = install_status
|
|
||||||
|
|
||||||
def install(self):
|
|
||||||
"""
|
|
||||||
Try to run the install task overwriting the package prefix.
|
|
||||||
If this fails, try to recover the original install prefix. If that fails
|
|
||||||
too, mark the spec as uninstalled. This function always the original
|
|
||||||
install error if installation fails.
|
|
||||||
"""
|
|
||||||
try:
|
try:
|
||||||
with fs.replace_directory_transaction(task.pkg.prefix):
|
with fs.replace_directory_transaction(task.pkg.prefix):
|
||||||
rc = self._install_task(task, install_status)
|
rc = self._install_task(task, install_status)
|
||||||
|
@ -81,7 +81,7 @@ def create_install_task(
|
|||||||
pkg: spack.package_base.PackageBase, install_args: Optional[dict] = None
|
pkg: spack.package_base.PackageBase, install_args: Optional[dict] = None
|
||||||
) -> inst.InstallTask:
|
) -> inst.InstallTask:
|
||||||
request = inst.BuildRequest(pkg, {} if install_args is None else install_args)
|
request = inst.BuildRequest(pkg, {} if install_args is None else install_args)
|
||||||
return inst.InstallTask(pkg, request, False, 0, 0, inst.STATUS_ADDED, set())
|
return inst.InstallTask(pkg, request=request, status=inst.BuildStatus.QUEUED)
|
||||||
|
|
||||||
|
|
||||||
def create_installer(
|
def create_installer(
|
||||||
|
Loading…
Reference in New Issue
Block a user