fix: add the llvm bin dir to path for brew

This commit is contained in:
Amin Yahyaabadi 2025-03-09 15:28:52 -07:00
parent eab64e395d
commit 4b9980f829
6 changed files with 14 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -36,7 +36,7 @@ export async function brewPackInstallDir(name: string, version: string | undefin
async function getBrewPackPrefix(packArg: string) {
try {
const brewPath = getBrewBinPath()
return (await execa(brewPath, ["--prefix", packArg], { stdio: ["pipe", "inherit", "inherit"] })).stdout
return (await execa(brewPath, ["--prefix", packArg], { stdio: "pipe" })).stdout
} catch {
return undefined
}

View File

@ -1,5 +1,7 @@
import { warning } from "ci-log"
import { addPath } from "envosman"
import { installBrewPack } from "setup-brew"
import { rcOptions } from "../cli-options.ts"
import { majorLLVMVersion } from "./utils.ts"
export function trySetupLLVMBrew(version: string, _setupDir: string, _arch: string) {
@ -15,7 +17,12 @@ export function trySetupLLVMBrew(version: string, _setupDir: string, _arch: stri
}
}
export function setupLLVMBrew(version: string, _setupDir: string, _arch: string) {
export async function setupLLVMBrew(version: string, _setupDir: string, _arch: string) {
const majorVersion = majorLLVMVersion(version)
return installBrewPack("llvm", `${majorVersion}`)
const installInfo = await installBrewPack("llvm", `${majorVersion}`)
// add the bin directory to the PATH
await addPath(installInfo.binDir, rcOptions)
return installInfo
}