Track install state by installation id
This commit is contained in:
@@ -215,6 +215,7 @@ def run_bootstrap(
|
||||
native: bool | None = None,
|
||||
progress: Callable[[str], None] | None = None,
|
||||
ipa_timeout_seconds: int = DEFAULT_IPA_TIMEOUT_SECONDS,
|
||||
install_id: str | None = None,
|
||||
) -> dict[str, Any]:
|
||||
tell = progress or (lambda _message: None)
|
||||
use_native = is_windows() if native is None else native
|
||||
@@ -240,6 +241,7 @@ def run_bootstrap(
|
||||
repo_root=repo_root,
|
||||
selected={BSIPA_PLUGIN_ID},
|
||||
require_bootstrap=False,
|
||||
install_id=install_id,
|
||||
)
|
||||
if not plan["changes"]:
|
||||
raise ValueError("BSIPA bootstrap plan has no changes")
|
||||
@@ -292,12 +294,14 @@ def run_bootstrap(
|
||||
"delta": delta,
|
||||
"health": {},
|
||||
}
|
||||
if install_id:
|
||||
state["installId"] = install_id
|
||||
if not use_native:
|
||||
state["proton"] = str(proton or _default_proton())
|
||||
save_bootstrap_state(state_root, instance, state)
|
||||
state["health"] = check_bsipa_health(instance_path, state_root, instance)
|
||||
save_bootstrap_state(state_root, instance, state)
|
||||
state["statePath"] = str(bootstrap_state_path(state_root, instance))
|
||||
save_bootstrap_state(state_root, instance, state, install_id=install_id)
|
||||
state["health"] = check_bsipa_health(instance_path, state_root, instance, install_id=install_id)
|
||||
save_bootstrap_state(state_root, instance, state, install_id=install_id)
|
||||
state["statePath"] = str(bootstrap_state_path(state_root, instance, install_id=install_id))
|
||||
if completed["timedOut"]:
|
||||
raise TimeoutError(f"IPA.exe -n timed out after {ipa_timeout_seconds}s; state written to {state['statePath']}")
|
||||
if completed["returncode"] != 0:
|
||||
@@ -319,11 +323,12 @@ def ensure_healthy_bootstrap(
|
||||
native: bool | None = None,
|
||||
progress: Callable[[str], None] | None = None,
|
||||
ipa_timeout_seconds: int = DEFAULT_IPA_TIMEOUT_SECONDS,
|
||||
install_id: str | None = None,
|
||||
) -> None:
|
||||
if not planning_requires_bootstrap(lockfile.plugins, selected_ids):
|
||||
return
|
||||
|
||||
health = check_bsipa_health(instance_path, state_root, instance)
|
||||
health = check_bsipa_health(instance_path, state_root, instance, install_id=install_id)
|
||||
if health["ok"]:
|
||||
return
|
||||
|
||||
@@ -341,8 +346,9 @@ def ensure_healthy_bootstrap(
|
||||
native=native,
|
||||
progress=progress,
|
||||
ipa_timeout_seconds=ipa_timeout_seconds,
|
||||
install_id=install_id,
|
||||
)
|
||||
|
||||
health = check_bsipa_health(instance_path, state_root, instance)
|
||||
health = check_bsipa_health(instance_path, state_root, instance, install_id=install_id)
|
||||
if not health["ok"]:
|
||||
raise ValueError(bootstrap_health_error(health))
|
||||
|
||||
Reference in New Issue
Block a user