From e6522a4e1c9b334982f2a7a5f75df8c7728c8c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 24 Apr 2025 18:14:03 +0200 Subject: [PATCH] CI: Sync configuration with 4.4 branch Includes cherry-picks of warning fixes from a44f691fc7174c8aa75bdc3b0c120213a2ce55dc and 8d1462c7484dd3fe55500d84268b0ad1048b9a7c. --- .github/actions/download-artifact/action.yml | 8 +- .github/actions/godot-api-dump/action.yml | 23 ---- .github/actions/godot-build/action.yml | 18 ++-- .../actions/godot-cache-restore/action.yml | 19 ++-- .github/actions/godot-cache-save/action.yml | 11 +- .../actions/godot-converter-test/action.yml | 4 +- .github/actions/godot-cpp-build/action.yml | 40 +++++++ .github/actions/godot-deps/action.yml | 11 +- .github/actions/godot-project-test/action.yml | 4 +- .github/actions/upload-artifact/action.yml | 8 +- .github/workflows/android_builds.yml | 10 +- .github/workflows/godot_cpp_test.yml | 58 ---------- .github/workflows/ios_builds.yml | 10 +- .github/workflows/linux_builds.yml | 102 +++++++++++------- .github/workflows/macos_builds.yml | 20 ++-- .github/workflows/runner.yml | 25 +---- .github/workflows/static_checks.yml | 21 ++-- .github/workflows/web_builds.yml | 18 ++-- .github/workflows/windows_builds.yml | 41 ++++--- core/io/http_client_tcp.cpp | 7 +- core/io/packet_peer_udp.cpp | 18 ++++ core/io/stream_peer.cpp | 4 +- drivers/d3d12/SCsub | 6 ++ drivers/d3d12/dxil_hash.cpp | 2 +- .../d3d12/rendering_device_driver_d3d12.cpp | 9 +- scene/2d/tile_map.cpp | 3 +- 26 files changed, 256 insertions(+), 244 deletions(-) delete mode 100644 .github/actions/godot-api-dump/action.yml create mode 100644 .github/actions/godot-cpp-build/action.yml delete mode 100644 .github/workflows/godot_cpp_test.yml diff --git a/.github/actions/download-artifact/action.yml b/.github/actions/download-artifact/action.yml index 534b3251c5c..c2a3d777c41 100644 --- a/.github/actions/download-artifact/action.yml +++ b/.github/actions/download-artifact/action.yml @@ -1,15 +1,17 @@ name: Download Godot artifact description: Download the Godot artifact. + inputs: name: description: The artifact name. - default: "${{ github.job }}" + default: ${{ github.job }} path: description: The path to download and extract to. required: true - default: "./" + default: ./ + runs: - using: "composite" + using: composite steps: - name: Download Godot Artifact uses: actions/download-artifact@v4 diff --git a/.github/actions/godot-api-dump/action.yml b/.github/actions/godot-api-dump/action.yml deleted file mode 100644 index 77306886617..00000000000 --- a/.github/actions/godot-api-dump/action.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Dump Godot API -description: Dump Godot API for GDExtension -inputs: - bin: - description: The path to the Godot executable - required: true -runs: - using: "composite" - steps: - # Dump GDExtension interface and API - - name: Dump GDExtension interface and API for godot-cpp build - shell: sh - run: | - ${{ inputs.bin }} --headless --dump-gdextension-interface --dump-extension-api - mkdir godot-api - cp -f gdextension_interface.h godot-api/ - cp -f extension_api.json godot-api/ - - - name: Upload API dump - uses: ./.github/actions/upload-artifact - with: - name: 'godot-api-dump' - path: './godot-api/*' diff --git a/.github/actions/godot-build/action.yml b/.github/actions/godot-build/action.yml index bf29b7e430a..0b502035fe6 100644 --- a/.github/actions/godot-build/action.yml +++ b/.github/actions/godot-build/action.yml @@ -1,34 +1,38 @@ name: Build Godot description: Build Godot with the provided options. + inputs: target: description: Build target (editor, template_release, template_debug). - default: "editor" + default: editor tests: description: Unit tests. default: false + required: false platform: description: Target platform. required: false sconsflags: + description: Additional SCons flags. default: "" + required: false scons-cache: description: The SCons cache path. - default: "${{ github.workspace }}/.scons-cache/" + default: ${{ github.workspace }}/.scons_cache/ scons-cache-limit: description: The SCons cache size limit. # actions/cache has 10 GiB limit, and GitHub runners have a 14 GiB disk. # Limit to 7 GiB to avoid having the extracted cache fill the disk. default: 7168 runs: - using: "composite" + using: composite steps: - - name: Scons Build + - name: SCons Build shell: sh env: - SCONSFLAGS: ${{ inputs.sconsflags }} - SCONS_CACHE: ${{ inputs.scons-cache }} - SCONS_CACHE_LIMIT: ${{ inputs.scons-cache-limit }} + SCONSFLAGS: ${{ inputs.sconsflags }} + SCONS_CACHE: ${{ inputs.scons-cache }} + SCONS_CACHE_LIMIT: ${{ inputs.scons-cache-limit }} run: | echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }} diff --git a/.github/actions/godot-cache-restore/action.yml b/.github/actions/godot-cache-restore/action.yml index eb955affef9..2e07e936319 100644 --- a/.github/actions/godot-cache-restore/action.yml +++ b/.github/actions/godot-cache-restore/action.yml @@ -3,18 +3,19 @@ description: Restore Godot build cache. inputs: cache-name: description: The cache base name (job name by default). - default: "${{github.job}}" + default: ${{ github.job }} scons-cache: description: The SCons cache path. - default: "${{github.workspace}}/.scons-cache/" + default: ${{ github.workspace }}/.scons_cache/ + runs: - using: "composite" + using: composite steps: - name: Restore SCons cache directory uses: actions/cache/restore@v4 with: - path: ${{inputs.scons-cache}} - key: ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}} + path: ${{ inputs.scons-cache }} + key: ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }} # We try to match an existing cache to restore from it. Each potential key is checked against # all existing caches as a prefix. E.g. 'linux-template-minimal' would match any cache that @@ -28,7 +29,7 @@ runs: # 4. A partial match for the same base branch only (not ideal, matches any PR with the same base branch). restore-keys: | - ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}} - ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}} - ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-refs/heads/${{env.GODOT_BASE_BRANCH}} - ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}} + ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }} + ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }} + ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-refs/heads/${{ env.GODOT_BASE_BRANCH }} + ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }} diff --git a/.github/actions/godot-cache-save/action.yml b/.github/actions/godot-cache-save/action.yml index b7cbf91f94f..42aa836406f 100644 --- a/.github/actions/godot-cache-save/action.yml +++ b/.github/actions/godot-cache-save/action.yml @@ -3,15 +3,16 @@ description: Save Godot build cache. inputs: cache-name: description: The cache base name (job name by default). - default: "${{github.job}}" + default: ${{ github.job }} scons-cache: description: The SCons cache path. - default: "${{github.workspace}}/.scons-cache/" + default: ${{ github.workspace }}/.scons_cache/ + runs: - using: "composite" + using: composite steps: - name: Save SCons cache directory uses: actions/cache/save@v4 with: - path: ${{inputs.scons-cache}} - key: ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}} + path: ${{ inputs.scons-cache }} + key: ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }} diff --git a/.github/actions/godot-converter-test/action.yml b/.github/actions/godot-converter-test/action.yml index 919a76e6937..ffd558d98b1 100644 --- a/.github/actions/godot-converter-test/action.yml +++ b/.github/actions/godot-converter-test/action.yml @@ -1,11 +1,13 @@ name: Test Godot project converter description: Test the Godot project converter. + inputs: bin: description: The path to the Godot executable required: true + runs: - using: "composite" + using: composite steps: - name: Test 3-to-4 conversion shell: sh diff --git a/.github/actions/godot-cpp-build/action.yml b/.github/actions/godot-cpp-build/action.yml new file mode 100644 index 00000000000..1046f09470e --- /dev/null +++ b/.github/actions/godot-cpp-build/action.yml @@ -0,0 +1,40 @@ +name: Build godot-cpp +description: Build godot-cpp with the provided options. + +inputs: + bin: + description: Path to the Godot binary. + required: true + type: string + scons-flags: + description: Additional SCons flags. + type: string + scons-cache: + description: The SCons cache path. + default: ${{ github.workspace }}/.scons_cache/ + type: string + godot-cpp-branch: + description: The godot-cpp branch. + default: master + type: string + +runs: + using: composite + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + repository: godotengine/godot-cpp + ref: ${{ inputs.godot-cpp-branch }} + path: godot-cpp + + - name: Extract API + shell: sh + run: ${{ inputs.bin }} --headless --dump-gdextension-interface --dump-extension-api + + - name: SCons Build + shell: sh + env: + SCONS_CACHE: ${{ inputs.scons-cache }} + run: scons --directory=./godot-cpp/test "gdextension_dir=${{ github.workspace }}" ${{ inputs.scons-flags }} diff --git a/.github/actions/godot-deps/action.yml b/.github/actions/godot-deps/action.yml index 99404657c63..3344323fd48 100644 --- a/.github/actions/godot-deps/action.yml +++ b/.github/actions/godot-deps/action.yml @@ -1,17 +1,19 @@ name: Setup Python and SCons description: Setup Python, install the pip version of SCons. + inputs: python-version: description: The Python version to use. - default: "3.x" + default: 3.x python-arch: description: The Python architecture. - default: "x64" + default: x64 scons-version: description: The SCons version to use. - default: "4.8.0" + default: 4.8.1 + runs: - using: "composite" + using: composite steps: - name: Set up Python 3.x uses: actions/setup-python@v5 @@ -25,6 +27,5 @@ runs: shell: bash run: | python -c "import sys; print(sys.version)" - python -m pip install wheel python -m pip install scons==${{ inputs.scons-version }} scons --version diff --git a/.github/actions/godot-project-test/action.yml b/.github/actions/godot-project-test/action.yml index fd8c024a37d..36448cd50ae 100644 --- a/.github/actions/godot-project-test/action.yml +++ b/.github/actions/godot-project-test/action.yml @@ -1,11 +1,13 @@ name: Test Godot project description: Run the test Godot project. + inputs: bin: description: The path to the Godot executable required: true + runs: - using: "composite" + using: composite steps: # Download and extract zip archive with project, folder is renamed to be able to easy change used project - name: Download test project diff --git a/.github/actions/upload-artifact/action.yml b/.github/actions/upload-artifact/action.yml index 80c680103d3..8524afdf593 100644 --- a/.github/actions/upload-artifact/action.yml +++ b/.github/actions/upload-artifact/action.yml @@ -1,15 +1,17 @@ name: Upload Godot artifact description: Upload the Godot artifact. + inputs: name: description: The artifact name. - default: "${{ github.job }}" + default: ${{ github.job }} path: description: The path to upload. required: true - default: "bin/*" + default: bin/* + runs: - using: "composite" + using: composite steps: - name: Upload Godot Artifact uses: actions/upload-artifact@v4 diff --git a/.github/workflows/android_builds.yml b/.github/workflows/android_builds.yml index 89c539e1f2e..320523d41f6 100644 --- a/.github/workflows/android_builds.yml +++ b/.github/workflows/android_builds.yml @@ -8,14 +8,11 @@ env: GODOT_BASE_BRANCH: 4.3 SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes -concurrency: - group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-android - cancel-in-progress: true - jobs: build-android: - runs-on: "ubuntu-20.04" + runs-on: ubuntu-24.04 name: ${{ matrix.name }} + timeout-minutes: 60 strategy: fail-fast: false matrix: @@ -39,7 +36,8 @@ jobs: sconsflags: arch=arm64 steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 with: submodules: recursive diff --git a/.github/workflows/godot_cpp_test.yml b/.github/workflows/godot_cpp_test.yml deleted file mode 100644 index 8c689734b7b..00000000000 --- a/.github/workflows/godot_cpp_test.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: 🪲 Godot CPP -on: - workflow_call: - -# Global Settings -env: - # Used for the cache key. Add version suffix to force clean build. - GODOT_BASE_BRANCH: 4.3 - # Used for the godot-cpp checkout. - GODOT_CPP_BRANCH: '4.2' - -concurrency: - group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-cpp-tests - cancel-in-progress: true - -jobs: - godot-cpp-tests: - runs-on: "ubuntu-20.04" - name: "Build and test Godot CPP" - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Setup Python and SCons - uses: ./.github/actions/godot-deps - - # Checkout godot-cpp - - name: Checkout godot-cpp - uses: actions/checkout@v4 - with: - repository: godotengine/godot-cpp - ref: ${{ env.GODOT_CPP_BRANCH }} - submodules: 'recursive' - path: 'godot-cpp' - - # Download generated API dump - - name: Download GDExtension interface and API dump - uses: ./.github/actions/download-artifact - with: - name: 'godot-api-dump' - path: './godot-api' - - # Extract and override existing files with generated files - - name: Extract GDExtension interface and API dump - run: | - cp -f godot-api/gdextension_interface.h godot-cpp/gdextension/ - cp -f godot-api/extension_api.json godot-cpp/gdextension/ - - # TODO: Add caching to the SCons build and store it for CI via the godot-cache - # action. - - # Build godot-cpp test extension - - name: Build godot-cpp test extension - run: | - cd godot-cpp/test - scons target=template_debug dev_build=yes - cd ../.. diff --git a/.github/workflows/ios_builds.yml b/.github/workflows/ios_builds.yml index 02609b2f03d..b4332d8d128 100644 --- a/.github/workflows/ios_builds.yml +++ b/.github/workflows/ios_builds.yml @@ -8,17 +8,15 @@ env: GODOT_BASE_BRANCH: 4.3 SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes -concurrency: - group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-ios - cancel-in-progress: true - jobs: ios-template: - runs-on: "macos-latest" + runs-on: macos-latest name: Template (target=template_release) + timeout-minutes: 60 steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 with: submodules: recursive diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index eb5865eee5b..e51a699a3d6 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -6,19 +6,18 @@ on: env: # Used for the cache key. Add version suffix to force clean build. GODOT_BASE_BRANCH: 4.3 + GODOT_CPP_BRANCH: 4.3 SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true TSAN_OPTIONS: suppressions=misc/error_suppressions/tsan.txt -concurrency: - group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-linux - cancel-in-progress: true - jobs: build-linux: - runs-on: "ubuntu-20.04" + # Stay one LTS before latest to increase portability of Linux artifacts. + runs-on: ubuntu-22.04 name: ${{ matrix.name }} + timeout-minutes: 120 strategy: fail-fast: false matrix: @@ -27,25 +26,25 @@ jobs: cache-name: linux-editor-mono target: editor sconsflags: module_mono_enabled=yes - bin: "./bin/godot.linuxbsd.editor.x86_64.mono" + bin: ./bin/godot.linuxbsd.editor.x86_64.mono build-mono: true tests: false # Disabled due freeze caused by mix Mono build and CI doc-test: true proj-conv: true api-compat: true artifact: true + # Validate godot-cpp compatibility on one arbitrary editor build. + godot-cpp: true - name: Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold) cache-name: linux-editor-double-sanitizers target: editor # Debug symbols disabled as they're huge on this build and we hit the 14 GB limit for runners. sconsflags: dev_build=yes scu_build=yes debug_symbols=no precision=double use_asan=yes use_ubsan=yes linker=gold - bin: "./bin/godot.linuxbsd.editor.dev.double.x86_64.san" + bin: ./bin/godot.linuxbsd.editor.dev.double.x86_64.san build-mono: false tests: true proj-test: true - # Generate an API dump for godot-cpp tests. - api-dump: true # Skip 2GiB artifact speeding up action. artifact: false @@ -53,7 +52,7 @@ jobs: cache-name: linux-editor-llvm-sanitizers target: editor sconsflags: dev_build=yes use_asan=yes use_ubsan=yes use_llvm=yes linker=lld - bin: "./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san" + bin: ./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san build-mono: false tests: true # Skip 2GiB artifact speeding up action. @@ -66,40 +65,50 @@ jobs: target: editor tests: true sconsflags: dev_build=yes use_tsan=yes use_llvm=yes linker=lld - bin: "./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san" + bin: ./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san build-mono: false # Skip 2GiB artifact speeding up action. artifact: false - - name: Template w/ Mono (target=template_release) + - name: Template w/ Mono, release (target=template_release, tests=yes) cache-name: linux-template-mono target: template_release - sconsflags: module_mono_enabled=yes tests=yes - bin: "./bin/godot.linuxbsd.template_release.x86_64.mono" + sconsflags: module_mono_enabled=yes + bin: ./bin/godot.linuxbsd.template_release.x86_64.mono build-mono: false tests: true artifact: true - - name: Minimal template (target=template_release, everything disabled) + - name: Template w/ Mono, debug (target=template_debug, tests=yes) + cache-name: linux-template-mono-debug + target: template_debug + sconsflags: module_mono_enabled=yes + bin: ./bin/godot.linuxbsd.template_debug.x86_64.mono + build-mono: false + tests: true + artifact: true + + - name: Minimal template (target=template_release, tests=yes, everything disabled) cache-name: linux-template-minimal target: template_release - sconsflags: modules_enabled_by_default=no disable_3d=yes disable_advanced_gui=yes deprecated=no minizip=no tests=yes - bin: "./bin/godot.linuxbsd.template_release.x86_64" + sconsflags: modules_enabled_by_default=no disable_3d=yes disable_advanced_gui=yes deprecated=no minizip=no + bin: ./bin/godot.linuxbsd.template_release.x86_64 tests: true artifact: true steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 with: submodules: recursive # Need newer mesa for lavapipe to work properly. - name: Linux dependencies for tests - if: ${{ matrix.proj-test }} + if: matrix.proj-test run: | sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB8B81E14DA65431D7504EA8F63F0F2B90935439 - sudo add-apt-repository "deb https://ppa.launchpadcontent.net/kisak/turtle/ubuntu focal main" + sudo add-apt-repository "deb https://ppa.launchpadcontent.net/kisak/turtle/ubuntu jammy main" sudo apt-get install -qq mesa-vulkan-drivers # TODO: Figure out somehow how to embed this one. @@ -120,20 +129,32 @@ jobs: continue-on-error: true - name: Setup Python and SCons - if: ${{ ! matrix.legacy-scons }} + if: "!matrix.legacy-scons" uses: ./.github/actions/godot-deps - name: Setup Python and SCons (legacy versions) - if: ${{ matrix.legacy-scons }} + if: matrix.legacy-scons uses: ./.github/actions/godot-deps with: # Sync with Ensure*Version in SConstruct. - python-version: 3.6 + python-version: 3.8 # No Python < 3.8 available for Ubuntu 22.04. scons-version: 3.1.2 - name: Setup GCC problem matcher uses: ammaraskar/gcc-problem-matcher@master + - name: Force remove preinstalled .NET SDKs + if: matrix.build-mono + run: | + sudo rm -rf /usr/share/dotnet/sdk/* + + - name: Setup older .NET SDK as baseline + if: matrix.build-mono + uses: actions/setup-dotnet@v4 + with: + # Targeting the oldest version we want to support to ensure it still builds. + dotnet-version: 8.0.100 + - name: Compilation uses: ./.github/actions/godot-build with: @@ -142,6 +163,14 @@ jobs: target: ${{ matrix.target }} tests: ${{ matrix.tests }} + - name: Compilation (godot-cpp) + uses: ./.github/actions/godot-cpp-build + if: matrix.godot-cpp + with: + bin: ${{ matrix.bin }} + scons-flags: target=template_debug dev_build=yes verbose=yes + godot-cpp-branch: ${{ env.GODOT_CPP_BRANCH }} + - name: Save Godot build cache uses: ./.github/actions/godot-cache-save with: @@ -149,48 +178,43 @@ jobs: continue-on-error: true - name: Generate C# glue - if: ${{ matrix.build-mono }} + if: matrix.build-mono run: | ${{ matrix.bin }} --headless --generate-mono-glue ./modules/mono/glue - name: Build .NET solutions - if: ${{ matrix.build-mono }} + if: matrix.build-mono run: | + dotnet --info ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd - name: Prepare artifact - if: ${{ matrix.artifact }} + if: matrix.artifact run: | strip bin/godot.* chmod +x bin/godot.* - name: Upload artifact uses: ./.github/actions/upload-artifact - if: ${{ matrix.artifact }} + if: matrix.artifact with: name: ${{ matrix.cache-name }} - - name: Dump Godot API - uses: ./.github/actions/godot-api-dump - if: ${{ matrix.api-dump }} - with: - bin: ${{ matrix.bin }} - - name: Unit tests - if: ${{ matrix.tests }} + if: matrix.tests run: | ${{ matrix.bin }} --version ${{ matrix.bin }} --help ${{ matrix.bin }} --headless --test --force-colors - name: .NET source generators tests - if: ${{ matrix.build-mono }} + if: matrix.build-mono run: | dotnet test modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests # Check class reference - name: Check for class reference updates - if: ${{ matrix.doc-test }} + if: matrix.doc-test run: | echo "Running --doctool to see if this changes the public API without updating the documentation." echo -e "If a diff is shown, it means that your code/doc changes are incomplete and you should update the class reference with --doctool.\n\n" @@ -199,20 +223,20 @@ jobs: # Check API backwards compatibility - name: Check for GDExtension compatibility - if: ${{ matrix.api-compat }} + if: matrix.api-compat run: | ./misc/scripts/validate_extension_api.sh "${{ matrix.bin }}" # Download and run the test project - name: Test Godot project uses: ./.github/actions/godot-project-test - if: ${{ matrix.proj-test }} + if: matrix.proj-test with: bin: ${{ matrix.bin }} # Test the project converter - name: Test project converter uses: ./.github/actions/godot-converter-test - if: ${{ matrix.proj-conv }} + if: matrix.proj-conv with: bin: ${{ matrix.bin }} diff --git a/.github/workflows/macos_builds.yml b/.github/workflows/macos_builds.yml index 1c12b7e3efd..290507fdac4 100644 --- a/.github/workflows/macos_builds.yml +++ b/.github/workflows/macos_builds.yml @@ -8,14 +8,11 @@ env: GODOT_BASE_BRANCH: 4.3 SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes -concurrency: - group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-macos - cancel-in-progress: true - jobs: build-macos: - runs-on: "macos-latest" + runs-on: macos-latest name: ${{ matrix.name }} + timeout-minutes: 120 strategy: fail-fast: false matrix: @@ -24,17 +21,18 @@ jobs: cache-name: macos-editor target: editor tests: true - bin: "./bin/godot.macos.editor.universal" + bin: ./bin/godot.macos.editor.universal - - name: Template (target=template_release) + - name: Template (target=template_release, tests=yes) cache-name: macos-template target: template_release tests: true - sconsflags: debug_symbols=no tests=yes - bin: "./bin/godot.macos.template_release.universal" + sconsflags: debug_symbols=no + bin: ./bin/godot.macos.template_release.universal steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 with: submodules: recursive @@ -86,7 +84,7 @@ jobs: name: ${{ matrix.cache-name }} - name: Unit tests - if: ${{ matrix.tests }} + if: matrix.tests run: | ${{ matrix.bin }} --version ${{ matrix.bin }} --help diff --git a/.github/workflows/runner.yml b/.github/workflows/runner.yml index 34b6af43074..c88d44a098d 100644 --- a/.github/workflows/runner.yml +++ b/.github/workflows/runner.yml @@ -1,65 +1,46 @@ name: 🔗 GHA -on: [push, pull_request] +on: [push, pull_request, merge_group] concurrency: - group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-runner + group: ${{ github.workflow }}|${{ github.ref_name }} cancel-in-progress: true jobs: # First stage: Only static checks, fast and prevent expensive builds from running. static-checks: - if: ${{ vars.DISABLE_GODOT_CI == '' }} + if: "!vars.DISABLE_GODOT_CI" name: 📊 Static checks uses: ./.github/workflows/static_checks.yml # Second stage: Run all the builds and some of the tests. android-build: - if: ${{ vars.DISABLE_GODOT_CI == '' }} name: 🤖 Android needs: static-checks uses: ./.github/workflows/android_builds.yml ios-build: - if: ${{ vars.DISABLE_GODOT_CI == '' }} name: 🍏 iOS needs: static-checks uses: ./.github/workflows/ios_builds.yml linux-build: - if: ${{ vars.DISABLE_GODOT_CI == '' }} name: 🐧 Linux needs: static-checks uses: ./.github/workflows/linux_builds.yml macos-build: - if: ${{ vars.DISABLE_GODOT_CI == '' }} name: 🍎 macOS needs: static-checks uses: ./.github/workflows/macos_builds.yml windows-build: - if: ${{ vars.DISABLE_GODOT_CI == '' }} name: 🏁 Windows needs: static-checks uses: ./.github/workflows/windows_builds.yml web-build: - if: ${{ vars.DISABLE_GODOT_CI == '' }} name: 🌐 Web needs: static-checks uses: ./.github/workflows/web_builds.yml - - # Third stage: Run auxiliary tests using build artifacts from previous jobs. - - # Can be turned off for PRs that intentionally break compat with godot-cpp, - # until both the upstream PR and the matching godot-cpp changes are merged. - godot-cpp-test: - if: ${{ vars.DISABLE_GODOT_CI == '' }} - name: 🪲 Godot CPP - # This can be changed to depend on another platform, if we decide to use it for - # godot-cpp instead. Make sure to move the .github/actions/godot-api-dump step - # appropriately. - needs: linux-build - uses: ./.github/workflows/godot_cpp_test.yml diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml index 9a8a4a8f191..68dcb1049b8 100644 --- a/.github/workflows/static_checks.yml +++ b/.github/workflows/static_checks.yml @@ -2,14 +2,11 @@ name: 📊 Static Checks on: workflow_call: -concurrency: - group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-static - cancel-in-progress: true - jobs: static-checks: name: Code style, file formatting, and docs - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 + timeout-minutes: 30 steps: - name: Checkout uses: actions/checkout@v4 @@ -17,9 +14,9 @@ jobs: fetch-depth: 2 - name: Install APT dependencies - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: libxml2-utils + run: | + sudo apt update + sudo apt install -y libxml2-utils - name: Install Python dependencies and general setup run: | @@ -48,7 +45,7 @@ jobs: - name: Style checks via pre-commit uses: pre-commit/action@v3.0.1 with: - extra_args: --verbose --files ${{ env.CHANGED_FILES }} + extra_args: --files ${{ env.CHANGED_FILES }} - name: Python builders checks via pytest run: | @@ -56,4 +53,8 @@ jobs: - name: Class reference schema checks run: | - xmllint --noout --schema doc/class.xsd doc/classes/*.xml modules/*/doc_classes/*.xml platform/*/doc_classes/*.xml + xmllint --quiet --noout --schema doc/class.xsd doc/classes/*.xml modules/*/doc_classes/*.xml platform/*/doc_classes/*.xml + + - name: Run C compiler on `gdextension_interface.h` + run: | + gcc -c core/extension/gdextension_interface.h diff --git a/.github/workflows/web_builds.yml b/.github/workflows/web_builds.yml index 73358f3785c..79147e28f9e 100644 --- a/.github/workflows/web_builds.yml +++ b/.github/workflows/web_builds.yml @@ -8,16 +8,12 @@ env: GODOT_BASE_BRANCH: 4.3 SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no use_closure_compiler=yes EM_VERSION: 3.1.64 - EM_CACHE_FOLDER: "emsdk-cache" - -concurrency: - group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-web - cancel-in-progress: true jobs: web-template: - runs-on: "ubuntu-22.04" + runs-on: ubuntu-24.04 name: ${{ matrix.name }} + timeout-minutes: 60 strategy: fail-fast: false matrix: @@ -37,16 +33,16 @@ jobs: artifact: true steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 with: submodules: recursive - name: Set up Emscripten latest uses: mymindstorm/setup-emsdk@v14 with: - version: ${{env.EM_VERSION}} - actions-cache-folder: ${{env.EM_CACHE_FOLDER}} - cache-key: emsdk-${{ matrix.cache-name }}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}} + version: ${{ env.EM_VERSION }} + no-cache: true - name: Verify Emscripten setup run: | @@ -77,6 +73,6 @@ jobs: - name: Upload artifact uses: ./.github/actions/upload-artifact - if: ${{ matrix.artifact }} + if: matrix.artifact with: name: ${{ matrix.cache-name }} diff --git a/.github/workflows/windows_builds.yml b/.github/workflows/windows_builds.yml index 44d7e007f50..431eac6434b 100644 --- a/.github/workflows/windows_builds.yml +++ b/.github/workflows/windows_builds.yml @@ -7,18 +7,15 @@ on: env: # Used for the cache key. Add version suffix to force clean build. GODOT_BASE_BRANCH: 4.3 - SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes d3d12=yes "angle_libs=${{github.workspace}}/" + SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes d3d12=yes "angle_libs=${{ github.workspace }}/" SCONS_CACHE_MSVC_CONFIG: true -concurrency: - group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-windows - cancel-in-progress: true - jobs: build-windows: # Windows 10 with latest image - runs-on: "windows-latest" + runs-on: windows-latest name: ${{ matrix.name }} + timeout-minutes: 120 strategy: fail-fast: false matrix: @@ -29,17 +26,29 @@ jobs: tests: true # Skip debug symbols, they're way too big with MSVC. sconsflags: debug_symbols=no vsproj=yes vsproj_gen_only=no windows_subsystem=console - bin: "./bin/godot.windows.editor.x86_64.exe" + bin: ./bin/godot.windows.editor.x86_64.exe + compiler: msvc - - name: Template (target=template_release) + - name: Template (target=template_release, tests=yes) cache-name: windows-template target: template_release tests: true - sconsflags: debug_symbols=no tests=yes - bin: "./bin/godot.windows.template_release.x86_64.console.exe" + sconsflags: debug_symbols=no + bin: ./bin/godot.windows.template_release.x86_64.console.exe + compiler: msvc + + - name: Template w/ GCC (target=template_release, tests=yes, use_mingw=yes) + cache-name: windows-template-gcc + # MinGW takes MUCH longer to compile; save time by only targeting Template. + target: template_release + tests: true + sconsflags: debug_symbols=no use_mingw=yes + bin: ./bin/godot.windows.template_release.x86_64.console.exe + compiler: gcc steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 with: submodules: recursive @@ -59,12 +68,12 @@ jobs: uses: dsaltares/fetch-gh-release-asset@1.1.2 with: repo: godotengine/godot-angle-static - version: tags/chromium/6029 - file: Windows.6029-1.MSVC_17.x86_64.x86_32.zip + version: tags/chromium/6601.2 + file: godot-angle-static-x86_64-${{ matrix.compiler == 'gcc' && 'gcc' || 'msvc' }}-release.zip target: angle/angle.zip - name: Extract pre-built ANGLE static libraries - run: Expand-Archive -Force angle/angle.zip ${{github.workspace}}/ + run: Expand-Archive -Force angle/angle.zip ${{ github.workspace }}/ - name: Setup MSVC problem matcher uses: ammaraskar/msvc-problem-matcher@master @@ -84,16 +93,18 @@ jobs: continue-on-error: true - name: Prepare artifact + if: matrix.compiler == 'msvc' run: | Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force - name: Upload artifact + if: matrix.compiler == 'msvc' uses: ./.github/actions/upload-artifact with: name: ${{ matrix.cache-name }} - name: Unit tests - if: ${{ matrix.tests }} + if: matrix.tests run: | ${{ matrix.bin }} --version ${{ matrix.bin }} --help diff --git a/core/io/http_client_tcp.cpp b/core/io/http_client_tcp.cpp index 2f45238951b..8bf10923750 100644 --- a/core/io/http_client_tcp.cpp +++ b/core/io/http_client_tcp.cpp @@ -662,15 +662,16 @@ PackedByteArray HTTPClientTCP::read_response_body_chunk() { chunk_left -= rec; if (chunk_left == 0) { - if (chunk[chunk.size() - 2] != '\r' || chunk[chunk.size() - 1] != '\n') { + const int chunk_size = chunk.size(); + if (chunk[chunk_size - 2] != '\r' || chunk[chunk_size - 1] != '\n') { ERR_PRINT("HTTP Invalid chunk terminator (not \\r\\n)"); status = STATUS_CONNECTION_ERROR; break; } - ret.resize(chunk.size() - 2); + ret.resize(chunk_size - 2); uint8_t *w = ret.ptrw(); - memcpy(w, chunk.ptr(), chunk.size() - 2); + memcpy(w, chunk.ptr(), chunk_size - 2); chunk.clear(); } diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp index fae3de2a982..08e5353174e 100644 --- a/core/io/packet_peer_udp.cpp +++ b/core/io/packet_peer_udp.cpp @@ -105,6 +105,19 @@ Error PacketPeerUDP::get_packet(const uint8_t **r_buffer, int &r_buffer_size) { return ERR_UNAVAILABLE; } +/* Bogus GCC warning here: + * In member function 'int RingBuffer::read(T*, int, bool) [with T = unsigned char]', + * inlined from 'virtual Error PacketPeerUDP::get_packet(const uint8_t**, int&)' at core/io/packet_peer_udp.cpp:112:9, + * inlined from 'virtual Error PacketPeerUDP::get_packet(const uint8_t**, int&)' at core/io/packet_peer_udp.cpp:99:7: + * Error: ./core/ring_buffer.h:68:46: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] + * 68 | p_buf[dst++] = read[pos + i]; + * | ~~~~~~~~~~~~~^~~~~~~ + */ +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic warning "-Wstringop-overflow=0" +#endif + uint32_t size = 0; uint8_t ipv6[16] = {}; rb.read(ipv6, 16, true); @@ -115,6 +128,11 @@ Error PacketPeerUDP::get_packet(const uint8_t **r_buffer, int &r_buffer_size) { --queue_count; *r_buffer = packet_buffer; r_buffer_size = size; + +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + return OK; } diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index c49e15a3a0e..3f1c468fb31 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -223,13 +223,13 @@ void StreamPeer::put_var(const Variant &p_variant, bool p_full_objects) { } uint8_t StreamPeer::get_u8() { - uint8_t buf[1]; + uint8_t buf[1] = {}; get_data(buf, 1); return buf[0]; } int8_t StreamPeer::get_8() { - uint8_t buf[1]; + uint8_t buf[1] = {}; get_data(buf, 1); return buf[0]; } diff --git a/drivers/d3d12/SCsub b/drivers/d3d12/SCsub index 35227ebe08b..7f700c987bc 100644 --- a/drivers/d3d12/SCsub +++ b/drivers/d3d12/SCsub @@ -3,6 +3,8 @@ import os from pathlib import Path +import methods + Import("env") env_d3d12_rdd = env.Clone() @@ -139,6 +141,10 @@ else: ("__REQUIRED_RPCNDR_H_VERSION__", 475), "HAVE_STRUCT_TIMESPEC", ] + if methods.using_gcc(env) and methods.get_compiler_version(env)["major"] < 13: + # `region` & `endregion` not recognized as valid pragmas. + env_d3d12_rdd.Append(CCFLAGS=["-Wno-unknown-pragmas"]) + env.Append(CCFLAGS=["-Wno-unknown-pragmas"]) # This is needed since rendering_device_d3d12.cpp needs to include some Mesa internals. env_d3d12_rdd.Prepend(CPPPATH=mesa_private_inc_paths) diff --git a/drivers/d3d12/dxil_hash.cpp b/drivers/d3d12/dxil_hash.cpp index f94a4a30df3..e08492c9ea9 100644 --- a/drivers/d3d12/dxil_hash.cpp +++ b/drivers/d3d12/dxil_hash.cpp @@ -96,7 +96,7 @@ void compute_dxil_hash(const BYTE *pData, UINT byteCount, BYTE *pOutHash) { UINT NextEndState = bTwoRowsPadding ? N - 2 : N - 1; const BYTE *pCurrData = pData; for (UINT i = 0; i < N; i++, offset += 64, pCurrData += 64) { - UINT x[16]; + UINT x[16] = {}; const UINT *pX; if (i == NextEndState) { if (!bTwoRowsPadding && i == N - 1) { diff --git a/drivers/d3d12/rendering_device_driver_d3d12.cpp b/drivers/d3d12/rendering_device_driver_d3d12.cpp index af84b847579..daa4354e6a2 100644 --- a/drivers/d3d12/rendering_device_driver_d3d12.cpp +++ b/drivers/d3d12/rendering_device_driver_d3d12.cpp @@ -1415,7 +1415,14 @@ RDD::TextureID RenderingDeviceDriverD3D12::texture_create(const TextureFormat &p } tex_info->states_ptr = &tex_info->owner_info.states; tex_info->format = p_format.format; +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif tex_info->desc = *(CD3DX12_RESOURCE_DESC *)&resource_desc; +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif tex_info->base_layer = 0; tex_info->layers = resource_desc.ArraySize(); tex_info->base_mip = 0; @@ -6621,8 +6628,6 @@ static Error create_command_signature(ID3D12Device *device, D3D12_INDIRECT_ARGUM Error RenderingDeviceDriverD3D12::_initialize_frames(uint32_t p_frame_count) { Error err; - D3D12MA::ALLOCATION_DESC allocation_desc = {}; - allocation_desc.HeapType = D3D12_HEAP_TYPE_DEFAULT; //CD3DX12_RESOURCE_DESC resource_desc = CD3DX12_RESOURCE_DESC::Buffer(D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT); uint32_t resource_descriptors_per_frame = GLOBAL_GET("rendering/rendering_device/d3d12/max_resource_descriptors_per_frame"); diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index bf83721cd3c..dd1461e68bb 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -75,7 +75,8 @@ void TileMap::_set_tile_map_data_using_compatibility_format(int p_layer, TileMap for (int i = 0; i < c; i += offset) { const uint8_t *ptr = (const uint8_t *)&r[i]; uint8_t local[12]; - for (int j = 0; j < ((p_format >= TileMapDataFormat::TILE_MAP_DATA_FORMAT_2) ? 12 : 8); j++) { + const int buffer_size = (p_format >= TileMapDataFormat::TILE_MAP_DATA_FORMAT_2) ? 12 : 8; + for (int j = 0; j < buffer_size; j++) { local[j] = ptr[j]; }