Skip to content

Commit 9767837

Browse files
authored
Merge pull request #864 from Spartan322/merge/6c05ec3
Merge commit godotengine/godot@6c05ec3
2 parents ac1a497 + 4a5836e commit 9767837

File tree

143 files changed

+1787
-1096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+1787
-1096
lines changed

.github/actions/godot-build/action.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ inputs:
1818
required: false
1919
scons-cache:
2020
description: The SCons cache path.
21-
default: ${{ github.workspace }}/.scons-cache/
21+
default: ${{ github.workspace }}/.scons_cache/
2222
scons-cache-limit:
2323
description: The SCons cache size limit.
2424
# actions/cache has 10 GiB limit, and GitHub runners have a 14 GiB disk.
2525
# Limit to 7 GiB to avoid having the extracted cache fill the disk.
26-
default: 7168
26+
default: 7
2727

2828
runs:
2929
using: composite
@@ -32,10 +32,8 @@ runs:
3232
shell: sh
3333
env:
3434
SCONSFLAGS: ${{ inputs.sconsflags }}
35-
SCONS_CACHE: ${{ inputs.scons-cache }}
36-
SCONS_CACHE_LIMIT: ${{ inputs.scons-cache-limit }}
3735
run: |
38-
echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }}
36+
echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }} "cache_path=${{ inputs.scons-cache }}" cache_limit=${{ inputs.scons-cache-limit }}
3937
4038
if [ "${{ inputs.target }}" != "editor" ]; then
4139
# Ensure we don't include editor code in export template builds.
@@ -49,5 +47,5 @@ runs:
4947
export BUILD_NAME="gh"
5048
fi
5149
52-
scons platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }}
50+
scons platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }} "cache_path=${{ inputs.scons-cache }}" cache_limit=${{ inputs.scons-cache-limit }}
5351
ls -l bin/

.github/actions/godot-cache-restore/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inputs:
66
default: ${{ github.job }}
77
scons-cache:
88
description: The SCons cache path.
9-
default: ${{ github.workspace }}/.scons-cache/
9+
default: ${{ github.workspace }}/.scons_cache/
1010

1111
runs:
1212
using: composite
@@ -29,7 +29,6 @@ runs:
2929
# 4. A partial match for the same base branch only (not ideal, matches any PR with the same base branch).
3030

3131
restore-keys: |
32-
${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}
3332
${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}
3433
${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-refs/heads/${{ env.GODOT_BASE_BRANCH }}
3534
${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}

.github/actions/godot-cache-save/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inputs:
66
default: ${{ github.job }}
77
scons-cache:
88
description: The SCons cache path.
9-
default: ${{ github.workspace }}/.scons-cache/
9+
default: ${{ github.workspace }}/.scons_cache/
1010

1111
runs:
1212
using: composite

.github/actions/godot-deps/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@ runs:
2727
shell: bash
2828
run: |
2929
python -c "import sys; print(sys.version)"
30-
python -m pip install wheel
3130
python -m pip install scons==${{ inputs.scons-version }}
3231
scons --version

.github/workflows/godot_cpp_test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ jobs:
5252
# continue-on-error: true
5353

5454
- name: Build godot-cpp test extension
55-
env: # Keep synced with godot-build.
56-
SCONS_CACHE: ${{ github.workspace }}/.scons-cache/
57-
SCONS_CACHE_LIMIT: 7168
5855
run: scons --directory=./godot-cpp/test target=template_debug dev_build=yes verbose=yes
5956

6057
# - name: Save Godot build cache

.github/workflows/linux_builds.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ concurrency:
1717

1818
jobs:
1919
build-linux:
20-
# If unspecified, stay one LTS before latest to increase portability of Linux artifacts.
21-
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
20+
# Stay one LTS before latest to increase portability of Linux artifacts.
21+
runs-on: ubuntu-22.04
2222
name: ${{ matrix.name }}
2323
strategy:
2424
fail-fast: false
@@ -61,8 +61,6 @@ jobs:
6161
artifact: false
6262
# Test our oldest supported SCons/Python versions on one arbitrary editor build.
6363
legacy-scons: true
64-
# Python 3.6 unavailable on 22.04.
65-
os: ubuntu-20.04
6664

6765
- name: Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)
6866
cache-name: linux-editor-thread-sanitizer
@@ -132,8 +130,8 @@ jobs:
132130
uses: ./.github/actions/godot-deps
133131
with:
134132
# Sync with Ensure*Version in SConstruct.
135-
python-version: 3.6
136-
scons-version: 3.1.2
133+
python-version: 3.8
134+
scons-version: 4.0
137135

138136
- name: Setup GCC problem matcher
139137
uses: ammaraskar/gcc-problem-matcher@master

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ venv
7777
__pycache__/
7878
*.pyc
7979

80+
# Python modules
81+
.*_cache/
82+
8083
# Documentation
8184
doc/_build/
8285

@@ -164,9 +167,6 @@ gmon.out
164167
# Kdevelop
165168
*.kdev4
166169

167-
# Mypy
168-
.mypy_cache
169-
170170
# Qt Creator
171171
*.config
172172
*.creator

SConstruct

Lines changed: 34 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env python
22
from misc.utility.scons_hints import *
33

4-
EnsureSConsVersion(3, 1, 2)
5-
EnsurePythonVersion(3, 6)
4+
EnsureSConsVersion(4, 0)
5+
EnsurePythonVersion(3, 8)
66

77
# System
88
import atexit
@@ -59,7 +59,7 @@ import glsl_builders
5959
import methods
6060
import scu_builders
6161
from methods import print_error, print_warning
62-
from platform_methods import architecture_aliases, architectures
62+
from platform_methods import architecture_aliases, architectures, compatibility_platform_aliases
6363

6464
if ARGUMENTS.get("target", "editor") == "editor":
6565
_helper_module("editor.editor_builders", "editor/editor_builders.py")
@@ -271,6 +271,8 @@ opts.Add(BoolVariable("scu_build", "Use single compilation unit build", False))
271271
opts.Add("scu_limit", "Max includes per SCU file when using scu_build (determines RAM use)", "0")
272272
opts.Add(BoolVariable("engine_update_check", "Enable engine update checks in the Project Manager", True))
273273
opts.Add(BoolVariable("steamapi", "Enable minimal SteamAPI integration for usage time tracking (editor only)", False))
274+
opts.Add("cache_path", "Path to a directory where SCons cache files will be stored. No value disables the cache.", "")
275+
opts.Add("cache_limit", "Max size (in GiB) for the SCons cache. 0 means no limit.", "0")
274276

275277
# Thirdparty libraries
276278
opts.Add(BoolVariable("builtin_brotli", "Use the built-in Brotli library", True))
@@ -321,6 +323,9 @@ opts.Add("rcflags", "Custom flags for Windows resource compiler")
321323
# in following code (especially platform and custom_modules).
322324
opts.Update(env)
323325

326+
# Setup caching logic early to catch everything.
327+
methods.prepare_cache(env)
328+
324329
# Copy custom environment variables if set.
325330
if env["import_env_vars"]:
326331
for env_var in str(env["import_env_vars"]).split(","):
@@ -350,27 +355,18 @@ if env["platform"] == "":
350355
if env["platform"] != "":
351356
print(f'Automatically detected platform: {env["platform"]}')
352357

353-
if env["platform"] == "osx":
354-
# Deprecated alias kept for compatibility.
355-
print_warning('Platform "osx" has been renamed to "macos" in Redot 4. Building for platform "macos".')
356-
env["platform"] = "macos"
357-
358-
if env["platform"] == "iphone":
359-
# Deprecated alias kept for compatibility.
360-
print_warning('Platform "iphone" has been renamed to "ios" in Redot 4. Building for platform "ios".')
361-
env["platform"] = "ios"
362-
363-
if env["platform"] in ["linux", "bsd", "x11"]:
364-
if env["platform"] == "x11":
365-
# Deprecated alias kept for compatibility.
366-
print_warning('Platform "x11" has been renamed to "linuxbsd" in Redot 4. Building for platform "linuxbsd".')
367-
# Alias for convenience.
368-
env["platform"] = "linuxbsd"
358+
# Deprecated aliases kept for compatibility.
359+
if env["platform"] in compatibility_platform_aliases:
360+
alias = env["platform"]
361+
platform = compatibility_platform_aliases[alias]
362+
print_warning(
363+
f'Platform "{alias}" has been renamed to "{platform}" in Redot 4. Building for platform "{platform}".'
364+
)
365+
env["platform"] = platform
369366

370-
if env["platform"] == "javascript":
371-
# Deprecated alias kept for compatibility.
372-
print_warning('Platform "javascript" has been renamed to "web" in Redot 4. Building for platform "web".')
373-
env["platform"] = "web"
367+
# Alias for convenience.
368+
if env["platform"] in ["linux", "bsd"]:
369+
env["platform"] = "linuxbsd"
374370

375371
if env["platform"] not in platform_list:
376372
text = "The following platforms are available:\n\t{}\n".format("\n\t".join(platform_list))
@@ -667,40 +663,32 @@ elif methods.using_gcc(env):
667663
"to switch to posix threads."
668664
)
669665
Exit(255)
670-
if env["debug_paths_relative"] and cc_version_major < 8:
671-
print_warning("GCC < 8 doesn't support -ffile-prefix-map, disabling `debug_paths_relative` option.")
672-
env["debug_paths_relative"] = False
673666
elif methods.using_clang(env):
674667
# Apple LLVM versions differ from upstream LLVM version \o/, compare
675668
# in https://en.wikipedia.org/wiki/Xcode#Toolchain_versions
676-
if env["platform"] == "macos" or env["platform"] == "ios":
677-
vanilla = methods.is_vanilla_clang(env)
678-
if vanilla and cc_version_major < 6:
679-
print_error(
680-
"Detected Clang version older than 6, which does not fully support "
681-
"C++17. Supported versions are Clang 6 and later."
682-
)
683-
Exit(255)
684-
elif not vanilla and cc_version_major < 10:
669+
if methods.is_apple_clang(env):
670+
if cc_version_major < 10:
685671
print_error(
686672
"Detected Apple Clang version older than 10, which does not fully "
687673
"support C++17. Supported versions are Apple Clang 10 and later."
688674
)
689675
Exit(255)
690-
if env["debug_paths_relative"] and not vanilla and cc_version_major < 12:
676+
elif env["debug_paths_relative"] and cc_version_major < 12:
691677
print_warning(
692678
"Apple Clang < 12 doesn't support -ffile-prefix-map, disabling `debug_paths_relative` option."
693679
)
694680
env["debug_paths_relative"] = False
695-
elif cc_version_major < 6:
696-
print_error(
697-
"Detected Clang version older than 6, which does not fully support "
698-
"C++17. Supported versions are Clang 6 and later."
699-
)
700-
Exit(255)
701-
if env["debug_paths_relative"] and cc_version_major < 10:
702-
print_warning("Clang < 10 doesn't support -ffile-prefix-map, disabling `debug_paths_relative` option.")
703-
env["debug_paths_relative"] = False
681+
else:
682+
if cc_version_major < 6:
683+
print_error(
684+
"Detected Clang version older than 6, which does not fully support "
685+
"C++17. Supported versions are Clang 6 and later."
686+
)
687+
Exit(255)
688+
elif env["debug_paths_relative"] and cc_version_major < 10:
689+
print_warning("Clang < 10 doesn't support -ffile-prefix-map, disabling `debug_paths_relative` option.")
690+
env["debug_paths_relative"] = False
691+
704692
elif env.msvc:
705693
# Ensure latest minor builds of Visual Studio 2017/2019.
706694
# https://github.com/godotengine/godot/pull/94995#issuecomment-2336464574
@@ -764,7 +752,7 @@ else:
764752
project_path = Dir("#").abspath
765753
env.Append(CCFLAGS=[f"-ffile-prefix-map={project_path}=."])
766754
else:
767-
if methods.using_clang(env) and not methods.is_vanilla_clang(env):
755+
if methods.is_apple_clang(env):
768756
# Apple Clang, its linker doesn't like -s.
769757
env.Append(LINKFLAGS=["-Wl,-S", "-Wl,-x", "-Wl,-dead_strip"])
770758
else:
@@ -1050,23 +1038,7 @@ GLSL_BUILDERS = {
10501038
}
10511039
env.Append(BUILDERS=GLSL_BUILDERS)
10521040

1053-
scons_cache_path = os.environ.get("SCONS_CACHE")
1054-
if scons_cache_path is not None:
1055-
CacheDir(scons_cache_path)
1056-
print("Scons cache enabled... (path: '" + scons_cache_path + "')")
1057-
1058-
if env["vsproj"]:
1059-
env.vs_incs = []
1060-
env.vs_srcs = []
1061-
10621041
if env["compiledb"]:
1063-
if env.scons_version < (4, 0, 0):
1064-
# Generating the compilation DB (`compile_commands.json`) requires SCons 4.0.0 or later.
1065-
print_error(
1066-
"The `compiledb=yes` option requires SCons 4.0 or later, but your version is %s." % scons_raw_version
1067-
)
1068-
Exit(255)
1069-
10701042
env.Tool("compilation_db")
10711043
env.Alias("compiledb", env.CompilationDatabase())
10721044

@@ -1148,5 +1120,3 @@ def purge_flaky_files():
11481120

11491121

11501122
atexit.register(purge_flaky_files)
1151-
1152-
methods.clean_cache(env)

core/config/project_settings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1410,7 +1410,7 @@ void ProjectSettings::_add_builtin_input_map() {
14101410
}
14111411

14121412
Dictionary action;
1413-
action["deadzone"] = Variant(0.2f);
1413+
action["deadzone"] = Variant(InputMap::DEFAULT_DEADZONE);
14141414
action["events"] = events;
14151415

14161416
String action_name = "input/" + E.key;

core/input/input_event.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ JoyAxis InputEventJoypadMotion::get_axis() const {
10991099

11001100
void InputEventJoypadMotion::set_axis_value(float p_value) {
11011101
axis_value = p_value;
1102-
pressed = Math::abs(axis_value) >= 0.5f;
1102+
pressed = Math::abs(axis_value) >= InputMap::DEFAULT_DEADZONE;
11031103
emit_changed();
11041104
}
11051105

0 commit comments

Comments
 (0)