From 3af9de5d555f6d3d5048592df8100314593d9bd3 Mon Sep 17 00:00:00 2001 From: danielmeppiel Date: Fri, 16 Oct 2026 15:01:41 +0200 Subject: [PATCH] fix(runtime): surface pip bootstrap errors in llm runtime setup `python3 -m venv` captures ensurepip output, so `apm runtime setup llm` failures only reported "returned non-zero exit status 1". Create the venv without pip and bootstrap pip as a visible step that names the python3 in use, so the real cause reaches users and the release-gate CI log. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 761bf207-57da-41d0-bd3f-ffecbb97b83a --- scripts/runtime/setup-llm.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/runtime/setup-llm.sh b/scripts/runtime/setup-llm.sh index a3fc08943e..60d8649ff0 100755 --- a/scripts/runtime/setup-llm.sh +++ b/scripts/runtime/setup-llm.sh @@ -41,9 +41,20 @@ setup_llm() { exit 1 fi - # Create virtual environment for LLM - log_info "Creating Python virtual environment for LLM..." - python3 -m venv "$llm_venv" + # Create virtual environment for LLM. Bootstrap pip as a separate step: + # `python3 -m venv` hides ensurepip's output, so a failure would only + # report "exit status 1" without the reason. + local python3_bin + python3_bin="$(command -v python3)" + log_info "Creating Python virtual environment for LLM (using $python3_bin)..." + if ! python3 -m venv --without-pip "$llm_venv"; then + log_error "Could not create the LLM virtual environment at $llm_venv." + exit 1 + fi + if ! "$llm_venv/bin/python" -m ensurepip --upgrade --default-pip; then + log_error "Could not bootstrap pip into $llm_venv (python3: $python3_bin)." + exit 1 + fi # Install LLM in virtual environment log_info "Installing LLM library..."