core: enable npm bin links on non-Windows platforms to allow plugin executables to work while keeping them disabled on Windows CI where symlink permissions are restricted

This commit is contained in:
Dax Raad 2026-03-09 23:37:58 -04:00
commit 0b5d54f2cb
2 changed files with 4 additions and 11 deletions

View file

@ -34,8 +34,6 @@ import { Account } from "@/account"
import { ConfigPaths } from "./paths" import { ConfigPaths } from "./paths"
import { Filesystem } from "@/util/filesystem" import { Filesystem } from "@/util/filesystem"
import { Npm } from "@/npm" import { Npm } from "@/npm"
import { BunProc } from "@/bun"
import { proxied } from "@/util/proxied"
export namespace Config { export namespace Config {
const ModelId = z.string().meta({ $ref: "https://models.dev/model-schema.json#/$defs/Model" }) const ModelId = z.string().meta({ $ref: "https://models.dev/model-schema.json#/$defs/Model" })
@ -289,14 +287,7 @@ export namespace Config {
// Install any additional dependencies defined in the package.json // Install any additional dependencies defined in the package.json
// This allows local plugins and custom tools to use external packages // This allows local plugins and custom tools to use external packages
await BunProc.run( await Npm.install(dir).catch((err) => {
[
"install",
// TODO: get rid of this case (see: https://github.com/oven-sh/bun/issues/19936)
...(proxied() || process.env.CI ? ["--no-cache"] : []),
],
{ cwd: dir },
).catch((err) => {
log.warn("failed to install dependencies", { dir, error: err }) log.warn("failed to install dependencies", { dir, error: err })
}) })
} }

View file

@ -84,9 +84,11 @@ export namespace Npm {
export async function install(dir: string) { export async function install(dir: string) {
log.info("installing dependencies", { dir }) log.info("installing dependencies", { dir })
// Disable binLinks on Windows CI where symlink permissions are restricted
const isWindowsCI = process.platform === "win32" && process.env.CI
const arb = new Arborist({ const arb = new Arborist({
path: dir, path: dir,
binLinks: false, binLinks: !isWindowsCI,
progress: false, progress: false,
savePrefix: "", savePrefix: "",
}) })