Skip to content

Commit 52047bd

Browse files
committed
fix: add timeout for the LLVM installer call
1 parent d7596dd commit 52047bd

File tree

10 files changed

+19
-15
lines changed

10 files changed

+19
-15
lines changed

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ inputs:
8686
required: false
8787
timeout:
8888
description: "The timeout for installation of one tool (in minutes)."
89-
default: "10"
89+
default: "20"
9090
required: false
9191

9292
runs:

dist/actions/setup-cpp.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/actions/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/legacy/setup-cpp.js

Lines changed: 3 additions & 3 deletions
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.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/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.

src/llvm/llvm_installer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { hasNala, isPackageInstalled, setupAptPack } from "../utils/setup/setupA
55
import { InstallationInfo } from "../utils/setup/setupBin"
66
import { promises } from "fs"
77
import { info } from "console"
8+
import { DEFAULT_TIMEOUT } from "../tool"
89
const { readFile, writeFile, chmod } = promises
910

1011
export async function setupLLVMApt(majorVersion: number): Promise<InstallationInfo> {
@@ -19,6 +20,7 @@ export async function setupLLVMApt(majorVersion: number): Promise<InstallationIn
1920
await execRoot("bash", ["/tmp/llvm-setup-cpp.sh", `${majorVersion}`, "all"], {
2021
stdio: "inherit",
2122
shell: true,
23+
timeout: DEFAULT_TIMEOUT,
2224
})
2325

2426
await addPath(`${installationFolder}/bin`)

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ async function main(args: string[]): Promise<number> {
9696
setupCppDir,
9797
successMessages,
9898
errorMessages,
99-
parseFloat(opts.timeout ?? "10"),
99+
parseFloat(opts.timeout ?? "20") * 60 * 1000,
100100
)
101101
time2 = Date.now()
102102
info(`took ${timeFormatter.format(time1, time2) || "0 seconds"}`)

src/tool.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ export type ToolName = keyof typeof setups
6969
/** The tools that can be installed */
7070
export const tools = Object.keys(setups) as Array<ToolName>
7171

72+
export const DEFAULT_TIMEOUT = 20 * 60 * 1000 // 20 minutes
73+
7274
export async function installTool(
7375
tool: ToolName,
7476
version: string,
@@ -77,7 +79,7 @@ export async function installTool(
7779
setupCppDir: string,
7880
successMessages: string[],
7981
errorMessages: string[],
80-
timeout: number = 0.1,
82+
timeout: number = DEFAULT_TIMEOUT,
8183
) {
8284
startGroup(`Installing ${tool} ${version}`)
8385
let hasLLVM = false

0 commit comments

Comments
 (0)