mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-10-13 07:47:46 +08:00
Merge pull request #14838 from jhapate0704/fix-14769-win-arm64-error
fix(cli): improve missing binary error message for Windows ARM64
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@kilocode/cli": patch
|
||||
---
|
||||
|
||||
Improve missing binary error message on Windows ARM64 to provide actionable workarounds (x64 emulation or WSL2).
|
||||
@@ -207,14 +207,25 @@ function findBinary(startDir) {
|
||||
}
|
||||
}
|
||||
|
||||
// kilocode_change start
|
||||
const resolved = envPath || (fs.existsSync(cached) ? cached : findBinary(scriptDir))
|
||||
if (!resolved) {
|
||||
console.error(
|
||||
"It seems that your package manager failed to install the right version of the Kilo CLI for your platform. You can try manually installing " +
|
||||
names.map((n) => `\"${n}\"`).join(" or ") +
|
||||
" package",
|
||||
)
|
||||
if (platform === "windows" && arch === "arm64") {
|
||||
console.error(
|
||||
"The Kilo CLI native binary for Windows ARM64 could not be found.\n" +
|
||||
"If the native package is unavailable, you can try downloading the pre-built x64 binary from the GitHub Releases page to run under Windows 11 emulation.\n" +
|
||||
"Alternatively, use WSL2 with the Linux ARM64 build."
|
||||
)
|
||||
} else {
|
||||
console.error(
|
||||
"It seems that your package manager failed to install the right version of the Kilo CLI for your platform.\n" +
|
||||
"You can try manually installing the " +
|
||||
names.map((n) => `"${n}"`).join(" or ") +
|
||||
" package, or download a pre-built binary from the GitHub Releases page."
|
||||
)
|
||||
}
|
||||
process.exit(1)
|
||||
}
|
||||
// kilocode_change end
|
||||
|
||||
run(resolved, resolved === cached ? () => findBinary(scriptDir) : undefined) // kilocode_change - preserve cached binary fallback
|
||||
|
||||
@@ -207,11 +207,13 @@ function main() {
|
||||
}
|
||||
}
|
||||
|
||||
// kilocode_change start
|
||||
throw new Error(
|
||||
`It seems your package manager failed to install the right Kilo CLI package. Try manually installing ${packageNames()
|
||||
.map((name) => JSON.stringify(name))
|
||||
.join(" or ")}.`,
|
||||
.join(" or ")}. Or download the pre-built binary from the GitHub Releases page.`,
|
||||
)
|
||||
// kilocode_change end
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -67,7 +67,9 @@ const trace = { probes: [], spawns: [], signals: [] }
|
||||
const signals = ["SIGINT", "SIGTERM", "SIGHUP"]
|
||||
const listeners = () => signals.map((signal) => process.listenerCount(signal))
|
||||
os.platform = () => "win32"
|
||||
os.arch = () => "x64"
|
||||
// kilocode_change start
|
||||
os.arch = () => input.arch ?? "x64"
|
||||
// kilocode_change end
|
||||
os.hostname = () => input.host ?? "test-host"
|
||||
os.release = () => "10.0.26100"
|
||||
os.cpus = () => [{ model: "test CPU" }]
|
||||
@@ -242,4 +244,28 @@ describe("npm launcher startup", () => {
|
||||
expect(await Bun.file(join(root, "kilo", "bin", "windows-avx2.json")).exists()).toBe(true)
|
||||
expect((await item.run({ cache })).probes).toEqual([])
|
||||
})
|
||||
|
||||
// kilocode_change start
|
||||
test("prints helpful emulation message for missing binary on Windows ARM64", async () => {
|
||||
await using item = await fixture()
|
||||
await rm(item.optimized)
|
||||
await rm(item.baseline)
|
||||
const pkg = join(item.root, "node_modules", "@kilocode", "cli")
|
||||
const wrapper = join(pkg, "bin", "kilo")
|
||||
const preload = join(item.root, "preload.cjs")
|
||||
|
||||
// Run the script directly to capture stderr, since findBinary will fail and call process.exit(1)
|
||||
const proc = Bun.spawnSync([node, "--require", preload, wrapper], {
|
||||
cwd: item.root,
|
||||
env: {
|
||||
KILO_STARTUP_TEST: JSON.stringify({ arch: "arm64" }),
|
||||
KILO_STARTUP_LOG: item.root + "/trace.json",
|
||||
},
|
||||
})
|
||||
const stderr = proc.stderr.toString()
|
||||
expect(proc.exitCode).toBe(1)
|
||||
expect(stderr).toContain("The Kilo CLI native binary for Windows ARM64 could not be found.")
|
||||
expect(stderr).toContain("GitHub Releases page to run under Windows 11 emulation")
|
||||
})
|
||||
// kilocode_change end
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user