fix: fix apt-cache show and use gcc 11 on Ubuntu 20

This commit is contained in:
Amin Yahyaabadi 2023-05-24 18:45:01 -07:00
parent fbb91d5a68
commit 9c18ad87a1
7 changed files with 15 additions and 9 deletions

View File

@ -12,6 +12,8 @@ ignorePaths:
words:
- aarch
- clangd
- Trofimovich
- cobertura
- aminya
- applellvm
- bazel

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -67,10 +67,14 @@ async function getAptArg(name: string, version: string | undefined) {
if (stdout.trim() !== "") {
return `${name}-${version}`
} else {
// check if apt-get show can find the version
const { stdout: showStdout } = await execa("apt-cache", ["show", `${name}=${version}`])
if (showStdout.trim() === "") {
return `${name}=${version}`
try {
// check if apt-get show can find the version
const { stdout: showStdout } = await execa("apt-cache", ["show", `${name}=${version}`])
if (showStdout.trim() === "") {
return `${name}=${version}`
}
} catch {
// ignore
}
warning(`Failed to install ${name} ${version} via apt, trying without version`)
}

View File

@ -36,7 +36,7 @@ export const DefaultVersions: Record<string, string> = {
export const DefaultLinuxVersion: Record<string, Record<number, string>> = {
gcc: {
22: "13",
20: "13",
20: "11",
18: "11",
16: "11",
14: "11",