From 24734937d9915fa144db6027d11a157a44ac864b Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 16 Sep 2021 18:21:11 -0500 Subject: [PATCH] fix: use gcc 10 on windows --- src/default_versions.ts | 2 +- src/gcc/__tests__/gcc.test.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/default_versions.ts b/src/default_versions.ts index 57eb8083..338b1db6 100644 --- a/src/default_versions.ts +++ b/src/default_versions.ts @@ -7,7 +7,7 @@ const DefaultVersions: Record = { conan: "1.40.1", meson: "0.59.1", python: "3.x", - gcc: "11", + gcc: process.platform === "win32" ? "10.2.0" : "11", } /** Get the default version if passed true or undefined, otherwise return the version itself */ diff --git a/src/gcc/__tests__/gcc.test.ts b/src/gcc/__tests__/gcc.test.ts index ac50d04b..727248eb 100644 --- a/src/gcc/__tests__/gcc.test.ts +++ b/src/gcc/__tests__/gcc.test.ts @@ -1,14 +1,16 @@ import { testBin } from "../../utils/tests/test-helpers" import { setupGcc } from "../gcc" +import { getVersion } from "../../default_versions" jest.setTimeout(200000) describe("setup-gcc", () => { it("should setup gcc", async () => { - const installInfo = await setupGcc("11", "", process.arch) + const version = getVersion("gcc", undefined) ?? "11" + const installInfo = await setupGcc(version, "", process.arch) let gpp = "g++" if (process.platform !== "win32") { - gpp = "g++-11" + gpp = `g++-${version}` } await testBin(gpp, ["--version"], installInfo?.binDir) })