diff --git a/CHANGELOG.md b/CHANGELOG.md index 333b2c2..552153e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Apple Silicon release validation now retries the macOS system Python from a + clean virtual environment when a preferred Homebrew Python leaves a partial + one behind, so the pinned Mnemosyne test runtime can be prepared reliably. - Fresh hosts now open the 1Helm server while the optional Mnemosyne Python and embedding runtime is prepared in the background, instead of making first launch and health checks wait on virtual-environment package installs. diff --git a/scripts/run-test-suite.mjs b/scripts/run-test-suite.mjs index 4cdc567..7389555 100644 --- a/scripts/run-test-suite.mjs +++ b/scripts/run-test-suite.mjs @@ -23,6 +23,10 @@ if (!runtime) { const venv = join(disposableRoot, "venv"); const installers = [...new Set([process.env.PYTHON || "", "python3", ...(process.platform === "darwin" ? ["/usr/bin/python3"] : [])].filter(Boolean))]; for (const installer of installers) { + // A failed interpreter can leave a partial venv whose Python symlinks + // poison the next fallback attempt. Each interpreter must start from its + // own clean disposable runtime, matching the production bootstrap. + if (existsSync(venv)) rmSync(venv, { recursive: true, force: true }); if (spawnSync(installer, ["-m", "venv", venv], { stdio: "ignore" }).status !== 0) continue; const candidate = join(venv, pythonName); const installed = spawnSync(candidate, ["-m", "pip", "install", "--disable-pip-version-check", "--no-input", "--ignore-requires-python", `mnemosyne-memory==${version}`], { stdio: "inherit" }); diff --git a/test/desktop.mjs b/test/desktop.mjs index 15abfc2..38059a2 100644 --- a/test/desktop.mjs +++ b/test/desktop.mjs @@ -147,6 +147,7 @@ test("desktop entrypoint keeps the renderer sandboxed and data on the Mac", asyn assert.match(memoryRuntime, /export function prepareMnemosyneRuntime\(\): Promise/, "fresh-host memory installation is asynchronous instead of blocking application startup"); assert.match(memoryRuntime, /export function cancelMnemosyneRuntimePreparation\(\)/, "host shutdown cancels an in-flight app-managed memory installation"); assert.match(testRunner, /MNEMOSYNE_PYTHON: runtime/, "the full test suite shares one explicit pinned memory runtime instead of racing app-start installers"); + assert.match(testRunner, /if \(existsSync\(venv\)\) rmSync\(venv, \{ recursive: true, force: true \}\);[\s\S]*spawnSync\(installer/, "each test-runtime fallback starts clean after a preferred Python leaves a partial venv"); assert.match(feedbackBrowser, /skip: executablePath \? false :/, "the Feedback browser contract does not hang a Chrome-free release runner"); assert.match(terminalBrowser, /HELM_CHANNEL_COMPUTER_BACKEND: "native"/, "the terminal browser contract uses the explicit development backend on CI hosts without an installed LXC runtime"); const serverRuntime = await readFile(join(root, "src", "server", "index.ts"), "utf8");