Skip to content

Commit a654826

Browse files
committed
fix: allow parallel apt calls in the llvm installer
1 parent a93caaa commit a654826

File tree

8 files changed

+15
-12
lines changed

8 files changed

+15
-12
lines changed

dist/actions/setup-cpp.js

Lines changed: 2 additions & 1 deletion
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: 2 additions & 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.js

Lines changed: 2 additions & 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.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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { execa } from "execa"
44
import { chmod, readFile, writeFile } from "fs/promises"
55
import { DEFAULT_TIMEOUT } from "../installTool"
66
import { addPath } from "../utils/env/addEnv"
7-
import { hasNala, isPackageRegexInstalled, setupAptPack } from "../utils/setup/setupAptPack"
7+
import { aptTimeout, hasNala, isPackageRegexInstalled, setupAptPack } from "../utils/setup/setupAptPack"
88
import type { InstallationInfo } from "../utils/setup/setupBin"
99

1010
export enum LLVMPackages {
@@ -70,16 +70,16 @@ function nonInteractiveScript(script: string) {
7070
// make the scirpt non-interactive and fix broken packages
7171
return script.replace(
7272
/add-apt-repository "\${REPO_NAME}"/g,
73-
// eslint-disable-next-line no-template-curly-in-string
74-
"add-apt-repository -y \"${REPO_NAME}\"",
73+
`add-apt-repository -y -n "\${REPO_NAME}"
74+
apt-get update -o ${aptTimeout} -y`,
7575
)
7676
}
7777

7878
async function removeConflictingPackages(givenScript: string) {
7979
// fix conflicts between libclang-rt and libclang
8080
let script = givenScript.replace(
8181
/apt-get install -y/g,
82-
"apt-get install -o Dpkg::Options::=\"--force-overwrite\" -y --fix-broken",
82+
`apt-get install -o Dpkg::Options::="--force-overwrite" -o ${aptTimeout} -y --fix-broken`,
8383
)
8484

8585
// check if these are installed and if so, remove them from the script as they conflict

src/utils/setup/setupAptPack.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let didUpdate: boolean = false
1414
let didInit: boolean = false
1515

1616
// wait up to 300 seconds if the apt-get lock is held
17-
const aptTimeout = "DPkg::Lock::Timeout=300"
17+
export const aptTimeout = "DPkg::Lock::Timeout=300"
1818

1919
export type AptPackage = {
2020
name: string
@@ -177,7 +177,7 @@ export function hasNala() {
177177
return which.sync("nala", { nothrow: true }) !== null
178178
}
179179

180-
function getApt() {
180+
export function getApt() {
181181
let apt: string
182182
if (hasNala()) {
183183
apt = "nala"

0 commit comments

Comments
 (0)