From a63c37dca134350a8260a1add89c33d6b0deb937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 17 May 2024 09:28:56 +0200 Subject: [PATCH] SCons: Bump min version to 3.1.2, test it on CI with one Linux job The min SCons version had to be bumped as SCons 3.0 before 3.0.3 seems broken (see #92043), and there's little gain from supporting 3.0.3-3.0.5. 3.1.2 is also the first version to avoid ambiguities between Python 2 and Python 3 usage, so we finally use it as the minimum baseline. Also test against Python 3.6 which is also our minimum supported version. This should help prevent regressions whenever we modernize the build scripts. --- .github/actions/godot-build/action.yml | 4 ++-- .github/actions/godot-cache/action.yml | 6 +++--- .github/actions/godot-deps/action.yml | 21 ++++++++++++--------- .github/workflows/android_builds.yml | 2 +- .github/workflows/godot_cpp_test.yml | 4 ++-- .github/workflows/ios_builds.yml | 2 +- .github/workflows/linux_builds.yml | 13 ++++++++++++- .github/workflows/macos_builds.yml | 2 +- .github/workflows/web_builds.yml | 2 +- .github/workflows/windows_builds.yml | 2 +- SConstruct | 2 +- 11 files changed, 37 insertions(+), 23 deletions(-) diff --git a/.github/actions/godot-build/action.yml b/.github/actions/godot-build/action.yml index 0a0899db787..bf29b7e430a 100644 --- a/.github/actions/godot-build/action.yml +++ b/.github/actions/godot-build/action.yml @@ -13,10 +13,10 @@ inputs: sconsflags: default: "" scons-cache: - description: The scons cache path. + description: The SCons cache path. default: "${{ github.workspace }}/.scons-cache/" scons-cache-limit: - description: The scons cache size 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 diff --git a/.github/actions/godot-cache/action.yml b/.github/actions/godot-cache/action.yml index b7ca01bb47d..13142e7ed1b 100644 --- a/.github/actions/godot-cache/action.yml +++ b/.github/actions/godot-cache/action.yml @@ -5,13 +5,13 @@ inputs: description: The cache base name (job name by default). default: "${{github.job}}" scons-cache: - description: The scons cache path. + description: The SCons cache path. default: "${{github.workspace}}/.scons-cache/" runs: using: "composite" steps: - # Upload cache on completion and check it out now - - name: Load .scons_cache directory + # Upload cache on completion and check it out now. + - name: Load SCons cache directory uses: actions/cache@v4 with: path: ${{inputs.scons-cache}} diff --git a/.github/actions/godot-deps/action.yml b/.github/actions/godot-deps/action.yml index cac72c436ed..07a364cd79f 100644 --- a/.github/actions/godot-deps/action.yml +++ b/.github/actions/godot-deps/action.yml @@ -1,27 +1,30 @@ -name: Setup python and scons -description: Setup python, install the pip version of scons. +name: Setup Python and SCons +description: Setup Python, install the pip version of SCons. inputs: python-version: - description: The python version to use. + description: The Python version to use. default: "3.x" python-arch: - description: The python architecture. + description: The Python architecture. default: "x64" + scons-version: + description: The SCons version to use. + default: "4.7.0" runs: using: "composite" steps: - # Use python 3.x release (works cross platform) - name: Set up Python 3.x uses: actions/setup-python@v5 with: - # Semantic version range syntax or exact version of a Python version + # Semantic version range syntax or exact version of a Python version. python-version: ${{ inputs.python-version }} - # Optional - x64 or x86 architecture, defaults to x64 + # Optional - x64 or x86 architecture, defaults to x64. architecture: ${{ inputs.python-arch }} - - name: Setup scons + - name: Setup SCons shell: bash run: | python -c "import sys; print(sys.version)" - python -m pip install scons==4.7.0 + python -m pip install wheel + python -m pip install scons==${{ inputs.scons-version }} scons --version diff --git a/.github/workflows/android_builds.yml b/.github/workflows/android_builds.yml index 5cb66a40ab7..9a488bd0956 100644 --- a/.github/workflows/android_builds.yml +++ b/.github/workflows/android_builds.yml @@ -32,7 +32,7 @@ jobs: uses: ./.github/actions/godot-cache continue-on-error: true - - name: Setup python and scons + - name: Setup Python and SCons uses: ./.github/actions/godot-deps - name: Compilation (arm32) diff --git a/.github/workflows/godot_cpp_test.yml b/.github/workflows/godot_cpp_test.yml index 7350920810d..57114dacfc2 100644 --- a/.github/workflows/godot_cpp_test.yml +++ b/.github/workflows/godot_cpp_test.yml @@ -22,7 +22,7 @@ jobs: with: submodules: recursive - - name: Setup python and scons + - name: Setup Python and SCons uses: ./.github/actions/godot-deps # Checkout godot-cpp @@ -47,7 +47,7 @@ jobs: 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 + # TODO: Add caching to the SCons build and store it for CI via the godot-cache # action. # Build godot-cpp test extension diff --git a/.github/workflows/ios_builds.yml b/.github/workflows/ios_builds.yml index e205d551ed9..0546f43acc5 100644 --- a/.github/workflows/ios_builds.yml +++ b/.github/workflows/ios_builds.yml @@ -26,7 +26,7 @@ jobs: uses: ./.github/actions/godot-cache continue-on-error: true - - name: Setup python and scons + - name: Setup Python and SCons uses: ./.github/actions/godot-deps - name: Compilation (arm64) diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index 0420a02b1dd..6b98256110f 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -58,6 +58,8 @@ jobs: tests: true # Skip 2GiB artifact speeding up action. artifact: false + # Test our oldest supported SCons/Python versions on one arbitrary editor build. + legacy-scons: true - name: Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld) cache-name: linux-editor-thread-sanitizer @@ -115,9 +117,18 @@ jobs: cache-name: ${{ matrix.cache-name }} continue-on-error: true - - name: Setup python and scons + - name: Setup Python and SCons + if: ${{ ! matrix.legacy-scons }} uses: ./.github/actions/godot-deps + - name: Setup Python and SCons (legacy versions) + if: ${{ matrix.legacy-scons }} + uses: ./.github/actions/godot-deps + with: + # Sync with Ensure*Version in SConstruct. + python-version: 3.6 + scons-version: 3.1.2 + - name: Setup GCC problem matcher uses: ammaraskar/gcc-problem-matcher@master diff --git a/.github/workflows/macos_builds.yml b/.github/workflows/macos_builds.yml index 70031ec4c34..badcb688d1b 100644 --- a/.github/workflows/macos_builds.yml +++ b/.github/workflows/macos_builds.yml @@ -43,7 +43,7 @@ jobs: cache-name: ${{ matrix.cache-name }} continue-on-error: true - - name: Setup python and scons + - name: Setup Python and SCons uses: ./.github/actions/godot-deps - name: Setup Vulkan SDK diff --git a/.github/workflows/web_builds.yml b/.github/workflows/web_builds.yml index cfa1571d1f6..1eb7b901cd6 100644 --- a/.github/workflows/web_builds.yml +++ b/.github/workflows/web_builds.yml @@ -58,7 +58,7 @@ jobs: cache-name: ${{ matrix.cache-name }} continue-on-error: true - - name: Setup python and scons + - name: Setup Python and SCons uses: ./.github/actions/godot-deps - name: Compilation diff --git a/.github/workflows/windows_builds.yml b/.github/workflows/windows_builds.yml index 5443ba20ab5..f9513af5e3b 100644 --- a/.github/workflows/windows_builds.yml +++ b/.github/workflows/windows_builds.yml @@ -48,7 +48,7 @@ jobs: cache-name: ${{ matrix.cache-name }} continue-on-error: true - - name: Setup python and scons + - name: Setup Python and SCons uses: ./.github/actions/godot-deps - name: Download Direct3D 12 SDK components diff --git a/SConstruct b/SConstruct index c062f95bdba..c668ac7df34 100644 --- a/SConstruct +++ b/SConstruct @@ -1,6 +1,6 @@ #!/usr/bin/env python -EnsureSConsVersion(3, 0, 0) +EnsureSConsVersion(3, 1, 2) EnsurePythonVersion(3, 6) # System