fix(updater): bootstrap fresh venv with deps; rebuild self-update argv from env

- _run_pip: on first venv use, install decnet with its full dep tree so the
  bootstrapped environment actually has typer/fastapi/uvicorn. Subsequent
  updates keep --no-deps for a near-no-op refresh.
- run_update_self: do not reuse sys.argv to re-exec the updater. Inside the
  live process, sys.argv is the uvicorn subprocess invocation (--ssl-keyfile
  etc.), which 'decnet updater' CLI rejects. Reconstruct the operator-visible
  command from env vars set by updater.server.run.
This commit is contained in:
2026-04-18 23:51:41 -04:00
parent ebeaf08a49
commit 40d3e86e55
2 changed files with 26 additions and 5 deletions

View File

@@ -47,6 +47,10 @@ def run(
os.environ["DECNET_UPDATER_INSTALL_DIR"] = str(install_dir)
os.environ["DECNET_UPDATER_UPDATER_DIR"] = str(install_dir / "updater")
os.environ["DECNET_UPDATER_AGENT_DIR"] = str(agent_dir)
# Needed by run_update_self to rebuild the updater's launch argv.
os.environ["DECNET_UPDATER_BUNDLE_DIR"] = str(updater_dir)
os.environ["DECNET_UPDATER_HOST"] = str(host)
os.environ["DECNET_UPDATER_PORT"] = str(port)
keyfile = updater_dir / "updater.key"
certfile = updater_dir / "updater.crt"