Skip to content

Commit b8c9910

Browse files
committed
fix: fix gcc installation on Ubuntu Arm64
1 parent d1a8e5e commit b8c9910

File tree

5 files changed

+52
-49
lines changed

5 files changed

+52
-49
lines changed

dist/legacy/setup-cpp.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.mjs

+1-1
Large diffs are not rendered by default.

dist/modern/setup-cpp.mjs.map

+1-1
Large diffs are not rendered by default.

src/gcc/gcc.ts

+48-45
Original file line numberDiff line numberDiff line change
@@ -37,56 +37,59 @@ export async function setupGcc(version: string, setupDir: string, arch: string,
3737
break
3838
}
3939
case "linux": {
40-
if (arch === "x64") {
41-
if (isArch()) {
42-
installationInfo = await setupPacmanPack("gcc", version)
43-
} else if (hasDnf()) {
44-
installationInfo = await setupDnfPack([
45-
{ name: "gcc", version },
46-
{ name: "gcc-c++", version },
47-
{ name: "libstdc++-devel" },
48-
])
49-
} else if (isUbuntu()) {
50-
if (version === "") {
51-
// the default version
52-
installationInfo = await installAptPack([{ name: "gcc" }, { name: "g++" }])
53-
} else {
54-
// add the PPA for access to more versions
55-
installationInfo = await installAptPack([
56-
{
57-
name: "gcc",
58-
version,
59-
repository: "ppa:ubuntu-toolchain-r/test",
60-
key: { key: "1E9377A2BA9EF27F", fileName: "ubuntu-toolchain-r-test.gpg" },
61-
},
62-
{
63-
name: "g++",
64-
version,
65-
repository: "ppa:ubuntu-toolchain-r/test",
66-
key: { key: "1E9377A2BA9EF27F", fileName: "ubuntu-toolchain-r-test.gpg" },
67-
},
68-
])
69-
}
70-
}
71-
} else {
72-
info(`Install g++-multilib because gcc for ${arch} was requested`)
73-
if (isArch()) {
74-
installationInfo = await setupPacmanPack("gcc-multilib", version)
75-
} else if (isUbuntu()) {
76-
if (version === "") {
77-
// the default version
78-
installationInfo = await installAptPack([{ name: "gcc-multilib" }])
79-
} else {
80-
// add the PPA for access to more versions
81-
installationInfo = await installAptPack([{
82-
name: "gcc-multilib",
40+
if (isArch()) {
41+
installationInfo = await setupPacmanPack("gcc", version)
42+
} else if (hasDnf()) {
43+
installationInfo = await setupDnfPack([
44+
{ name: "gcc", version },
45+
{ name: "gcc-c++", version },
46+
{ name: "libstdc++-devel" },
47+
])
48+
} else if (isUbuntu()) {
49+
if (version === "") {
50+
// the default version
51+
installationInfo = await installAptPack([{ name: "gcc" }, { name: "g++" }])
52+
} else {
53+
// add the PPA for access to more versions
54+
installationInfo = await installAptPack([
55+
{
56+
name: "gcc",
57+
version,
58+
repository: "ppa:ubuntu-toolchain-r/test",
59+
key: { key: "1E9377A2BA9EF27F", fileName: "ubuntu-toolchain-r-test.gpg" },
60+
},
61+
{
62+
name: "g++",
8363
version,
8464
repository: "ppa:ubuntu-toolchain-r/test",
8565
key: { key: "1E9377A2BA9EF27F", fileName: "ubuntu-toolchain-r-test.gpg" },
86-
}])
87-
}
66+
},
67+
])
8868
}
8969
}
70+
// if (arch !== "x64") {
71+
// try {
72+
// info(`Install g++-multilib because gcc for ${arch} was requested`)
73+
// if (isArch()) {
74+
// installationInfo = await setupPacmanPack("gcc-multilib", version)
75+
// } else if (isUbuntu()) {
76+
// if (version === "") {
77+
// // the default version
78+
// installationInfo = await installAptPack([{ name: "gcc-multilib" }])
79+
// } else {
80+
// // add the PPA for access to more versions
81+
// installationInfo = await installAptPack([{
82+
// name: "gcc-multilib",
83+
// version,
84+
// repository: "ppa:ubuntu-toolchain-r/test",
85+
// key: { key: "1E9377A2BA9EF27F", fileName: "ubuntu-toolchain-r-test.gpg" },
86+
// }])
87+
// }
88+
// }
89+
// } catch (err) {
90+
// info(`Failed to install gcc-multilib ${err}\nSkipping the dependency`)
91+
// }
92+
// }
9093
break
9194
}
9295
// TODO support bare-metal (need to support passing it as the input)

0 commit comments

Comments
 (0)