Skip to content

Commit dac7231

Browse files
committed
feat: parallelize the apt package installation chunks
1 parent eea16aa commit dac7231

File tree

21 files changed

+70
-57
lines changed

21 files changed

+70
-57
lines changed

dist/node12/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/node12/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/node16/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/node16/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/bazel/bazel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export async function setupBazel(version: string, _setupDir: string, _arch: stri
3636
"-c",
3737
`echo "deb [arch=amd64 signed-by=${keyFileName}] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list`,
3838
])
39-
return setupAptPack("bazel", version, [], true)
39+
return setupAptPack([{ name: "bazel", version }], true)
4040
}
4141
throw new Error(`Unsupported linux distribution`)
4242
}

src/ccache/ccache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function setupCcache(version: string, _setupDir: string, _arch: string) {
2222
} else if (hasDnf()) {
2323
return setupDnfPack("ccache", version)
2424
} else if (isUbuntu()) {
25-
return setupAptPack("ccache", version)
25+
return setupAptPack([{ name: "ccache", version }])
2626
}
2727
throw new Error(`Unsupported linux distribution`)
2828
}

src/cppcheck/cppcheck.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function setupCppcheck(version: string | undefined, _setupDir: stri
2525
} else if (hasDnf()) {
2626
return setupDnfPack("ccache", version)
2727
} else if (isUbuntu()) {
28-
return setupAptPack("cppcheck", version)
28+
return setupAptPack([{ name: "cppcheck", version }])
2929
}
3030
throw new Error(`Unsupported linux distribution`)
3131
}

src/doxygen/doxygen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,18 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
6767
} else if (hasDnf()) {
6868
return setupDnfPack("doxygen", version)
6969
} else if (isUbuntu()) {
70-
installationInfo = await setupAptPack("doxygen", version)
70+
installationInfo = await setupAptPack([{ name: "doxygen", version }])
7171
} else {
7272
throw new Error(`Unsupported linux distributions`)
7373
}
7474
} else if (isUbuntu()) {
7575
try {
7676
// doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself
7777
installationInfo = await setupBin("doxygen", version, getDoxygenPackageInfo, setupDir, arch)
78-
await setupAptPack("libclang-cpp9")
78+
await setupAptPack([{ name: "libclang-cpp9" }])
7979
} catch (err) {
8080
notice(`Failed to download doxygen binary. ${err}. Falling back to apt-get.`)
81-
installationInfo = await setupAptPack("doxygen", undefined)
81+
installationInfo = await setupAptPack([{ name: "doxygen" }])
8282
}
8383
} else {
8484
throw new Error(`Unsupported linux distributions`)

src/gcc/gcc.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,17 @@ export async function setupGcc(version: string, setupDir: string, arch: string)
9696
setupDnfPack("gcc-c++", version)
9797
setupDnfPack("libstdc++-devel", undefined)
9898
} else if (isUbuntu()) {
99-
await setupAptPack("gcc", version, ["ppa:ubuntu-toolchain-r/test"])
100-
installationInfo = await setupAptPack("g++", version, [])
99+
installationInfo = await setupAptPack([
100+
{ name: "gcc", version, repositories: ["ppa:ubuntu-toolchain-r/test"] },
101+
{ name: "g++", version, repositories: ["ppa:ubuntu-toolchain-r/test"] },
102+
])
101103
}
102104
} else {
103105
info(`Install g++-multilib because gcc for ${arch} was requested`)
104106
if (isArch()) {
105107
setupPacmanPack("gcc-multilib", version)
106108
} else if (isUbuntu()) {
107-
await setupAptPack("gcc-multilib", version, ["ppa:ubuntu-toolchain-r/test"])
109+
await setupAptPack([{ name: "gcc-multilib", version, repositories: ["ppa:ubuntu-toolchain-r/test"] }])
108110
}
109111
}
110112
break

src/graphviz/graphviz.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function setupGraphviz(version: string, _setupDir: string, _arch: s
2525
} else if (hasDnf()) {
2626
return setupDnfPack("graphviz", version)
2727
} else if (isUbuntu()) {
28-
return setupAptPack("graphviz", version)
28+
return setupAptPack([{ name: "graphviz", version }])
2929
}
3030
throw new Error(`Unsupported linux distribution`)
3131
}

0 commit comments

Comments
 (0)