From 7fdcafd80517c9878f7cd4b8dc0ef296a6836070 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 16 Sep 2021 02:57:20 -0500 Subject: [PATCH] fix: set the sdk to macosx --- src/llvm/llvm.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/llvm/llvm.ts b/src/llvm/llvm.ts index 8f5b2f29..b9c7ce12 100644 --- a/src/llvm/llvm.ts +++ b/src/llvm/llvm.ts @@ -7,6 +7,7 @@ import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin import { extractExe, extractTarByExe } from "../utils/setup/extract" import { getSpecificVersionAndUrl, getVersions } from "../utils/setup/version" import { getExecOutput } from "@actions/exec" +import { existsSync } from "fs" //================================================ // Version @@ -268,9 +269,11 @@ export async function setupLLVM(version: string, directoryGiven?: string): Promi if (process.platform === "darwin") { try { - const xcrun = await getExecOutput("xcrun --sdk macos --show-sdk-path") + const xcrun = await getExecOutput("xcrun --sdk macosx --show-sdk-path") const sdkroot = xcrun.stdout || xcrun.stderr - core.exportVariable("SDKROOT", sdkroot) + if (existsSync(sdkroot)) { + core.exportVariable("SDKROOT", sdkroot) + } } catch (e) { core.error(e as Error | string) }