From 89ee433676b033265dc2f7123adaecb73ce0e0f6 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 16 Jun 2022 08:15:38 -0700 Subject: [PATCH] Update MinGW on Windows 2022 (#5729) * Update MinGW on Windows 2022 Previously, the GitHub virtual environments only had MinGW v8.1.0 installed. That version was released in October of 2018 and, since then, MinGW has released versions all the way up to v11.2.0. This change updates the MinGW version to the latest available on Chocolatey for the Windows 2022 environment. Windows 2019 retains the current v8.1.0 version. Fixes #5530. * Update MinGW documentation * Additionally update win-2016 version * Revert "Update MinGW documentation" This reverts commit cb7a72ff0f33f8a5bbda15be677b348a05f9fee0. * fix: modify the pattern used for retrieving the MinGW version --- images/win/scripts/Installers/Install-Mingw64.ps1 | 3 ++- images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 | 4 ++-- images/win/toolsets/toolset-2016.json | 3 +++ images/win/toolsets/toolset-2019.json | 3 +++ images/win/toolsets/toolset-2022.json | 3 +++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/images/win/scripts/Installers/Install-Mingw64.ps1 b/images/win/scripts/Installers/Install-Mingw64.ps1 index 15bb3182..6d9043a8 100644 --- a/images/win/scripts/Installers/Install-Mingw64.ps1 +++ b/images/win/scripts/Installers/Install-Mingw64.ps1 @@ -3,7 +3,8 @@ ## Desc: Install GNU tools for Windows ################################################################################ -Choco-Install -PackageName mingw -ArgumentList "--version=8.1.0" +$toolsetVersion = (Get-ToolsetContent).mingw.version +Choco-Install -PackageName mingw -ArgumentList "--version=$toolsetVersion" # Make a copy of mingw32-make.exe to make.exe, which is a more discoverable name # and so the same command line can be used on Windows as on macOS and Linux diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 175ff9c4..878a838c 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -102,7 +102,7 @@ function Get-KindVersion { } function Get-MinGWVersion { - (gcc --version | Select-String -Pattern "MinGW-W64 project") -match "(?\d+\.\d+\.\d+)" | Out-Null + (gcc --version | Select-String -Pattern "MinGW-W64") -match "(?\d+\.\d+\.\d+)" | Out-Null $mingwVersion = $Matches.Version return "Mingw-w64 $mingwVersion" } @@ -302,4 +302,4 @@ function Get-SwigVersion { (swig -version | Out-String) -match "version (?\d+\.\d+\.\d+)" | Out-Null $swigVersion = $Matches.Version return "Swig $swigVersion" -} \ No newline at end of file +} diff --git a/images/win/toolsets/toolset-2016.json b/images/win/toolsets/toolset-2016.json index 1325b6c2..1a0aaab6 100644 --- a/images/win/toolsets/toolset-2016.json +++ b/images/win/toolsets/toolset-2016.json @@ -187,6 +187,9 @@ ] } }, + "mingw": { + "version": "8.1.0" + }, "MsysPackages": { "msys2": [ "base-devel", diff --git a/images/win/toolsets/toolset-2019.json b/images/win/toolsets/toolset-2019.json index fb15f058..39265c49 100644 --- a/images/win/toolsets/toolset-2019.json +++ b/images/win/toolsets/toolset-2019.json @@ -189,6 +189,9 @@ ] } }, + "mingw": { + "version": "8.1.0" + }, "MsysPackages": { "msys2": [ "base-devel", diff --git a/images/win/toolsets/toolset-2022.json b/images/win/toolsets/toolset-2022.json index 06af656b..93b451e0 100644 --- a/images/win/toolsets/toolset-2022.json +++ b/images/win/toolsets/toolset-2022.json @@ -159,6 +159,9 @@ ] } }, + "mingw": { + "version": "11.2.0.07112021" + }, "MsysPackages": { "msys2": [], "mingw": []