From 567761ebbb6e5aaaa5b1f0d685ba230a94e39847 Mon Sep 17 00:00:00 2001 From: Estebanfer Date: Fri, 14 Jun 2024 10:45:16 -0300 Subject: [PATCH 1/6] fix MSVC 19.40 build crashing, fix clangd warnings --- CMakeLists.txt | 4 ++++ src/game_api/script/lua_backend.cpp | 2 +- src/game_api/sound_manager.cpp | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d73aec8f7..230a93544 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,10 @@ add_compile_definitions(_ITERATOR_DEBUG_LEVEL=0) add_compile_definitions(NOMINMAX) add_compile_definitions(WIN32_LEAN_AND_MEAN) +# Fix MSVC 19.40 crash with mutex due to spelunky using an old redist (mscvp140.dll) +# Related links: https://github.com/microsoft/STL/releases/tag/vs-2022-17.10 | https://github.com/actions/runner-images/issues/10004 +add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) + if(BUILD_OVERLUNKY) add_compile_definitions(SPEL2_EDITABLE_SCRIPTS) add_compile_definitions(SPEL2_EXTRA_ANNOYING_SCRIPT_ERRORS) diff --git a/src/game_api/script/lua_backend.cpp b/src/game_api/script/lua_backend.cpp index 5d426a7e9..1b27cec70 100644 --- a/src/game_api/script/lua_backend.cpp +++ b/src/game_api/script/lua_backend.cpp @@ -77,7 +77,7 @@ LuaBackend::~LuaBackend() { std::lock_guard lock{g_all_backends_mutex}; - std::erase_if(g_all_backends, [=](const std::unique_ptr& protected_backend) + std::erase_if(g_all_backends, [this](const std::unique_ptr& protected_backend) { return protected_backend.get() == self; }); } } diff --git a/src/game_api/sound_manager.cpp b/src/game_api/sound_manager.cpp index 27a621b20..e2de5e057 100644 --- a/src/game_api/sound_manager.cpp +++ b/src/game_api/sound_manager.cpp @@ -194,9 +194,9 @@ PlayingSound CustomSound::play(bool paused, SOUND_TYPE sound_type) { return std::visit( overloaded{ - [=](FMOD::Sound* sound) + [=, this](FMOD::Sound* sound) { return m_SoundManager->play_sound(sound, paused, sound_type == SOUND_TYPE::Music); }, - [=](FMODStudio::EventDescription* event) + [=, this](FMODStudio::EventDescription* event) { return m_SoundManager->play_event(event, paused, sound_type == SOUND_TYPE::Music); }, [](std::monostate) { From 01aeb73243f10b2f3b317fc4d00042b230ea369c Mon Sep 17 00:00:00 2001 From: Estebanfer Date: Fri, 14 Jun 2024 21:30:29 -0300 Subject: [PATCH 2/6] update json library --- src/json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/json b/src/json index 7126d8880..9cca280a4 160000 --- a/src/json +++ b/src/json @@ -1 +1 @@ -Subproject commit 7126d88803eeb9d28cc10621f01a58813d50d078 +Subproject commit 9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03 From 46a184776040e0753c226a849c7bc9a3525fc67f Mon Sep 17 00:00:00 2001 From: Estebanfer Date: Thu, 20 Jun 2024 00:54:57 -0300 Subject: [PATCH 3/6] update fmt library (PL Debug isn't building with the current old version) --- src/fmt | 2 +- src/shared/logger.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fmt b/src/fmt index 58aa04573..af8cd4e40 160000 --- a/src/fmt +++ b/src/fmt @@ -1 +1 @@ -Subproject commit 58aa04573f6fab54dd998183d333bf9d630843ee +Subproject commit af8cd4e40425a0f1ed5dbf27c9fc664bf3cf977a diff --git a/src/shared/logger.h b/src/shared/logger.h index a2c91b645..b09709f4e 100644 --- a/src/shared/logger.h +++ b/src/shared/logger.h @@ -18,7 +18,7 @@ struct fmt::formatter } template - auto format(ByteStr byte_str, FormatContext& ctx) + auto format(const ByteStr& byte_str, FormatContext& ctx) const { auto out = ctx.out(); From 4a3705d654dbe107b3f5bebb3417653f641ad377 Mon Sep 17 00:00:00 2001 From: Estebanfer Date: Wed, 26 Jun 2024 22:28:47 -0300 Subject: [PATCH 4/6] downgrade clang build to llvm 17 --- .github/workflows/continous_integration.yml | 3 +++ .github/workflows/whip-build.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/continous_integration.yml b/.github/workflows/continous_integration.yml index 13e2fa360..9d7479715 100644 --- a/.github/workflows/continous_integration.yml +++ b/.github/workflows/continous_integration.yml @@ -31,6 +31,9 @@ jobs: steps: - uses: llvm/actions/install-ninja@main + - name: Install llvm 17 + run: choco install llvm --version 17.0.6 -y + - uses: actions/checkout@v2 with: fetch-depth: 1 diff --git a/.github/workflows/whip-build.yml b/.github/workflows/whip-build.yml index a597a5310..b54e6b104 100644 --- a/.github/workflows/whip-build.yml +++ b/.github/workflows/whip-build.yml @@ -13,6 +13,9 @@ jobs: steps: - uses: llvm/actions/install-ninja@main + - name: Install llvm 17 + run: choco install llvm --version 17.0.6 -y + - uses: actions/checkout@v2 with: fetch-depth: 1 From a21d53db4630d089873c032e817eb6f6e859bbb6 Mon Sep 17 00:00:00 2001 From: Estebanfer Date: Wed, 26 Jun 2024 22:37:14 -0300 Subject: [PATCH 5/6] llvm allow downgrade --- .github/workflows/continous_integration.yml | 3 ++- .github/workflows/whip-build.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continous_integration.yml b/.github/workflows/continous_integration.yml index 9d7479715..75be859c0 100644 --- a/.github/workflows/continous_integration.yml +++ b/.github/workflows/continous_integration.yml @@ -32,7 +32,8 @@ jobs: - uses: llvm/actions/install-ninja@main - name: Install llvm 17 - run: choco install llvm --version 17.0.6 -y + if: ${{ matrix.toolset_name == "Ninja" }} + run: choco install llvm --version 17.0.6 --allow-downgrade -y - uses: actions/checkout@v2 with: diff --git a/.github/workflows/whip-build.yml b/.github/workflows/whip-build.yml index b54e6b104..0273bf597 100644 --- a/.github/workflows/whip-build.yml +++ b/.github/workflows/whip-build.yml @@ -14,7 +14,7 @@ jobs: - uses: llvm/actions/install-ninja@main - name: Install llvm 17 - run: choco install llvm --version 17.0.6 -y + run: choco install llvm --version 17.0.6 --allow-downgrade -y - uses: actions/checkout@v2 with: From e261ab32cfb6f9931ced10b4e07f8c67a8c4144f Mon Sep 17 00:00:00 2001 From: Estebanfer Date: Wed, 26 Jun 2024 22:49:41 -0300 Subject: [PATCH 6/6] . --- .github/workflows/continous_integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continous_integration.yml b/.github/workflows/continous_integration.yml index 75be859c0..53cb01124 100644 --- a/.github/workflows/continous_integration.yml +++ b/.github/workflows/continous_integration.yml @@ -32,7 +32,7 @@ jobs: - uses: llvm/actions/install-ninja@main - name: Install llvm 17 - if: ${{ matrix.toolset_name == "Ninja" }} + if: matrix.toolset_name == 'Ninja' run: choco install llvm --version 17.0.6 --allow-downgrade -y - uses: actions/checkout@v2