From 19cd8f1ac8fa546c78baf967c0fb0c87ef829b76 Mon Sep 17 00:00:00 2001 From: Stephen G Tuggy Date: Fri, 10 Jan 2025 16:42:25 -0800 Subject: [PATCH 1/7] CMakeLists.txt, CMakePresets.json: Introduce PythonInstalledVia --- engine/CMakeLists.txt | 11 ++++++++++- engine/CMakePresets.json | 6 ++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index 0e320e9d25..1cc504aff2 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -341,7 +341,16 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${Vega_Strike_SOURCE_DIR}) # so that we can handle the special cases for Xenial and stretch FIND_PACKAGE(LinuxDistro REQUIRED) -FIND_PACKAGE(Python3 REQUIRED COMPONENTS Development Interpreter) +SET(PythonInstalledVia "" CACHE STRING "How Python was installed, such as via Homebrew or MacPorts") + +IF (${PythonInstalledVia} STREQUAL "Homebrew" OR ${PythonInstalledVia} STREQUAL "Brew") + FIND_PACKAGE(Python3 3.13.1 EXACT REQUIRED COMPONENTS Development Interpreter) +ELSEIF (${PythonInstalledVia} STREQUAL "MacPorts" OR ${PythonInstalledVia} STREQUAL "Port") + FIND_PACKAGE(Python3 3.12.8 EXACT REQUIRED COMPONENTS Development Interpreter) +ELSE () + FIND_PACKAGE(Python3 3.7...3.13 REQUIRED COMPONENTS Development Interpreter) +ENDIF () + MESSAGE(STATUS "Python library : ${Python3_LIBRARIES} (${Python3_VERSION})") MESSAGE(STATUS "Python include dir : ${Python3_INCLUDE_DIRS}") IF (Python3_FOUND) diff --git a/engine/CMakePresets.json b/engine/CMakePresets.json index 1d2b5964f2..d5d06867c9 100644 --- a/engine/CMakePresets.json +++ b/engine/CMakePresets.json @@ -279,7 +279,8 @@ }, "cacheVariables": { "CMAKE_PREFIX_PATH": "/usr/local", - "CMAKE_FIND_FRAMEWORK": "LAST" + "CMAKE_FIND_FRAMEWORK": "LAST", + "PythonInstalledVia": "Homebrew" } }, { @@ -382,7 +383,8 @@ "cacheVariables": { "CMAKE_PREFIX_PATH": "/opt/local", "Boost_INCLUDE_DIR": "/opt/local/libexec/boost/1.81/include", - "CMAKE_FIND_FRAMEWORK": "LAST" + "CMAKE_FIND_FRAMEWORK": "LAST", + "PythonInstalledVia": "MacPorts" } }, { From 5b5c65b1b7839a329b4cd539f864858e6e35d275 Mon Sep 17 00:00:00 2001 From: Stephen G Tuggy Date: Fri, 10 Jan 2025 17:24:19 -0800 Subject: [PATCH 2/7] macos-{ci,release}.yml: Forgot to add value for `PythonInstalledVia` --- .github/workflows/macos-ci.yml | 2 +- .github/workflows/macos-release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos-ci.yml b/.github/workflows/macos-ci.yml index 1691995a48..3d6d10a019 100644 --- a/.github/workflows/macos-ci.yml +++ b/.github/workflows/macos-ci.yml @@ -94,7 +94,7 @@ jobs: env: MY_OS_NAME: macos COMPILER: ${{ matrix.compiler }} - FLAGS: "-DCMAKE_FIND_FRAMEWORK=LAST -DENABLE_PIE=${{ matrix.ENABLE_PIE }} -DPython3_ROOT_DIR=${{ matrix.vega-py-setup.outputs.python-path }}" + FLAGS: "-DCMAKE_FIND_FRAMEWORK=LAST -DENABLE_PIE=${{ matrix.ENABLE_PIE }} -DPython3_ROOT_DIR=${{ matrix.vega-py-setup.outputs.python-path }} -DPythonInstalledVia=Homebrew" OPENALDIR: "$(brew --prefix)/opt/openal-soft" Python3_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }} Python_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }} diff --git a/.github/workflows/macos-release.yml b/.github/workflows/macos-release.yml index 62c9f657a6..60bb60b0cc 100644 --- a/.github/workflows/macos-release.yml +++ b/.github/workflows/macos-release.yml @@ -100,7 +100,7 @@ jobs: env: MY_OS_NAME: macos COMPILER: ${{ matrix.compiler }} - FLAGS: "-DCMAKE_FIND_FRAMEWORK=LAST -DENABLE_PIE=${{ matrix.ENABLE_PIE }} -DPython3_ROOT_DIR=${{ matrix.vega-py-setup.outputs.python-path }}" + FLAGS: "-DCMAKE_FIND_FRAMEWORK=LAST -DENABLE_PIE=${{ matrix.ENABLE_PIE }} -DPython3_ROOT_DIR=${{ matrix.vega-py-setup.outputs.python-path }} -DPythonInstalledVia=Homebrew" OPENALDIR: "$(brew --prefix)/opt/openal-soft" Python3_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }} Python_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }} From 69ea22dbd2bef80ca995d19d26f8a86ece78c04c Mon Sep 17 00:00:00 2001 From: Stephen G Tuggy Date: Fri, 10 Jan 2025 17:32:06 -0800 Subject: [PATCH 3/7] ... --- engine/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index 1cc504aff2..ed5e921dbb 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -343,9 +343,9 @@ FIND_PACKAGE(LinuxDistro REQUIRED) SET(PythonInstalledVia "" CACHE STRING "How Python was installed, such as via Homebrew or MacPorts") -IF (${PythonInstalledVia} STREQUAL "Homebrew" OR ${PythonInstalledVia} STREQUAL "Brew") +IF (PythonInstalledVia STREQUAL "Homebrew") FIND_PACKAGE(Python3 3.13.1 EXACT REQUIRED COMPONENTS Development Interpreter) -ELSEIF (${PythonInstalledVia} STREQUAL "MacPorts" OR ${PythonInstalledVia} STREQUAL "Port") +ELSEIF (PythonInstalledVia STREQUAL "MacPorts") FIND_PACKAGE(Python3 3.12.8 EXACT REQUIRED COMPONENTS Development Interpreter) ELSE () FIND_PACKAGE(Python3 3.7...3.13 REQUIRED COMPONENTS Development Interpreter) From 77c273acc15a3af7e890d8e88f88e3bdc01a1554 Mon Sep 17 00:00:00 2001 From: Stephen G Tuggy Date: Fri, 10 Jan 2025 22:07:40 -0800 Subject: [PATCH 4/7] More on GitHub Actions --- .github/workflows/Windows-CI.yml | 6 +++--- .github/workflows/Windows-Release.yml | 6 +++--- .github/workflows/codeql.yml | 2 +- .github/workflows/fortify-on-demand-scan.yml | 2 +- .github/workflows/gh-actions-pr.yml | 2 +- .github/workflows/gh-actions-release.yml | 2 +- .github/workflows/macos-ci.yml | 2 +- .github/workflows/macos-release.yml | 1 + .github/workflows/scorecards-analysis.yml | 2 +- 9 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/Windows-CI.yml b/.github/workflows/Windows-CI.yml index de390c2518..c1ca89d296 100644 --- a/.github/workflows/Windows-CI.yml +++ b/.github/workflows/Windows-CI.yml @@ -64,15 +64,15 @@ jobs: shell: bash - name: install-cmake - uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa #v3.29.2 + uses: lukka/get-cmake@acb35cf920333f4dc3fc4f424f1b30d5e7d561b4 #v3.31.4 with: - cmakeVersion: 3.29.2 + cmakeVersion: 3.31.4 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@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2 + uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 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. diff --git a/.github/workflows/Windows-Release.yml b/.github/workflows/Windows-Release.yml index 2a9aa35d6d..ae892d30ee 100644 --- a/.github/workflows/Windows-Release.yml +++ b/.github/workflows/Windows-Release.yml @@ -75,15 +75,15 @@ jobs: shell: bash - name: install-cmake - uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa #v3.29.2 + uses: lukka/get-cmake@acb35cf920333f4dc3fc4f424f1b30d5e7d561b4 #v3.31.4 with: - cmakeVersion: 3.29.2 + cmakeVersion: 3.31.4 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@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2 + uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 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. diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5390b6d9a4..aa48477d01 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -12,7 +12,7 @@ on: jobs: analyze: name: Analyze - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: fail-fast: false diff --git a/.github/workflows/fortify-on-demand-scan.yml b/.github/workflows/fortify-on-demand-scan.yml index c1444ecd8f..ec278b8f38 100644 --- a/.github/workflows/fortify-on-demand-scan.yml +++ b/.github/workflows/fortify-on-demand-scan.yml @@ -11,7 +11,7 @@ on: jobs: scan: # The type of runner that the job will run on - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/.github/workflows/gh-actions-pr.yml b/.github/workflows/gh-actions-pr.yml index 0686cc69fc..c4f596bca4 100644 --- a/.github/workflows/gh-actions-pr.yml +++ b/.github/workflows/gh-actions-pr.yml @@ -5,7 +5,7 @@ on: [ pull_request ] jobs: build: name: Build - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 continue-on-error: ${{ matrix.allow_failure }} defaults: diff --git a/.github/workflows/gh-actions-release.yml b/.github/workflows/gh-actions-release.yml index d65bf8f00c..abdd8d39c0 100644 --- a/.github/workflows/gh-actions-release.yml +++ b/.github/workflows/gh-actions-release.yml @@ -9,7 +9,7 @@ on: jobs: build: name: Build - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 continue-on-error: true defaults: diff --git a/.github/workflows/macos-ci.yml b/.github/workflows/macos-ci.yml index 3d6d10a019..6eb685343f 100644 --- a/.github/workflows/macos-ci.yml +++ b/.github/workflows/macos-ci.yml @@ -11,7 +11,7 @@ jobs: build: name: Build runs-on: ${{ matrix.os }} - continue-on-error: true + continue-on-error: false defaults: run: diff --git a/.github/workflows/macos-release.yml b/.github/workflows/macos-release.yml index 60bb60b0cc..39281c20e4 100644 --- a/.github/workflows/macos-release.yml +++ b/.github/workflows/macos-release.yml @@ -13,6 +13,7 @@ jobs: build: name: Build runs-on: ${{ matrix.os }} + continue-on-error: true defaults: run: diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index a09879717b..14ed8c1516 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -13,7 +13,7 @@ permissions: read-all jobs: analysis: name: Scorecards analysis - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: # Needed to upload the results to code-scanning dashboard. security-events: write From bf34d66c7ce4e2a0ade803dc6ee3ff6f64bcf397 Mon Sep 17 00:00:00 2001 From: Stephen G Tuggy Date: Fri, 10 Jan 2025 22:29:51 -0800 Subject: [PATCH 5/7] CMakeLists.txt: Fix Python version issue on Fedora 41 --- engine/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index ed5e921dbb..305c1325da 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -348,7 +348,7 @@ IF (PythonInstalledVia STREQUAL "Homebrew") ELSEIF (PythonInstalledVia STREQUAL "MacPorts") FIND_PACKAGE(Python3 3.12.8 EXACT REQUIRED COMPONENTS Development Interpreter) ELSE () - FIND_PACKAGE(Python3 3.7...3.13 REQUIRED COMPONENTS Development Interpreter) + FIND_PACKAGE(Python3 3.7...<3.14 REQUIRED COMPONENTS Development Interpreter) ENDIF () MESSAGE(STATUS "Python library : ${Python3_LIBRARIES} (${Python3_VERSION})") From db9b1a7682fa6275e8fb245163475731975ff8a0 Mon Sep 17 00:00:00 2001 From: "Stephen G. Tuggy" Date: Sat, 11 Jan 2025 13:04:48 -0800 Subject: [PATCH 6/7] engine/CMakeLists.txt: Allow Python 3.6 for 0.9.x, for compatibility with openSUSE 15.6 --- engine/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index 305c1325da..f517d4e2e5 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -348,7 +348,7 @@ IF (PythonInstalledVia STREQUAL "Homebrew") ELSEIF (PythonInstalledVia STREQUAL "MacPorts") FIND_PACKAGE(Python3 3.12.8 EXACT REQUIRED COMPONENTS Development Interpreter) ELSE () - FIND_PACKAGE(Python3 3.7...<3.14 REQUIRED COMPONENTS Development Interpreter) + FIND_PACKAGE(Python3 3.6...<3.14 REQUIRED COMPONENTS Development Interpreter) ENDIF () MESSAGE(STATUS "Python library : ${Python3_LIBRARIES} (${Python3_VERSION})") From 208af777e555342df334cd031b06b07d766ecfef Mon Sep 17 00:00:00 2001 From: "Stephen G. Tuggy" Date: Sat, 11 Jan 2025 13:20:01 -0800 Subject: [PATCH 7/7] macos-{ci,release}.yml: Specify build type, RelWithDebInfo --- .github/workflows/macos-ci.yml | 4 +++- .github/workflows/macos-release.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos-ci.yml b/.github/workflows/macos-ci.yml index 6eb685343f..6c4ae0388d 100644 --- a/.github/workflows/macos-ci.yml +++ b/.github/workflows/macos-ci.yml @@ -41,6 +41,8 @@ jobs: ENABLE_PIE: - 'ON' #- 'OFF' + build-type: + - RelWithDebInfo steps: @@ -94,7 +96,7 @@ jobs: env: MY_OS_NAME: macos COMPILER: ${{ matrix.compiler }} - FLAGS: "-DCMAKE_FIND_FRAMEWORK=LAST -DENABLE_PIE=${{ matrix.ENABLE_PIE }} -DPython3_ROOT_DIR=${{ matrix.vega-py-setup.outputs.python-path }} -DPythonInstalledVia=Homebrew" + FLAGS: "-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_FIND_FRAMEWORK=LAST -DENABLE_PIE=${{ matrix.ENABLE_PIE }} -DPython3_ROOT_DIR=${{ matrix.vega-py-setup.outputs.python-path }} -DPythonInstalledVia=Homebrew" OPENALDIR: "$(brew --prefix)/opt/openal-soft" Python3_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }} Python_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }} diff --git a/.github/workflows/macos-release.yml b/.github/workflows/macos-release.yml index 39281c20e4..ef1cf9bf2e 100644 --- a/.github/workflows/macos-release.yml +++ b/.github/workflows/macos-release.yml @@ -43,6 +43,8 @@ jobs: ENABLE_PIE: - 'ON' #- 'OFF' + build-type: + - RelWithDebInfo steps: @@ -101,7 +103,7 @@ jobs: env: MY_OS_NAME: macos COMPILER: ${{ matrix.compiler }} - FLAGS: "-DCMAKE_FIND_FRAMEWORK=LAST -DENABLE_PIE=${{ matrix.ENABLE_PIE }} -DPython3_ROOT_DIR=${{ matrix.vega-py-setup.outputs.python-path }} -DPythonInstalledVia=Homebrew" + FLAGS: "-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_FIND_FRAMEWORK=LAST -DENABLE_PIE=${{ matrix.ENABLE_PIE }} -DPython3_ROOT_DIR=${{ matrix.vega-py-setup.outputs.python-path }} -DPythonInstalledVia=Homebrew" OPENALDIR: "$(brew --prefix)/opt/openal-soft" Python3_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }} Python_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }}