From 5b1dfaa179e777520ff82d37c7c9283b46243445 Mon Sep 17 00:00:00 2001 From: "Stephen G. Tuggy" Date: Mon, 22 Apr 2024 15:55:41 -0700 Subject: [PATCH 1/8] Adjust vcpkg baseline, along with several other things, hopefully fixing issue #844 in the process --- engine/CMakePresets.json | 17 ++++++++++------ .../custom-triplets/x64-windows-win10.cmake | 6 ++++++ engine/vcpkg-configuration.json | 6 +----- engine/vcpkg.json | 4 +++- script/bootstrap.ps1 | 20 +++++++++---------- 5 files changed, 31 insertions(+), 22 deletions(-) create mode 100644 engine/custom-triplets/x64-windows-win10.cmake diff --git a/engine/CMakePresets.json b/engine/CMakePresets.json index 50944c6d30..546555ffa7 100644 --- a/engine/CMakePresets.json +++ b/engine/CMakePresets.json @@ -279,12 +279,17 @@ "displayName": "Windows Default", "description": "Default build for Windows", "environment": { - "VCPKG_DEFAULT_TRIPLET": "x64-windows", - "VCPKG_DEFAULT_HOST_TRIPLET": "x64-windows", - "VCPKG_TARGET_TRIPLET": "x64-windows", - "VCPKG_HOST_TRIPLET": "x64-windows" + "VCPKG_TARGET_TRIPLET": "x64-windows-win10", + "VCPKG_HOST_TRIPLET": "x64-windows-win10" + }, + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": { + "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", + "type": "FILEPATH" + }, + "VCPKG_TARGET_TRIPLET": "x64-windows-win10", + "VCPKG_HOST_TRIPLET": "x64-windows-win10" }, - "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", "debug": { "output": true, "find": true @@ -326,7 +331,7 @@ "hidden": true, "inherits": "windows-default", "displayName": "Ninja on Windows", - "generator": "Ninja", + "generator": "Ninja Multi-Config", "condition": { "type": "equals", "lhs": "${hostSystemName}", diff --git a/engine/custom-triplets/x64-windows-win10.cmake b/engine/custom-triplets/x64-windows-win10.cmake new file mode 100644 index 0000000000..86fcd42071 --- /dev/null +++ b/engine/custom-triplets/x64-windows-win10.cmake @@ -0,0 +1,6 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) + +set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} /DBOOST_ALL_DYN_LINK /DBOOST_USE_WINAPI_VERSION=0x0A00 /D_WIN32_WINNT=0x0A00 /DWINVER=0x0A00") +set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} /DBOOST_ALL_DYN_LINK /DBOOST_USE_WINAPI_VERSION=0x0A00 /D_WIN32_WINNT=0x0A00 /DWINVER=0x0A00") diff --git a/engine/vcpkg-configuration.json b/engine/vcpkg-configuration.json index 81539fafef..fce0cec112 100644 --- a/engine/vcpkg-configuration.json +++ b/engine/vcpkg-configuration.json @@ -1,8 +1,4 @@ { "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg-configuration.schema.json", - "default-registry": { - "kind": "git", - "baseline": "45c660987c371515ddcc5c355e7989c0d652b85f", - "repository": "https://github.com/vegastrike/vcpkg-local" - } + "overlay-triplets": [ "./custom-triplets" ] } diff --git a/engine/vcpkg.json b/engine/vcpkg.json index 3f98a5b5c4..b011bbf4f1 100644 --- a/engine/vcpkg.json +++ b/engine/vcpkg.json @@ -2,6 +2,7 @@ "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", "name": "vega-strike", "version-string": "0.9.0", + "buildin-baseline": "da4b78d35084ec4e9808aa02017028da03b8d2ab", "dependencies": [ "boost-python", "boost-log", @@ -13,6 +14,8 @@ "boost-chrono", "boost-atomic", "boost-assign", + "boost-format", + "egl-registry", "expat", "freeglut", "libpng", @@ -20,7 +23,6 @@ "libvorbis", "openal-soft", "opengl", - "opengl-registry", "openssl", "sdl1", "sdl2", diff --git a/script/bootstrap.ps1 b/script/bootstrap.ps1 index 2e9409a6a7..8cb171077f 100644 --- a/script/bootstrap.ps1 +++ b/script/bootstrap.ps1 @@ -1,6 +1,6 @@ # bootstrap.ps1 -# Copyright (C) 2021-2023 Stephen G. Tuggy and other Vega Strike contributors +# Copyright (C) 2021-2024 Stephen G. Tuggy and other Vega Strike contributors # https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -13,11 +13,11 @@ # Vega Strike is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with Vega Strike. If not, see . +# along with Vega Strike. If not, see . # You can customize this directory location if desired, but it should be @@ -26,18 +26,18 @@ param( [String]$VCPKG_PARENT_DIR = "C:\Projects" ) -Set-Variable -Name CMAKE_VERSION -Value "3.26.1" +Set-Variable -Name CMAKE_VERSION -Value "3.29.2" -New-Item "$VCKPG_PARENT_DIR" -ItemType Directory -Force -Push-Location "$VCKPG_PARENT_DIR" +New-Item "$VCPKG_PARENT_DIR" -ItemType Directory -Force +Push-Location "$VCPKG_PARENT_DIR" git clone https://github.com/vegastrike/vcpkg-local.git ./v .\v\bootstrap-vcpkg.bat -disableMetrics -[Environment]::SetEnvironmentVariable('VCPKG_ROOT', "$VCKPG_PARENT_DIR\v", 'User') -$env:VCPKG_ROOT = "$VCKPG_PARENT_DIR\v" +[Environment]::SetEnvironmentVariable('VCPKG_ROOT', "$VCPKG_PARENT_DIR\v", 'User') +$env:VCPKG_ROOT = "$VCPKG_PARENT_DIR\v" $path = [Environment]::GetEnvironmentVariable('PATH', 'User') -$newPath = $path + ";$VCKPG_PARENT_DIR\v\downloads\tools\cmake-$CMAKE_VERSION-windows\cmake-$CMAKE_VERSION-windows-i386\bin" +$newPath = $path + ";$VCPKG_PARENT_DIR\v\downloads\tools\cmake-$CMAKE_VERSION-windows\cmake-$CMAKE_VERSION-windows-i386\bin" [Environment]::SetEnvironmentVariable('PATH', $newPath, 'User') $env:PATH = $newPath @@ -47,7 +47,7 @@ $env:VCPKG_DEFAULT_TRIPLET = $triplet [Environment]::SetEnvironmentVariable('VCPKG_DEFAULT_HOST_TRIPLET', $triplet, 'User') $env:VCPKG_DEFAULT_HOST_TRIPLET = $triplet -$pythonHome = "$VCKPG_PARENT_DIR\v\packages\python3_x64-windows\tools\python3" +$pythonHome = "$VCPKG_PARENT_DIR\v\packages\python3_x64-windows\tools\python3" [Environment]::SetEnvironmentVariable('PYTHONHOME', $pythonHome, 'User') $env:PYTHONHOME = $pythonHome From aad6a81a8b2fb3b16d214df5f0707eea54cb84ef Mon Sep 17 00:00:00 2001 From: "Stephen G. Tuggy" Date: Mon, 22 Apr 2024 16:17:12 -0700 Subject: [PATCH 2/8] Fix typo --- engine/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/vcpkg.json b/engine/vcpkg.json index b011bbf4f1..e7d79b999e 100644 --- a/engine/vcpkg.json +++ b/engine/vcpkg.json @@ -2,7 +2,7 @@ "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", "name": "vega-strike", "version-string": "0.9.0", - "buildin-baseline": "da4b78d35084ec4e9808aa02017028da03b8d2ab", + "builtin-baseline": "da4b78d35084ec4e9808aa02017028da03b8d2ab", "dependencies": [ "boost-python", "boost-log", From e930913bf9875850b6099e8c0070ae032c8f2b79 Mon Sep 17 00:00:00 2001 From: Stephen G Tuggy Date: Mon, 22 Apr 2024 17:50:58 -0700 Subject: [PATCH 3/8] Update Windows-CI.yml --- .github/workflows/Windows-CI.yml | 50 ++++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/Windows-CI.yml b/.github/workflows/Windows-CI.yml index eee73215a8..d4503109fc 100644 --- a/.github/workflows/Windows-CI.yml +++ b/.github/workflows/Windows-CI.yml @@ -33,8 +33,8 @@ jobs: VCPKG_ROOT: '${{ github.workspace }}/v' # Tells vcpkg where binary packages are stored. VCPKG_DEFAULT_BINARY_CACHE: '${{ github.workspace }}/vbincache' - ## Let's use GitHub Action cache as storage for the vcpkg Binary Caching feature. - #VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite' + # Let's use GitHub Action cache as storage for the vcpkg Binary Caching feature. + VCPKG_BINARY_SOURCES: 'x-gha,readwrite' VCPKG_DEFAULT_TRIPLET: x64-windows VCPKG_DEFAULT_HOST_TRIPLET: x64-windows PYTHONHOME: '${{ github.workspace }}/v/packages/python3_x64-windows/tools/python3' @@ -43,7 +43,7 @@ jobs: steps: # Set env vars needed for vcpkg to leverage the GitHub Action cache as a storage # for Binary Caching. - - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 #v6.4.1 + - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1 with: script: | core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); @@ -51,38 +51,38 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 + uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f #v4.1.3 - name: "Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'" run: mkdir -p $VCPKG_DEFAULT_BINARY_CACHE shell: bash - name: install-cmake - uses: lukka/get-cmake@359fbae4b163fa01633e6de228fa7f2a31ab1fc7 #v3.26.1 + uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa #v3.29.2 with: - cmakeVersion: 3.26.1 + cmakeVersion: 3.29.2 ninjaVersion: 1.11.1 - # # Restore vcpkg from the GitHub Action cache service. Note that packages are restored by vcpkg's binary caching - # # when it is being run afterward by CMake. - # - name: restore-vcpkg - # uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 #v3.3.1 - # with: - # # The first path is the location of vcpkg: it contains the vcpkg executable and data files, as long as the - # # built package archives (aka binary cache) which are located by VCPKG_DEFAULT_BINARY_CACHE env var. - # # The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages. - # path: | - # ${{ env.VCPKG_ROOT }} - # !${{ env.VCPKG_ROOT }}/buildtrees - # !${{ env.VCPKG_ROOT }}/packages - # !${{ env.VCPKG_ROOT }}/downloads - # !${{ env.VCPKG_ROOT }}/installed - # # The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used. - # key: | - # ${{ hashFiles( '.git/modules/vcpkg/HEAD' )}} + # Restore vcpkg from the GitHub Action cache service. Note that packages are restored by vcpkg's binary caching + # when it is being run afterward by CMake. + - name: restore-vcpkg + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2 + with: + # The first path is the location of vcpkg: it contains the vcpkg executable and data files, as long as the + # built package archives (aka binary cache) which are located by VCPKG_DEFAULT_BINARY_CACHE env var. + # The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages. + path: | + ${{ env.VCPKG_ROOT }} + !${{ env.VCPKG_ROOT }}/buildtrees + !${{ env.VCPKG_ROOT }}/packages + !${{ env.VCPKG_ROOT }}/downloads + !${{ env.VCPKG_ROOT }}/installed + # The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used. + key: | + ${{ hashFiles( '.git/modules/vcpkg/HEAD' )}} - name: install-vcpkg - #if: steps.cache.outputs.cache-hit != 'true' + if: steps.cache.outputs.cache-hit != 'true' run: | git clone https://github.com/vegastrike/vcpkg-local.git ${{ env.VCPKG_ROOT }} ${{ env.VCPKG_ROOT }}\bootstrap-vcpkg.bat -disableMetrics @@ -99,7 +99,7 @@ jobs: run: .\script\test.ps1 -Generator ${{ matrix.cmake-generator }} -EnablePIE ${{ matrix.enable-pie }} -BuildType ${{ matrix.build-type }} - name: Upload test results - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3 if: failure() with: name: test_results_xml From 5caac071984e9c707185bf36e42ec05003159f49 Mon Sep 17 00:00:00 2001 From: Stephen G Tuggy Date: Mon, 22 Apr 2024 18:04:58 -0700 Subject: [PATCH 4/8] Update Windows-CI.yml --- .github/workflows/Windows-CI.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Windows-CI.yml b/.github/workflows/Windows-CI.yml index d4503109fc..1c9ae962e4 100644 --- a/.github/workflows/Windows-CI.yml +++ b/.github/workflows/Windows-CI.yml @@ -73,10 +73,10 @@ jobs: # The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages. path: | ${{ env.VCPKG_ROOT }} - !${{ env.VCPKG_ROOT }}/buildtrees - !${{ env.VCPKG_ROOT }}/packages - !${{ env.VCPKG_ROOT }}/downloads - !${{ env.VCPKG_ROOT }}/installed + #!${{ env.VCPKG_ROOT }}/buildtrees + #!${{ env.VCPKG_ROOT }}/packages + #!${{ env.VCPKG_ROOT }}/downloads + #!${{ env.VCPKG_ROOT }}/installed # The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used. key: | ${{ hashFiles( '.git/modules/vcpkg/HEAD' )}} @@ -84,7 +84,7 @@ jobs: - name: install-vcpkg if: steps.cache.outputs.cache-hit != 'true' run: | - git clone https://github.com/vegastrike/vcpkg-local.git ${{ env.VCPKG_ROOT }} + git clone https://github.com/Microsoft/vcpkg.git ${{ env.VCPKG_ROOT }} ${{ env.VCPKG_ROOT }}\bootstrap-vcpkg.bat -disableMetrics - name: run-build-script From a1576827fedcac0f09bec53b1224c4dd49c4aaa6 Mon Sep 17 00:00:00 2001 From: Stephen G Tuggy Date: Mon, 22 Apr 2024 19:48:00 -0700 Subject: [PATCH 5/8] Update Windows-CI.yml --- .github/workflows/Windows-CI.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Windows-CI.yml b/.github/workflows/Windows-CI.yml index 1c9ae962e4..00a89b60bf 100644 --- a/.github/workflows/Windows-CI.yml +++ b/.github/workflows/Windows-CI.yml @@ -37,7 +37,6 @@ jobs: VCPKG_BINARY_SOURCES: 'x-gha,readwrite' VCPKG_DEFAULT_TRIPLET: x64-windows VCPKG_DEFAULT_HOST_TRIPLET: x64-windows - PYTHONHOME: '${{ github.workspace }}/v/packages/python3_x64-windows/tools/python3' # Steps represent a sequence of tasks that will be executed as part of the job steps: From f93656d3a69249ac1f88386f8a653a000d957c5d Mon Sep 17 00:00:00 2001 From: Stephen G Tuggy Date: Mon, 22 Apr 2024 19:52:19 -0700 Subject: [PATCH 6/8] Update Windows-CI.yml --- .github/workflows/Windows-CI.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/Windows-CI.yml b/.github/workflows/Windows-CI.yml index 00a89b60bf..018a104258 100644 --- a/.github/workflows/Windows-CI.yml +++ b/.github/workflows/Windows-CI.yml @@ -52,6 +52,11 @@ jobs: - name: checkout uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f #v4.1.3 + - name: Setup Python + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d #v5.1.0 + with: + python-version: 3.11 + - name: "Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'" run: mkdir -p $VCPKG_DEFAULT_BINARY_CACHE shell: bash From 297703d77585fa29055cc77c0a0bd0facbdaa9ef Mon Sep 17 00:00:00 2001 From: Stephen G Tuggy Date: Mon, 22 Apr 2024 22:59:46 -0700 Subject: [PATCH 7/8] Update Windows-CI.yml --- .github/workflows/Windows-CI.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Windows-CI.yml b/.github/workflows/Windows-CI.yml index 018a104258..c68102a5ae 100644 --- a/.github/workflows/Windows-CI.yml +++ b/.github/workflows/Windows-CI.yml @@ -77,13 +77,13 @@ jobs: # The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages. path: | ${{ env.VCPKG_ROOT }} - #!${{ env.VCPKG_ROOT }}/buildtrees - #!${{ env.VCPKG_ROOT }}/packages - #!${{ env.VCPKG_ROOT }}/downloads - #!${{ env.VCPKG_ROOT }}/installed + !${{ env.VCPKG_ROOT }}/buildtrees + !${{ env.VCPKG_ROOT }}/packages + !${{ env.VCPKG_ROOT }}/downloads + !${{ env.VCPKG_ROOT }}/installed # The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used. key: | - ${{ hashFiles( '.git/modules/vcpkg/HEAD' )}} + ${{ os.release }}-${{ hashFiles( './engine/vcpkg.json' )}} - name: install-vcpkg if: steps.cache.outputs.cache-hit != 'true' From b2b085fba144475ce5dbba1712c121e545b21738 Mon Sep 17 00:00:00 2001 From: Stephen G Tuggy Date: Mon, 22 Apr 2024 23:33:00 -0700 Subject: [PATCH 8/8] Windows-CI.yml: Fix one more issue --- .github/workflows/Windows-CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Windows-CI.yml b/.github/workflows/Windows-CI.yml index c68102a5ae..be29c00fba 100644 --- a/.github/workflows/Windows-CI.yml +++ b/.github/workflows/Windows-CI.yml @@ -83,7 +83,7 @@ jobs: !${{ env.VCPKG_ROOT }}/installed # The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used. key: | - ${{ os.release }}-${{ hashFiles( './engine/vcpkg.json' )}} + ${{ matrix.os }}-${{ hashFiles( './engine/vcpkg.json' )}} - name: install-vcpkg if: steps.cache.outputs.cache-hit != 'true'