Skip to content

Commit

Permalink
fix: fix apt-cache show and use gcc 11 on Ubuntu 20
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed May 25, 2023
1 parent fbb91d5 commit 9c18ad8
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
2 changes: 2 additions & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ignorePaths:
words:
- aarch
- clangd
- Trofimovich
- cobertura
- aminya
- applellvm
- bazel
Expand Down
2 changes: 1 addition & 1 deletion dist/node12/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/node12/setup-cpp.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/node16/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/node16/setup-cpp.js.map

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions src/utils/setup/setupAptPack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
}
Expand Down
2 changes: 1 addition & 1 deletion src/versions/default_versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9c18ad8

Please sign in to comment.