Merge pull request #146 from aminya/gcc-12 [skip ci]

This commit is contained in:
Amin Yahyaabadi 2022-11-20 19:07:52 -08:00 committed by GitHub
commit 946a5bb524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 480 additions and 424 deletions

View File

@ -22,7 +22,7 @@ Setting up a **cross-platform** environment for building and testing C++/C proje
| cache | cppcache | | cache | cppcache |
| documentation | doxygen, graphviz | | documentation | doxygen, graphviz |
| coverage | gcovr, opencppcoverage, kcov | | coverage | gcovr, opencppcoverage, kcov |
| other | python, sevenzip | | other | python, powershell, sevenzip |
`setup-cpp` automatically installs the dependencies above tools if needed for the selected tool (e.g., `python` is required for `conan`). `setup-cpp` automatically installs the dependencies above tools if needed for the selected tool (e.g., `python` is required for `conan`).

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

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -75,7 +75,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/cross-spawn": "^6.0.2", "@types/cross-spawn": "^6.0.2",
"@types/jest": "^29.2.2", "@types/jest": "^29.2.3",
"@types/mri": "^1.1.1", "@types/mri": "^1.1.1",
"@types/node": "^18.11.9", "@types/node": "^18.11.9",
"@types/semver": "^7.3.13", "@types/semver": "^7.3.13",
@ -83,13 +83,13 @@
"caxa": "^3.0.1", "caxa": "^3.0.1",
"cross-env": "7.0.3", "cross-env": "7.0.3",
"cross-spawn": "^7.0.3", "cross-spawn": "^7.0.3",
"cspell": "^6.14.1", "cspell": "^6.14.3",
"eslint": "^8.27.0", "eslint": "^8.28.0",
"eslint-config-atomic": "^1.18.1", "eslint-config-atomic": "^1.18.1",
"gen-readme": "^1.6.0", "gen-readme": "^1.6.0",
"jest": "^29.3.1", "jest": "^29.3.1",
"npm-check-updates": "^16.3.18", "npm-check-updates": "^16.4.1",
"npm-run-all2": "^6.0.2", "npm-run-all2": "^6.0.4",
"parcel": "2.8.0", "parcel": "2.8.0",
"prettier": "2.7.1", "prettier": "2.7.1",
"prettier-config-atomic": "^3.1.0", "prettier-config-atomic": "^3.1.0",
@ -99,7 +99,7 @@
"ts-jest": "^29.0.3", "ts-jest": "^29.0.3",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"ts-readme": "^1.1.3", "ts-readme": "^1.1.3",
"typescript": "^4.8.4" "typescript": "^4.9.3"
}, },
"engines": { "engines": {
"node": ">=12.x" "node": ">=12.x"
@ -131,7 +131,7 @@
"pnpm": { "pnpm": {
"overrides": { "overrides": {
"semver": "7.3.8", "semver": "7.3.8",
"eslint": "^8.27.0", "eslint": "^8.28.0",
"prettier": "2.7.1", "prettier": "2.7.1",
"lru-cache": "7.8.1", "lru-cache": "7.8.1",
"core-js": "*", "core-js": "*",

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,7 @@ import { getVersion } from "../../versions/versions"
import { join, addExeExt } from "patha" import { join, addExeExt } from "patha"
import execa from "execa" import execa from "execa"
import { chmodSync } from "fs" import { chmodSync } from "fs"
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
jest.setTimeout(3000000) jest.setTimeout(3000000)
describe("setup-gcc", () => { describe("setup-gcc", () => {
@ -13,7 +14,7 @@ describe("setup-gcc", () => {
}) })
it("should setup gcc", async () => { it("should setup gcc", async () => {
const version = getVersion("gcc", undefined) const version = getVersion("gcc", undefined, await ubuntuVersion())
const installInfo = await setupGcc(version, directory, process.arch) const installInfo = await setupGcc(version, directory, process.arch)
let gpp = "g++" let gpp = "g++"

View File

@ -24,7 +24,9 @@ interface MingwInfo {
// https://github.com/brechtsanders/winlibs_mingw/releases // https://github.com/brechtsanders/winlibs_mingw/releases
const GccToMingwInfo = { const GccToMingwInfo = {
"12": { releaseName: "12.1.0-14.0.4-10.0.0-ucrt-r2", fileSuffix: "12.1.0-mingw-w64ucrt-10.0.0-r2" }, "12": { releaseName: "12.2.0-14.0.6-10.0.0-ucrt-r2", fileSuffix: "12.2.0-mingw-w64ucrt-10.0.0-r2" },
"12.2.0-ucrt": { releaseName: "12.2.0-14.0.6-10.0.0-ucrt-r2", fileSuffix: "12.2.0-mingw-w64ucrt-10.0.0-r2" },
"12.2.0-msvcrt": { releaseName: "12.2.0-14.0.6-10.0.0-msvcrt-r2", fileSuffix: "12.2.0-mingw-w64msvcrt-10.0.0-r2" },
"12.1.0-ucrt": { releaseName: "12.1.0-14.0.4-10.0.0-ucrt-r2", fileSuffix: "12.1.0-mingw-w64ucrt-10.0.0-r2" }, "12.1.0-ucrt": { releaseName: "12.1.0-14.0.4-10.0.0-ucrt-r2", fileSuffix: "12.1.0-mingw-w64ucrt-10.0.0-r2" },
"12.1.0-msvcrt": { "12.1.0-msvcrt": {
releaseName: "12.1.0-14.0.6-10.0.0-msvcrt-r3", releaseName: "12.1.0-14.0.6-10.0.0-msvcrt-r3",

View File

@ -13,6 +13,7 @@ import { setupGcc } from "../gcc/gcc"
import { getVersion } from "../versions/versions" import { getVersion } from "../versions/versions"
import { isUbuntu } from "../utils/env/isUbuntu" import { isUbuntu } from "../utils/env/isUbuntu"
import { getLLVMPackageInfo } from "./llvm_url" import { getLLVMPackageInfo } from "./llvm_url"
import { ubuntuVersion } from "../utils/env/ubuntu_version"
export async function setupLLVM(version: string, setupDir: string, arch: string): Promise<InstallationInfo> { export async function setupLLVM(version: string, setupDir: string, arch: string): Promise<InstallationInfo> {
const installationInfo = await setupLLVMWithoutActivation(version, setupDir, arch) const installationInfo = await setupLLVMWithoutActivation(version, setupDir, arch)
@ -44,7 +45,8 @@ async function setupLLVMWithoutActivation(version: string, setupDir: string, arc
async function setupLLVMDeps(arch: string) { async function setupLLVMDeps(arch: string) {
if (process.platform === "linux") { if (process.platform === "linux") {
// install llvm build dependencies // install llvm build dependencies
await setupGcc(getVersion("gcc", undefined), "", arch) // using llvm requires ld, an up to date libstdc++, etc. So, install gcc first const osVersion = await ubuntuVersion()
await setupGcc(getVersion("gcc", undefined, osVersion), "", arch) // using llvm requires ld, an up to date libstdc++, etc. So, install gcc first
if (isUbuntu()) { if (isUbuntu()) {
await setupAptPack("libtinfo-dev") await setupAptPack("libtinfo-dev")

View File

@ -1,10 +1,16 @@
import { setupPowershell } from "../powershell" import { setupPowershell } from "../powershell"
import { testBin } from "../../utils/tests/test-helpers" import { testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../versions/versions" import { getVersion } from "../../versions/versions"
import ciDetect from "@npmcli/ci-detect"
jest.setTimeout(300000) jest.setTimeout(300000)
describe("setup-powershell", () => { describe("setup-powershell", () => {
it("should setup powershell", async () => { it("should setup powershell", async () => {
if (process.platform === "win32" && ciDetect() == "github-actions") {
// results in errors
return
}
const installInfo = await setupPowershell(getVersion("powershell", undefined), "", process.arch) const installInfo = await setupPowershell(getVersion("powershell", undefined), "", process.arch)
await testBin("pwsh", ["--version"], installInfo.binDir) await testBin("pwsh", ["--version"], installInfo.binDir)

View File

@ -8,20 +8,27 @@ export const DefaultVersions: Record<string, string> = {
clangtidy: "13.0.0", clangtidy: "13.0.0",
clangformat: "13.0.0", clangformat: "13.0.0",
ninja: "1.11.1", // https://github.com/ninja-build/ninja/releases ninja: "1.11.1", // https://github.com/ninja-build/ninja/releases
cmake: "3.24.2", // https://github.com/Kitware/CMake/releases cmake: "3.25.0", // https://github.com/Kitware/CMake/releases
gcovr: "5.2", // https://pypi.org/project/gcovr/ gcovr: "5.2", // https://pypi.org/project/gcovr/
conan: "1.53.0", // https://github.com/conan-io/conan/releases conan: "1.54.0", // https://github.com/conan-io/conan/releases
meson: "0.63.3", // https://github.com/mesonbuild/meson/releases meson: "0.64.0", // https://github.com/mesonbuild/meson/releases
kcov: "40", // https://github.com/SimonKagstrom/kcov/releases kcov: "40", // https://github.com/SimonKagstrom/kcov/releases
task: "3.16.0", // https://github.com/go-task/task/releases task: "3.18.0", // https://github.com/go-task/task/releases
doxygen: isArch() ? "1.9.5-1" : "1.9.5", // https://www.doxygen.nl/download.html // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=doxygen // https://formulae.brew.sh/formula/doxygen // https://archlinux.org/packages/extra/x86_64/doxygen/ doxygen: isArch() ? "1.9.5-1" : "1.9.5", // https://www.doxygen.nl/download.html // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=doxygen // https://formulae.brew.sh/formula/doxygen // https://archlinux.org/packages/extra/x86_64/doxygen/
gcc: "11", // https://github.com/brechtsanders/winlibs_mingw/releases and // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=gcc gcc: isArch() ? "11" : "12", // https://github.com/brechtsanders/winlibs_mingw/releases and // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=gcc
} }
/// If an ubuntu versions is not in this map: /// If an ubuntu versions is not in this map:
// - the newer ubuntu versions use the first entry (e.g. v20), // - the newer ubuntu versions use the first entry (e.g. v20),
// - the older ones use "" // - the older ones use ""
export const DefaultLinuxVersion: Record<string, Record<number, string>> = { export const DefaultLinuxVersion: Record<string, Record<number, string>> = {
gcc: {
22: "12",
20: "11",
18: "11",
16: "11",
14: "11",
},
llvm: { llvm: {
22: "13.0.0-ubuntu-20.04", 22: "13.0.0-ubuntu-20.04",
20: "13.0.0-ubuntu-20.04", 20: "13.0.0-ubuntu-20.04",