Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Update to godot latest.
Browse files Browse the repository at this point in the history
Fix mingw.

Restore symbols.
  • Loading branch information
fire committed Nov 11, 2024
2 parents 4bcc6d8 + cb39546 commit 7e527e6
Show file tree
Hide file tree
Showing 466 changed files with 7,207 additions and 42,361 deletions.
77 changes: 61 additions & 16 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export MINGW_ROOT := WORLD_PWD + "/mingw"
build-target-macos-editor-single:
@just build-platform-target macos editor single

build-target-windows-editor-single: fetch-llvm-mingw-macos
@just build-platform-target windows editor single

run-all:
just fetch-openjdk
just setup-android-sdk
Expand All @@ -38,6 +41,16 @@ run-all:
just build-platform-target macos template_release
echo "run-all: Success!"

fetch-llvm-mingw-macos:
#!/usr/bin/env bash
if [ ! -d "${MINGW_ROOT}" ]; then
cd $WORLD_PWD
mkdir -p ${MINGW_ROOT}
curl -o llvm-mingw.tar.xz -L https://github.com/mstorsjo/llvm-mingw/releases/download/20241030/llvm-mingw-20241030-ucrt-macos-universal.tar.xz
tar -xf llvm-mingw.tar.xz -C ${MINGW_ROOT} --strip 1
rm -rf llvm-mingw.tar.xz
fi
fetch-llvm-mingw:
#!/usr/bin/env bash
if [ ! -d "${MINGW_ROOT}" ]; then
Expand Down Expand Up @@ -134,46 +147,78 @@ generate_build_constants:
echo "const BUILD_DATE_STR = \"$(shell date --utc --iso=seconds)\"" >> v/addons/vsk_version/build_constants.gd
echo "const BUILD_UNIX_TIME = $(shell date +%s)" >> v/addons/vsk_version/build_constants.gd


build-platform-target platform target precision="double":
#!/usr/bin/env bash
set -o xtrace
cd $WORLD_PWD
export PATH=$MINGW_ROOT/bin:$PATH
export PATH=$OSXCROSS_ROOT/target/bin/:$PATH
source "$EMSDK_ROOT/emsdk_env.sh"
cd godot
export EXTRA_FLAGS=""
case "{{platform}}" in
macos)
EXTRA_FLAGS=("vulkan=yes" "arch=arm64" "werror=no" "vulkan_sdk_path=$VULKAN_SDK_ROOT/MoltenVK/MoltenVK/static/MoltenVK.xcframework" "osxcross_sdk=darwin24" "generate_bundle=yes" "debug_symbol=yes")
export PATH=${OSXCROSS_ROOT}/target/bin/:$PATH
scons platform=macos \
werror=no \
compiledb=yes \
precision={{precision}} \
target={{target}} \
test=yes \
vulkan=yes \
arch=arm64 \
vulkan_sdk_path=$VULKAN_SDK_ROOT/MoltenVK/MoltenVK/static/MoltenVK.xcframework \
osxcross_sdk=darwin24 \
generate_bundle=yes \
debug_symbol=yes
if [ "$(uname)" = "Darwin" ]; then
unset OSXCROSS_ROOT
fi
;;
windows)
EXTRA_FLAGS=("use_llvm=yes" "use_mingw=yes" "linkflags=-Wl,-pdb=" "ccflags=-g -gcodeview" "debug_symbols=no")
export PATH=${MINGW_ROOT}/bin:$PATH
scons platform=windows \
werror=no \
compiledb=yes \
precision={{precision}} \
target={{target}} \
test=yes \
use_llvm=yes \
use_mingw=yes \
linkflags=-Wl,-pdb= \
ccflags=-g\ -gcodeview \
debug_symbols=yes
;;
android)
EXTRA_FLAGS=("debug_symbol=yes")
scons platform=android \
werror=no \
compiledb=yes \
precision={{precision}} \
target={{target}} \
test=yes \
debug_symbol=yes
;;
linuxbsd)
EXTRA_FLAGS=("debug_symbol=yes")
scons platform=linuxbsd \
werror=no \
compiledb=yes \
precision={{precision}} \
target={{target}} \
test=yes \
debug_symbol=yes
;;
web)
EXTRA_FLAGS=("dlink_enabled=yes" "debug_symbol=yes")
scons platform=web \
werror=no \
compiledb=yes \
precision={{precision}} \
target={{target}} \
test=yes \
dlink_enabled=yes \
debug_symbol=yes
;;
*)
echo "Unsupported platform: {{platform}}"
exit 1
;;
esac
scons platform={{platform}} \
werror=no \
compiledb=yes \
precision={{precision}} \
target={{target}} \
test=yes \
"${EXTRA_FLAGS[@]}"
just handle-special-cases {{platform}} {{target}}
if [[ "{{target}}" == "editor" ]]; then
mkdir -p $WORLD_PWD/editors
Expand Down
2 changes: 1 addition & 1 deletion godot/.github/workflows/android_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:

jobs:
build-android:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
name: ${{ matrix.name }}
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion godot/.github/workflows/godot_cpp_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:

jobs:
godot-cpp-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
name: Build and test Godot CPP
steps:
- name: Checkout
Expand Down
7 changes: 5 additions & 2 deletions godot/.github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ concurrency:

jobs:
build-linux:
runs-on: ubuntu-20.04
# If unspecified, stay one LTS before latest to increase portability of Linux artifacts.
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -60,6 +61,8 @@ jobs:
artifact: false
# Test our oldest supported SCons/Python versions on one arbitrary editor build.
legacy-scons: true
# Python 3.6 unavailable on 22.04.
os: ubuntu-20.04

- 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
Expand Down Expand Up @@ -100,7 +103,7 @@ jobs:
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 ${{ matrix.os == 'ubuntu-20.04' && 'focal' || 'jammy' }} main"
sudo apt-get install -qq mesa-vulkan-drivers
# TODO: Figure out somehow how to embed this one.
Expand Down
2 changes: 1 addition & 1 deletion godot/.github/workflows/static_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:
jobs:
static-checks:
name: Code style, file formatting, and docs
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
6 changes: 2 additions & 4 deletions godot/.github/workflows/web_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ env:
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no use_closure_compiler=yes strict_checks=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 }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -46,8 +45,7 @@ jobs:
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 }}
no-cache: true

- name: Verify Emscripten setup
run: |
Expand Down
4 changes: 2 additions & 2 deletions godot/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/V-Sekai/godot.git
branch = groups-4.4
commit = 6d8b3a90e1caca7be24d03ad5e7fd7b491ac143f
parent = eeb6e98f9327fea0d5a463e13a3c37abe0e74d96
commit = 7f5e77d6070edb861482187c0e2b17dfb6f5d93a
parent = b920ced30cd9d391a07e277d17103ceb3142519b
method = merge
cmdver = 0.4.6
1 change: 1 addition & 0 deletions godot/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,7 @@ if env.msvc and not methods.using_clang(env): # MSVC
"/wd4245",
"/wd4267",
"/wd4305", # C4305 (truncation): double to float or real_t, too hard to avoid.
"/wd4324", # C4820 (structure was padded due to alignment specifier)
"/wd4514", # C4514 (unreferenced inline function has been removed)
"/wd4714", # C4714 (function marked as __forceinline not inlined)
"/wd4820", # C4820 (padding added after construct)
Expand Down
5 changes: 5 additions & 0 deletions godot/core/core_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ ResourceUID::ID ResourceLoader::get_resource_uid(const String &p_path) {
return ::ResourceLoader::get_resource_uid(p_path);
}

Vector<String> ResourceLoader::list_directory(const String &p_directory) {
return ::ResourceLoader::list_directory(p_directory);
}

void ResourceLoader::_bind_methods() {
ClassDB::bind_method(D_METHOD("load_threaded_request", "path", "type_hint", "use_sub_threads", "cache_mode"), &ResourceLoader::load_threaded_request, DEFVAL(""), DEFVAL(false), DEFVAL(CACHE_MODE_REUSE));
ClassDB::bind_method(D_METHOD("load_threaded_request_whitelisted", "path", "external_path_whitelist", "type_whitelist", "type_hint", "use_sub_threads", "cache_mode"), &ResourceLoader::load_threaded_request_whitelisted, DEFVAL(""), DEFVAL(false), DEFVAL(CACHE_MODE_REUSE));
Expand All @@ -161,6 +165,7 @@ void ResourceLoader::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_cached_ref", "path"), &ResourceLoader::get_cached_ref);
ClassDB::bind_method(D_METHOD("exists", "path", "type_hint"), &ResourceLoader::exists, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_resource_uid", "path"), &ResourceLoader::get_resource_uid);
ClassDB::bind_method(D_METHOD("list_directory", "directory_path"), &ResourceLoader::list_directory);

BIND_ENUM_CONSTANT(THREAD_LOAD_INVALID_RESOURCE);
BIND_ENUM_CONSTANT(THREAD_LOAD_IN_PROGRESS);
Expand Down
2 changes: 2 additions & 0 deletions godot/core/core_bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ class ResourceLoader : public Object {
bool exists(const String &p_path, const String &p_type_hint = "");
ResourceUID::ID get_resource_uid(const String &p_path);

Vector<String> list_directory(const String &p_directory);

ResourceLoader() { singleton = this; }
};

Expand Down
34 changes: 34 additions & 0 deletions godot/core/debugger/debugger_marshalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,37 @@ bool DebuggerMarshalls::OutputError::deserialize(const Array &p_arr) {
CHECK_END(p_arr, idx, "OutputError");
return true;
}

Array DebuggerMarshalls::serialize_key_shortcut(const Ref<Shortcut> &p_shortcut) {
ERR_FAIL_COND_V(p_shortcut.is_null(), Array());
Array keys;
for (const Ref<InputEvent> ev : p_shortcut->get_events()) {
const Ref<InputEventKey> kev = ev;
ERR_CONTINUE(kev.is_null());
if (kev->get_physical_keycode() != Key::NONE) {
keys.push_back(true);
keys.push_back(kev->get_physical_keycode_with_modifiers());
} else {
keys.push_back(false);
keys.push_back(kev->get_keycode_with_modifiers());
}
}
return keys;
}

Ref<Shortcut> DebuggerMarshalls::deserialize_key_shortcut(const Array &p_keys) {
Array key_events;
ERR_FAIL_COND_V(p_keys.size() % 2 != 0, Ref<Shortcut>());
for (int i = 0; i < p_keys.size(); i += 2) {
ERR_CONTINUE(p_keys[i].get_type() != Variant::BOOL);
ERR_CONTINUE(p_keys[i + 1].get_type() != Variant::INT);
key_events.push_back(InputEventKey::create_reference((Key)p_keys[i + 1].operator int(), p_keys[i].operator bool()));
}
if (key_events.is_empty()) {
return Ref<Shortcut>();
}
Ref<Shortcut> shortcut;
shortcut.instantiate();
shortcut->set_events(key_events);
return shortcut;
}
4 changes: 4 additions & 0 deletions godot/core/debugger/debugger_marshalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#ifndef DEBUGGER_MARSHALLS_H
#define DEBUGGER_MARSHALLS_H

#include "core/input/shortcut.h"
#include "core/object/script_language.h"

struct DebuggerMarshalls {
Expand Down Expand Up @@ -68,6 +69,9 @@ struct DebuggerMarshalls {
Array serialize();
bool deserialize(const Array &p_arr);
};

static Array serialize_key_shortcut(const Ref<Shortcut> &p_shortcut);
static Ref<Shortcut> deserialize_key_shortcut(const Array &p_keys);
};

#endif // DEBUGGER_MARSHALLS_H
Loading

0 comments on commit 7e527e6

Please sign in to comment.