From 5e3c0460669eb29e4667c879c7b081227931d0f7 Mon Sep 17 00:00:00 2001 From: Antoine Beauchamp Date: Sun, 11 Aug 2024 19:44:50 -0400 Subject: [PATCH 1/2] Forced installing CMake 3.29.7 on Github Action and AppVeyor workflows. #158 --- .github/workflows/build_windows.yml | 5 ++ INSTALL.md | 4 +- appveyor.yml | 1 + ci/appveyor/install_cmake.bat | 11 ++++ ci/github/install_cmake.bat | 11 ++++ ci/windows/install_cmake.bat | 78 +++++++++++++++++++++++++++++ 6 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 ci/appveyor/install_cmake.bat create mode 100644 ci/github/install_cmake.bat create mode 100644 ci/windows/install_cmake.bat diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 03118e24..63559aef 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -89,6 +89,11 @@ jobs: gist_file_name: ${{env.GIT_REPOSITORY}}.${{env.GIT_BRANCH}}.${{env.GITHUB_WORKFLOW}}.json file_path: ./ci/github/tests_not_available.badge.json + - name: Install CMake (issue \#158) + working-directory: ${{env.GITHUB_WORKSPACE}} + shell: cmd + run: call ci\github\install_cmake.bat + - name: Install Doxygen working-directory: ${{env.GITHUB_WORKSPACE}} shell: cmd diff --git a/INSTALL.md b/INSTALL.md index 4906191a..3d4885f0 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -114,7 +114,7 @@ The following software must be installed on the system for compiling source code * [exprtk d312ba9](https://github.com/ArashPartow/exprtk) (downloaded automatically) * [File and libmagic for Windows v5.38 + modifications](https://github.com/Cirn09/file-windows/tree/39f1624b4c95a0ab657a1084d50069270ebb8947) * [zlib v1.2.11](https://github.com/madler/zlib/releases/tag/v1.2.11) -* [CMake v3.4.3](http://www.cmake.org/) (or newer) +* [CMake v3.4.3](http://www.cmake.org/) (tested up to 3.29.7) * [imneme/pcg-cpp](https://github.com/imneme/pcg-cpp/tree/428802d1a5634f96bcd0705fab379ff0113bcf13) (or newer) * (optional) [Grip (GitHub Readme Instant Preview)](https://github.com/joeyespo/grip) v4.5.2 (or newer) @@ -122,7 +122,7 @@ The following software must be installed on the system for compiling source code ### Windows Requirements ### * Microsoft Visual C++ 2017 or newer -* (optional) [WiX Toolset](https://wixtoolset.org/) v3.11.2 (or newer) +* (optional) [WiX Toolset](https://wixtoolset.org/) v3.11.2 (tested up to 3.14.1.8722) diff --git a/appveyor.yml b/appveyor.yml index 9cebd81c..be151ad2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -62,6 +62,7 @@ matrix: before_build: - cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\list_services_status.bat - cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\list_registry_keys.bat +- cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_cmake.bat - cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_doxygen.bat - cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_googletest.bat - cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_tinyxml2.bat diff --git a/ci/appveyor/install_cmake.bat b/ci/appveyor/install_cmake.bat new file mode 100644 index 00000000..8664e833 --- /dev/null +++ b/ci/appveyor/install_cmake.bat @@ -0,0 +1,11 @@ +@echo off + +:: Validate appveyor's environment +if "%APPVEYOR_BUILD_FOLDER%"=="" ( + echo Please define 'APPVEYOR_BUILD_FOLDER' environment variable. + exit /B 1 +) + +:: Call matching script for windows +call "%APPVEYOR_BUILD_FOLDER%\ci\windows\%~n0.bat" +if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/ci/github/install_cmake.bat b/ci/github/install_cmake.bat new file mode 100644 index 00000000..3879bc59 --- /dev/null +++ b/ci/github/install_cmake.bat @@ -0,0 +1,11 @@ +@echo off + +:: Validate GitHub CI's environment +if "%GITHUB_WORKSPACE%"=="" ( + echo Please define 'GITHUB_WORKSPACE' environment variable. + exit /B 1 +) + +:: Call matching script for windows +call "%GITHUB_WORKSPACE%\ci\windows\%~n0.bat" +if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/ci/windows/install_cmake.bat b/ci/windows/install_cmake.bat new file mode 100644 index 00000000..03aab098 --- /dev/null +++ b/ci/windows/install_cmake.bat @@ -0,0 +1,78 @@ +@echo off + +:: Install CMake. +:: https://cmake.org/download/ +:: https://github.com/Kitware/CMake/releases/latest + +echo Installing CMake... +set CMAKE_MSI_URL=https://github.com/Kitware/CMake/releases/download/v3.29.7/cmake-3.29.7-windows-x86_64.msi +set CMAKE_MSI_FILE=%TEMP%\cmake-3.29.7-windows-x86_64.msi +set CMAKE_MSI_INSTALL_DIR=C:\Program Files\CMake + +:: Validate if python launcher is installed +where py.exe >NUL 2>NUL +if errorlevel 1 ( + echo Command failed. Please install python and python launcher to continue. + exit /B %errorlevel% +) +echo Found python interpreter +python --version + +:: Validate if pip is installed +where pip.exe >NUL 2>NUL +if errorlevel 1 ( + echo Command failed. Please install pip ^(Package Installer Python^) to continue. + exit /B %errorlevel% +) + +:: Download installer +echo Downloading %CMAKE_MSI_URL%... +python -c "import urllib.request; import os; urllib.request.urlretrieve(os.getenv('CMAKE_MSI_URL'),os.getenv('CMAKE_MSI_FILE'));" +if errorlevel 1 ( + echo Command failed. Unable to download cmake installer. + exit /B %errorlevel% +) +if NOT EXIST "%CMAKE_MSI_FILE%" ( + echo Download failed. The file '%CMAKE_MSI_FILE%' is not found. + exit /B %errorlevel% +) +echo done. +echo. + +:: Validate administrative permissions... +:: https://stackoverflow.com/questions/4051883/batch-script-how-to-check-for-admin-rights +echo Checking administrative permissions... +net session >nul 2>&1 +if %errorLevel% == 0 ( + echo Found administrative permissions. Installation in quiet mode enabled. + set QUIET_MODE_ARGS=/quiet /qn +) else ( + echo Administrative permissions not found. Installation in interractive mode will be used. +) + +:: Installing MSI +REM Note: `/quiet /qn` is not available when launched in user mode. +echo Running CMake installer... +echo QUIET_MODE_ARGS=%QUIET_MODE_ARGS% +msiexec /i "%CMAKE_MSI_FILE%" %QUIET_MODE_ARGS% /norestart /log "%TEMP%\cmake_insall.log" +if errorlevel 1 ( + echo Failed to install MSI package "%CMAKE_MSI_FILE%". + exit /B %errorlevel% +) +echo done. +echo. + +:: Searching for cmake executable +echo Searching for cmake executable... +set PATH=%CMAKE_MSI_INSTALL_DIR%\bin;%PATH% +where cmake.exe 1>NUL 2>NUL +if errorlevel 1 ( + echo Error: CMake not installed on system. + exit /B %errorlevel% +) +echo CMake found. +cmake --version +echo. + +echo CMake was installed on the system without error. +echo. From 3ece28bd57191139d77bf4407c9d9e9798a3d182 Mon Sep 17 00:00:00 2001 From: Antoine Beauchamp Date: Sun, 11 Aug 2024 20:39:52 -0400 Subject: [PATCH 2/2] Updated CHANGES for #157 and #158. --- CHANGES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index f931037e..c9d23bf6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +Changes for 0.10.0 + +* Fixed issue #157: Compilation fails on Github Action: `fatal error C1083: Cannot open include file: 'atlbase.h': No such file or directory`. +* Fixed issue #158: Compilation fails on Github Action: `CPack error : Problem running WiX.`. + + Changes for 0.9.0 * Fixed issue #111: Move code from the shell extension to the core.