Skip to content

Commit d76a618

Browse files
committed
Use new cache_limit SCons parameter.
This is not only to use an up-to-date API: if that limit isn't set, Godot's build scripts will print something with the character '∞' (infinite) in it. This unfortunately leads Python to throw an exception on the Windows CI machine due to incorrect encoding, which in turn makes the job fail. I tried to workaround that issue with PYTHONIOENCODING earlier, but for some reason it didn't have any effect. See godotengine/godot#103520
1 parent 7407394 commit d76a618

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

.github/workflows/linux.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ concurrency:
1111

1212
# Global Cache Settings
1313
env:
14-
SCONS_CACHE_LIMIT: 4096
14+
SCONS_CACHE_LIMIT_GB: 4
1515

1616
jobs:
1717
linux:
@@ -185,14 +185,17 @@ jobs:
185185
# We should always be explicit with our flags usage here since it's gonna be sure to always set those flags
186186
- name: Compilation
187187
env:
188-
# `SCONS_CACHE` became deprecated since
188+
# `SCONS_CACHE` and `SCONS_CACHE_LIMIT` became deprecated since
189189
# https://github.com/godotengine/godot/commit/0e4a4e3c4d602691ce1b4fc6a721c5c637ead57f
190190
# However since we are also building versions preceding that change,
191-
# we have to keep it in addition to the new parameter
191+
# we have to keep them in addition to the new parameters
192192
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
193+
# The new way uses a different unit.
194+
# I wish I could do `SCONS_CACHE_LIMIT_GB * 1024` but it isn't documented as an available operator
195+
SCONS_CACHE_LIMIT: 4096
193196
run: |
194197
PATH=${GITHUB_WORKSPACE}/x86_64-godot-linux-gnu_sdk-buildroot/bin:$PATH
195-
scons verbose=yes warnings=${{matrix.warnings}} werror=${{matrix.werror}} platform=linuxbsd tests=no dev_build=no target=${{matrix.target}} production=${{matrix.production}} precision=${{matrix.precision}} "cache_path=${{github.workspace}}/.scons_cache/"
198+
scons verbose=yes warnings=${{matrix.warnings}} werror=${{matrix.werror}} platform=linuxbsd tests=no dev_build=no target=${{matrix.target}} production=${{matrix.production}} precision=${{matrix.precision}} "cache_path=${{github.workspace}}/.scons_cache/" cache_limit=${{env.SCONS_CACHE_LIMIT_GB}}
196199
197200
# Make build available
198201
- uses: actions/upload-artifact@v4

.github/workflows/macos.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ concurrency:
1111

1212
# Global Cache Settings
1313
env:
14-
SCONS_CACHE_LIMIT: 4096
14+
SCONS_CACHE_LIMIT_GB: 4
1515

1616
jobs:
1717
build:
@@ -81,7 +81,7 @@ jobs:
8181
# We should always be explicit with our flags usage here since it's gonna be sure to always set those flags
8282
- name: Compilation
8383
run: |
84-
scons arch=${{matrix.arch}} verbose=yes warnings=extra werror=yes platform=macos tests=no target=${{matrix.target}} dev_build=no production=yes "cache_path=${{github.workspace}}/.scons_cache/"
84+
scons arch=${{matrix.arch}} verbose=yes warnings=extra werror=yes platform=macos tests=no target=${{matrix.target}} dev_build=no production=yes "cache_path=${{github.workspace}}/.scons_cache/" cache_limit=${{env.SCONS_CACHE_LIMIT_GB}}
8585
8686
# Make build available
8787
- uses: actions/upload-artifact@v4

.github/workflows/mono.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ concurrency:
1212
# Global Cache Settings
1313
env:
1414
GODOT_BASE_BRANCH: "4.4-stable"
15-
SCONS_CACHE_LIMIT: 4096
15+
SCONS_CACHE_LIMIT_GB: 4
1616

1717
jobs:
1818

@@ -78,7 +78,7 @@ jobs:
7878
# We should always be explicit with our flags usage here since it's gonna be sure to always set those flags
7979
- name: Compile Godot (module_mono_enabled=yes mono_glue=no)
8080
run: |
81-
scons verbose=yes warnings=all werror=yes platform=linuxbsd tests=no target=editor dev_build=no debug_symbols=no module_mono_enabled=yes mono_glue=no copy_mono_root=yes "cache_path=${{github.workspace}}/.scons_cache/"
81+
scons verbose=yes warnings=all werror=yes platform=linuxbsd tests=no target=editor dev_build=no debug_symbols=no module_mono_enabled=yes mono_glue=no copy_mono_root=yes "cache_path=${{github.workspace}}/.scons_cache/" cache_limit=${{env.SCONS_CACHE_LIMIT_GB}}
8282
8383
- name: Generate Mono Glue
8484
run: |
@@ -169,7 +169,7 @@ jobs:
169169
# We should always be explicit with our flags usage here since it's gonna be sure to always set those flags
170170
- name: Compilation
171171
run: |
172-
scons verbose=yes warnings=all werror=yes platform=linuxbsd tests=no target=editor dev_build=no debug_symbols=no module_mono_enabled=yes mono_glue=yes mono_static=yes copy_mono_root=yes "cache_path=${{github.workspace}}/.scons_cache/"
172+
scons verbose=yes warnings=all werror=yes platform=linuxbsd tests=no target=editor dev_build=no debug_symbols=no module_mono_enabled=yes mono_glue=yes mono_static=yes copy_mono_root=yes "cache_path=${{github.workspace}}/.scons_cache/" cache_limit=${{env.SCONS_CACHE_LIMIT_GB}}
173173
174174
# Make build available
175175
- uses: actions/upload-artifact@v4
@@ -255,7 +255,7 @@ jobs:
255255
SCONS_CACHE_MSVC_CONFIG: true
256256
run: |
257257
set PYTHONIOENCODING=utf8
258-
scons verbose=yes warnings=all werror=yes platform=windows tests=no target=editor dev_build=no debug_symbols=no module_mono_enabled=yes mono_glue=yes copy_mono_root=yes mono_static=yes "cache_path=${{github.workspace}}/.scons_cache/"
258+
scons verbose=yes warnings=all werror=yes platform=windows tests=no target=editor dev_build=no debug_symbols=no module_mono_enabled=yes mono_glue=yes copy_mono_root=yes mono_static=yes "cache_path=${{github.workspace}}/.scons_cache/" cache_limit=${{env.SCONS_CACHE_LIMIT_GB}}
259259
260260
# TODO Enhancement: Run tests? Such tests are able to run from Godot 4.0 only
261261
# Execute unit tests for the editor

.github/workflows/windows.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414
env:
1515
GODOT_BASE_BRANCH: "4.4-stable"
1616
SCONS_CACHE_MSVC_CONFIG: true
17-
SCONS_CACHE_LIMIT: 4096
17+
SCONS_CACHE_LIMIT_GB: 4
1818

1919
jobs:
2020
windows:
@@ -116,14 +116,19 @@ jobs:
116116
python modules/voxel/misc/instrument.py -d . -c modules/voxel/misc/instruments.json
117117

118118
# Compile with explicit flags.
119-
# `PYTHONIOENCODING` was needed due to certain characters the Godot build system might print (such as '∞'),
120-
# otherwise it makes the job fail with an encoding error.
119+
#
120+
# TODO `PYTHONIOENCODING` is not working!
121+
# It would be needed due to certain characters the Godot build system might print (such as '∞',
122+
# when `cache_limit` is not specified), otherwise it makes the job fail with an encoding error.
123+
# Currently we specify it, but the issue remain unsolved if it shows up again.
124+
# See https://github.com/godotengine/godot/issues/103520
125+
#
121126
# TODO Enhancement: we'd like to use `warnings=extra` with MSVC but Godot doesn't compile yet with that level of warnings.
122127
# See https://github.com/godotengine/godot/issues/66537
123128
- name: Compilation
124129
run: |
125130
set PYTHONIOENCODING=utf-8
126-
scons verbose=yes warnings=all werror=yes platform=windows tests=no target=${{matrix.target}} dev_build=no precision=${{matrix.precision}} tracy=${{matrix.tracy}} production=yes "cache_path=${{github.workspace}}/.scons_cache/"
131+
scons verbose=yes warnings=all werror=yes platform=windows tests=no target=${{matrix.target}} dev_build=no precision=${{matrix.precision}} tracy=${{matrix.tracy}} production=yes "cache_path=${{github.workspace}}/.scons_cache/" cache_limit=${{env.SCONS_CACHE_LIMIT_GB}}
127132
128133
- name: "Rename executable"
129134
if: ${{ matrix.tracy == 'yes' }}

0 commit comments

Comments
 (0)