From 003eb2d1488094b9f3a52a2081c76aa37dd6dc15 Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Sun, 18 Aug 2024 22:32:50 -0400 Subject: [PATCH 1/8] [ci] Add new double builds --- .github/workflows/build.yml | 63 ++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 36a681b8..63e4d72f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,49 +11,52 @@ concurrency: jobs: build: + name: ${{ matrix.name }} + runs-on: ${{ matrix.runner }} strategy: fail-fast: false matrix: include: - - identifier: linux-release - name: 🐧 Linux - build_type: Release + - name: 🐧 Linux + identifier: linux-release + runner: ubuntu-20.04 + platform: linux + arch: x86_64 + precision: single + + - name: 🐧 Linux (Double Precision) + identifier: linux-double-release runner: ubuntu-20.04 - target: template_release platform: linux arch: x86_64 + precision: double - - identifier: windows-release - name: 🪟 Windows - build_type: Release + - name: 🪟 Windows + identifier: windows-release runner: windows-latest - target: template_release platform: windows arch: x86_64 + precision: single - - identifier: macos-release - name: 🍎 MacOS - build_type: Release + - name: 🍎 MacOS + identifier: macos-release runner: macos-latest - target: template_release platform: macos + precision: single - - identifier: android-arm64 - name: 🤖 Android (arm64) - build_type: Release + - name: 🤖 Android (arm64) + identifier: android-arm64 runner: ubuntu-20.04 platform: arm64-v8a arch: arm64-v8a + precision: single - - identifier: android-arm32 - name: 🤖 Android (arm32) - build_type: Release + - name: 🤖 Android (arm32) + identifier: android-arm32 runner: ubuntu-20.04 platform: armeabi-v7a arch: armeabi-v7a - - runs-on: ${{ matrix.runner }} - name: ${{ matrix.name }} + precision: single steps: @@ -86,10 +89,26 @@ jobs: with: key: ccache-${{ matrix.identifier }} + - name: Compile Godot (Double Precision) + if: ${{ matrix.precision == 'double' }} + shell: sh + working-directory: ./extern/godot-engine + run: | + scons precision=double -j 18 + ./godot.linux.editor.double.x86_64 --dump-gdextension-interface + ./godot.linux.editor.double.x86_64 --dump-extension-api + + - name: Prepare double precision + if: ${{ matrix.precision == 'double' }} + shell: sh + run: | + cp 'extern/godot-engine/bin/extension_api.json' 'extern/godot-cpp/gdextension/extension_api.json' + cp 'extern/godot-engine/bin/gdextension_interface.h' 'extern/godot-cpp/gdextension/gdextension_interface.h' + - name: Generate Build Files (${{ matrix.identifier }}) shell: sh run: | - cmake -B '${{ github.workspace }}/.out-${{ matrix.identifier }}' --preset ${{ matrix.platform }} -S '${{ github.workspace }}' + cmake -B '${{ github.workspace }}/.out-${{ matrix.identifier }}' --preset ${{ matrix.platform }} -S '${{ github.workspace }}' -DFLOAT_PRECISION=${{ matrix.precision }} - name: Build Orchestrator (${{ matrix.identifier }}) shell: sh From 09e3c4ebaf38971a4d7d1fa4b50a00ec2d290e26 Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Sun, 18 Aug 2024 23:16:58 -0400 Subject: [PATCH 2/8] [ci] Fix build --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63e4d72f..60368abe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,9 +94,9 @@ jobs: shell: sh working-directory: ./extern/godot-engine run: | - scons precision=double -j 18 - ./godot.linux.editor.double.x86_64 --dump-gdextension-interface - ./godot.linux.editor.double.x86_64 --dump-extension-api + scons precision=double + ./godot.linuxbsd.editor.double.x86_64 --dump-gdextension-interface + ./godot.linuxbsd.editor.double.x86_64 --dump-extension-api - name: Prepare double precision if: ${{ matrix.precision == 'double' }} From 86aa0e6f1a33c8ca026b4ce86f3149f5a1175373 Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Sun, 18 Aug 2024 23:29:34 -0400 Subject: [PATCH 3/8] [ci] Add scons cache --- .github/workflows/build.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60368abe..be1634b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,12 +89,36 @@ jobs: with: key: ccache-${{ matrix.identifier }} + - name: Restore scons cache + if: ${{ matrix.precision == 'double' }} + uses: actions/cache/restore@v3 + with: + path: ${{ github.workspace }}/.scons-cache/ + key: ${{ matrix.identifier }}-scons-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ${{ matrix.identifier }}-scons-${{ github.ref }}-${{ github.sha }} + ${{ matrix.identifier }}-scons-${{ github.ref }} + ${{ matrix.identifier }}-scons + - name: Compile Godot (Double Precision) if: ${{ matrix.precision == 'double' }} shell: sh working-directory: ./extern/godot-engine run: | scons precision=double + + - name: Save scons cache + if: ${{ matrix.precision == 'double' }} + uses: actions/cache/save@v4 + with: + path: ${{ github.workspace }}/.scons-cache/ + key: ${{ matrix.identifier }}-scons-${{ github.ref }}-${{ github.sha }} + + - name: Dump API + if: ${{ matrix.precision == 'double' }} + shell: sh + working-directory: ./extern/godot-engine/bin + run: | ./godot.linuxbsd.editor.double.x86_64 --dump-gdextension-interface ./godot.linuxbsd.editor.double.x86_64 --dump-extension-api From 893ad1159b0ab13b3aaf9333b319ab8b6f7b61aa Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Sun, 18 Aug 2024 23:33:00 -0400 Subject: [PATCH 4/8] [ci] Add env vars --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be1634b4..7f9b1848 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,6 +58,9 @@ jobs: arch: armeabi-v7a precision: single + env: + SCONS_CACHE: ${{ github.workspace }}/.scons-cache/ + steps: - name: Checkout project From dfaf97df9d8f8f609543aa2258d2eede3ec0c0b4 Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Mon, 19 Aug 2024 00:16:24 -0400 Subject: [PATCH 5/8] [ci] Try using `--headless` --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7f9b1848..a79328ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -122,8 +122,8 @@ jobs: shell: sh working-directory: ./extern/godot-engine/bin run: | - ./godot.linuxbsd.editor.double.x86_64 --dump-gdextension-interface - ./godot.linuxbsd.editor.double.x86_64 --dump-extension-api + ./godot.linuxbsd.editor.double.x86_64 --headless --dump-gdextension-interface + ./godot.linuxbsd.editor.double.x86_64 --headless --dump-extension-api - name: Prepare double precision if: ${{ matrix.precision == 'double' }} From f31715c2d77975f9f6da06fdefcca096a2bdeee5 Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Mon, 19 Aug 2024 00:39:21 -0400 Subject: [PATCH 6/8] [ci] tag double builds --- CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c49da96b..d82fd2d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,8 @@ SET(GDEXTENSION_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/project/addons/orchestrato # ADD_COMPILE_DEFINITIONS(HOT_RELOAD_ENABLED) add_compile_definitions(TOOLS_ENABLED) +set(FLOAT_PRECISION "single" CACHE STRING "") + OPTION( AUTOFORMAT_SRC_ON_CONFIGURE "If enabled, clang-format will be used to format all sources in src/ during configuration" @@ -93,6 +95,10 @@ FILE(GLOB_RECURSE gdext_sources "${CMAKE_BINARY_DIR}/_generated/*.cpp" ) +if ("${FLOAT_PRECISION}" STREQUAL "double") + add_compile_definitions(REAL_T_IS_DOUBLE) +endif() + # GDExtension library ADD_LIBRARY(${PROJECT_NAME} SHARED ${gdext_sources}) @@ -104,6 +110,7 @@ TARGET_COMPILE_OPTIONS(${PROJECT_NAME} PUBLIC $<${compiler_is_msvc}: /EHsc /utf-8 + $<$:/DREAL_T_IS_DOUBLE> /Zc:preprocessor /wd5054 # operator '|' deprecated between enumerations of different types $<$: @@ -186,7 +193,11 @@ ELSE () ENDIF () ENDIF () -STRING(TOLOWER "${PROJECT_NAME}.${CMAKE_SYSTEM_NAME}.${system_bits}.${CMAKE_BUILD_TYPE}" gde_lib_name) +if ("${FLOAT_PRECISION}" STREQUAL "double") + STRING(TOLOWER "${PROJECT_NAME}.${CMAKE_SYSTEM_NAME}.${system_bits}.double.${CMAKE_BUILD_TYPE}" gde_lib_name) +ELSE () + STRING(TOLOWER "${PROJECT_NAME}.${CMAKE_SYSTEM_NAME}.${system_bits}.${CMAKE_BUILD_TYPE}" gde_lib_name) +ENDIF () # Generate library resource IF(WIN32) From ee8d89231c88278c2dcf788173817700f0115cc7 Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Mon, 19 Aug 2024 00:48:18 -0400 Subject: [PATCH 7/8] Bump actions/cache/restore from v3 to v4 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a79328ef..74ddb91f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,7 +94,7 @@ jobs: - name: Restore scons cache if: ${{ matrix.precision == 'double' }} - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: ${{ github.workspace }}/.scons-cache/ key: ${{ matrix.identifier }}-scons-${{ github.ref }}-${{ github.sha }} From 3bbd3b3d68eed3959f0f3d5b15b3cce6cbda6f2d Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Mon, 19 Aug 2024 01:04:48 -0400 Subject: [PATCH 8/8] Does this make Godot an official build? --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 74ddb91f..cf78f0b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,6 +60,7 @@ jobs: env: SCONS_CACHE: ${{ github.workspace }}/.scons-cache/ + BUILD_NAME: official steps: