fix(installer): skip llama postinstall in Windows source installs

This commit is contained in:
Vincent Koc
2026-06-23 06:06:19 +08:00
parent adc4d9fe02
commit ea9065bc68
2 changed files with 5 additions and 0 deletions

View File

@@ -1262,6 +1262,7 @@ function Install-OpenClawFromGit {
$prevPnpmWorkspaceConcurrency = $env:PNPM_CONFIG_WORKSPACE_CONCURRENCY
$prevPnpmVerifyDepsBeforeRun = $env:PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN
$prevPnpmSideEffectsCache = $env:PNPM_CONFIG_SIDE_EFFECTS_CACHE
$prevNodeLlamaPostinstall = $env:NODE_LLAMA_CPP_POSTINSTALL
$prevNodeOptions = $env:NODE_OPTIONS
$pnpmCommand = Get-PnpmCommandPath
if (-not $pnpmCommand) {
@@ -1273,6 +1274,7 @@ function Install-OpenClawFromGit {
$env:PNPM_CONFIG_WORKSPACE_CONCURRENCY = "1"
$env:PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN = "false"
$env:PNPM_CONFIG_SIDE_EFFECTS_CACHE = "false"
$env:NODE_LLAMA_CPP_POSTINSTALL = "skip"
$pushedRepoLocation = $false
try {
Push-Location -LiteralPath $RepoDir
@@ -1320,6 +1322,7 @@ function Install-OpenClawFromGit {
$env:PNPM_CONFIG_WORKSPACE_CONCURRENCY = $prevPnpmWorkspaceConcurrency
$env:PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN = $prevPnpmVerifyDepsBeforeRun
$env:PNPM_CONFIG_SIDE_EFFECTS_CACHE = $prevPnpmSideEffectsCache
$env:NODE_LLAMA_CPP_POSTINSTALL = $prevNodeLlamaPostinstall
$env:NODE_OPTIONS = $prevNodeOptions
}

View File

@@ -363,6 +363,7 @@ describe("install.ps1 failure handling", () => {
expect(gitInstallBody).toContain('$env:PNPM_CONFIG_WORKSPACE_CONCURRENCY = "1"');
expect(gitInstallBody).toContain('$env:PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN = "false"');
expect(gitInstallBody).toContain('$env:PNPM_CONFIG_SIDE_EFFECTS_CACHE = "false"');
expect(gitInstallBody).toContain('$env:NODE_LLAMA_CPP_POSTINSTALL = "skip"');
expect(gitInstallBody).toContain("$installSucceeded = ($LASTEXITCODE -eq 0)");
expect(gitInstallBody).toContain("clearing node_modules and retrying once");
expect(gitInstallBody).toContain("Remove-Item -Recurse -Force node_modules");
@@ -382,6 +383,7 @@ describe("install.ps1 failure handling", () => {
expect(gitInstallBody).toContain(
"$env:PNPM_CONFIG_WORKSPACE_CONCURRENCY = $prevPnpmWorkspaceConcurrency",
);
expect(gitInstallBody).toContain("$env:NODE_LLAMA_CPP_POSTINSTALL = $prevNodeLlamaPostinstall");
expect(gitInstallBody).toContain("Add-ToUserPath $binDir");
expect(gitInstallBody).toContain('Write-Host "[!] pnpm build failed for the Git checkout"');
expect(gitInstallBody).toContain('$entryPath = Join-Path $RepoDir "dist\\\\entry.js"');