From fb4810618821daaade7b238d35fa1479d02963ae Mon Sep 17 00:00:00 2001 From: abeimler Date: Thu, 20 Jul 2023 00:26:55 +0200 Subject: [PATCH] fix: mingw version --- dev/docker/__tests__/arch.mingw.dockerfile | 4 ++-- dev/docker/__tests__/fedora.mingw.dockerfile | 1 - dev/docker/__tests__/ubuntu.mingw.dockerfile | 4 ++-- src/compilers.ts | 2 +- src/gcc/gcc.ts | 2 +- src/versions/default_versions.ts | 5 +++++ 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dev/docker/__tests__/arch.mingw.dockerfile b/dev/docker/__tests__/arch.mingw.dockerfile index 579bb189..00c6d09d 100644 --- a/dev/docker/__tests__/arch.mingw.dockerfile +++ b/dev/docker/__tests__/arch.mingw.dockerfile @@ -29,8 +29,8 @@ RUN pacman -Syuu --noconfirm && \ ENTRYPOINT ["/bin/bash"] -#### Building (example) -FROM setup-cpp-arch AS builder +#### Cross Building (example) +FROM setup-cpp-arch-mingw AS builder COPY ./dev/cpp_vcpkg_project /home/app WORKDIR /home/app diff --git a/dev/docker/__tests__/fedora.mingw.dockerfile b/dev/docker/__tests__/fedora.mingw.dockerfile index 182b4c45..3ca2f4a0 100644 --- a/dev/docker/__tests__/fedora.mingw.dockerfile +++ b/dev/docker/__tests__/fedora.mingw.dockerfile @@ -33,4 +33,3 @@ COPY ./dev/cpp_vcpkg_project /home/app WORKDIR /home/app RUN bash -c 'source ~/.cpprc \ && task build_cross_mingw' - diff --git a/dev/docker/__tests__/ubuntu.mingw.dockerfile b/dev/docker/__tests__/ubuntu.mingw.dockerfile index 745233ca..1b9f8fb8 100644 --- a/dev/docker/__tests__/ubuntu.mingw.dockerfile +++ b/dev/docker/__tests__/ubuntu.mingw.dockerfile @@ -32,8 +32,8 @@ RUN apt-get update -qq && \ ENTRYPOINT ["/bin/bash"] -#### Building (example) -FROM setup-cpp-ubuntu AS builder +#### Cross Building (example) +FROM setup-cpp-ubuntu-mingw AS builder COPY ./dev/cpp_vcpkg_project /home/app WORKDIR /home/app diff --git a/src/compilers.ts b/src/compilers.ts index d190c699..bb8062fa 100644 --- a/src/compilers.ts +++ b/src/compilers.ts @@ -60,7 +60,7 @@ export async function installCompiler( case "mingw": case "cygwin": case "msys": { - const gccVersion = getVersion("gcc", version, osVersion) + const gccVersion = (compiler === "mingw")? getVersion("mingw", version, osVersion) : getVersion("gcc", version, osVersion) const installationInfo = (compiler === "mingw")? await setupMingw(gccVersion, join(setupCppDir, "gcc"), arch) : await setupGcc(gccVersion, join(setupCppDir, "gcc"), arch) if (hasLLVM) { diff --git a/src/gcc/gcc.ts b/src/gcc/gcc.ts index c78742cc..8af714a5 100644 --- a/src/gcc/gcc.ts +++ b/src/gcc/gcc.ts @@ -151,7 +151,7 @@ export async function setupMingw(version: string, setupDir: string, arch: string } case "linux": { if (isArch()) { - installationInfo = await setupPacmanPack("mingw-w64", version, "yay") + installationInfo = await setupPacmanPack("mingw-w64-gcc", version) } else if (hasDnf()) { installationInfo = await setupDnfPack([ { name: "mingw64-gcc", version }, diff --git a/src/versions/default_versions.ts b/src/versions/default_versions.ts index f5f7ae25..764793b7 100644 --- a/src/versions/default_versions.ts +++ b/src/versions/default_versions.ts @@ -28,6 +28,7 @@ export const DefaultVersions: Record = { task: "3.25.0", // https://github.com/go-task/task/releases doxygen: isArch() ? "1.9.6-1" : "1.9.7", // 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: isArch() ? "13.1.1-1" : "13", // https://github.com/brechtsanders/winlibs_mingw/releases and // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=gcc + //mingw: isArch() ? "12.2.0-1" : "8", // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=mingw-w64 // https://archlinux.org/packages/extra/x86_64/mingw-w64-gcc/ } export const MinVersions: Record = { @@ -46,6 +47,10 @@ export const DefaultLinuxVersion: Record | undefi 16: "11", 14: "11", }, + mingw: { + 22: "8.0.0-1", + 20: "7.0.0-2", + }, llvm: { 22: "15.0.6-ubuntu-18.04", 20: "15.0.6-ubuntu-18.04",