From e87e08df0c52fe90f5fa15b4ffb2d7eb88482c4d Mon Sep 17 00:00:00 2001 From: Antoine Beauchamp Date: Sun, 11 Aug 2024 17:17:37 -0400 Subject: [PATCH] Fixes #157: Compilation fails on Github Action with windows-2022 image: fatal error C1083: Cannot open include file: 'atlbase.h': No such file or directory Squashed commit of the following: commit afcf44bbb5f41235ce3f43800407812c79d48fd4 Author: Antoine Beauchamp Date: Sun Aug 11 17:16:15 2024 -0400 Revert "Adding a dummy file to a branch created from tag 0.9.0 to validate that ATL is missing in image windows-latest (windows-2022)" This reverts commit 7372ab9d28b9fe23406f1cd943d1d71ecd602ed2. commit 89bcb6ba8cbe64a2e381b6dcc9ea4a187e163ff6 Author: Antoine Beauchamp Date: Sun Aug 11 17:15:50 2024 -0400 Revert "Trying to list CPack log file on error on github action. #157" This reverts commit f2ed5ac4418b57fdb0a4c4f635deb46b34e7b270. commit 49ee814b4652fb329e18d799bba30de8fd18225b Author: Antoine Beauchamp Date: Sun Aug 11 17:12:36 2024 -0400 Fixes #157 commit 08f6edd0b17068fb3c02b1a218eaeb792b7c86d5 Author: Antoine Beauchamp Date: Sun Aug 11 16:20:27 2024 -0400 Trying to skip step `Delete Visual Studio components`. It may not be required for #157 commit f2ed5ac4418b57fdb0a4c4f635deb46b34e7b270 Author: Antoine Beauchamp Date: Sun Aug 11 16:07:15 2024 -0400 Trying to list CPack log file on error on github action. #157 commit 9e32e1ccf7e96e902196886ae6ff1ab9b33a0fe4 Author: Antoine Beauchamp Date: Sun Aug 11 15:38:56 2024 -0400 Converted yaml from Microsoft Azure `tasks` to Github Action `steps`. commit 1eed630735d632f8535990affd74d9f3aeb20a5d Author: Antoine Beauchamp Date: Sun Aug 11 14:52:47 2024 -0400 Fixes #157: Compilation fails on Github Action with windows-2022 image: fatal error C1083: Cannot open include file: 'atlbase.h': No such file or directory commit 7372ab9d28b9fe23406f1cd943d1d71ecd602ed2 Author: Antoine Beauchamp Date: Sun Aug 11 14:26:33 2024 -0400 Adding a dummy file to a branch created from tag 0.9.0 to validate that ATL is missing in image windows-latest (windows-2022) --- .github/workflows/build_windows.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index d6c1312a..03118e24 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -35,6 +35,27 @@ jobs: python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified + # Force reinstall of ATL through update of Visual Studio 2022 VC components + # See https://github.com/actions/runner-images/issues/9873 for details. + # The step to `Delete Visual Studio components` is indeed unnecessary. + # Only the reinstallation of the following component is required to solve the error `fatal error C1083: Cannot open include file: 'atlbase.h': No such file or directory `. + - name: Install Visual Studio components + shell: pwsh + run: | + Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" + $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" + $componentsToRemove= @( + "Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL" + "Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.Spectre" + "Microsoft.VisualStudio.Component.VC.14.29.16.11.MFC" + "Microsoft.VisualStudio.Component.VC.14.29.16.11.MFC.Spectre" + ) + [string]$workloadArgs = $componentsToRemove | ForEach-Object {" --add " + $_} + $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache') + # should be run twice + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden + - name: Create new environment variables working-directory: ${{env.GITHUB_WORKSPACE}} shell: cmd