Skip to content

Commit 4b9980f

Browse files
committed
fix: add the llvm bin dir to path for brew
1 parent eab64e3 commit 4b9980f

File tree

6 files changed

+14
-7
lines changed

6 files changed

+14
-7
lines changed

dist/legacy/setup-cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/modern/setup-cpp.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/setup-brew/src/pack-install-dir.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export async function brewPackInstallDir(name: string, version: string | undefin
3636
async function getBrewPackPrefix(packArg: string) {
3737
try {
3838
const brewPath = getBrewBinPath()
39-
return (await execa(brewPath, ["--prefix", packArg], { stdio: ["pipe", "inherit", "inherit"] })).stdout
39+
return (await execa(brewPath, ["--prefix", packArg], { stdio: "pipe" })).stdout
4040
} catch {
4141
return undefined
4242
}

src/llvm/llvm_brew_installer.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { warning } from "ci-log"
2+
import { addPath } from "envosman"
23
import { installBrewPack } from "setup-brew"
4+
import { rcOptions } from "../cli-options.ts"
35
import { majorLLVMVersion } from "./utils.ts"
46

57
export function trySetupLLVMBrew(version: string, _setupDir: string, _arch: string) {
@@ -15,7 +17,12 @@ export function trySetupLLVMBrew(version: string, _setupDir: string, _arch: stri
1517
}
1618
}
1719

18-
export function setupLLVMBrew(version: string, _setupDir: string, _arch: string) {
20+
export async function setupLLVMBrew(version: string, _setupDir: string, _arch: string) {
1921
const majorVersion = majorLLVMVersion(version)
20-
return installBrewPack("llvm", `${majorVersion}`)
22+
const installInfo = await installBrewPack("llvm", `${majorVersion}`)
23+
24+
// add the bin directory to the PATH
25+
await addPath(installInfo.binDir, rcOptions)
26+
27+
return installInfo
2128
}

0 commit comments

Comments
 (0)