From 9b76bc459babd373d8cf086ef9d0eb71014cdadb Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 22 Oct 2024 09:31:05 +0300 Subject: [PATCH 01/10] Fix reading angles for DRC_CMD_CAMERA (#476) --- cl_dll/hud_spectator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index 0e9d440f8..21d0235f1 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -727,9 +727,9 @@ void CHudSpectator::DirectorMessage( int iSize, void *pbuf ) v1[1] = READ_COORD(); v1[2] = READ_COORD(); // vJumpOrigin - v1[0] = READ_COORD(); // view angle - v1[1] = READ_COORD(); // vJumpAngles - v1[2] = READ_COORD(); + v2[0] = READ_COORD(); // view angle + v2[1] = READ_COORD(); // vJumpAngles + v2[2] = READ_COORD(); f1 = READ_BYTE(); // fov i1 = READ_WORD(); // target From aba51886c3639f2aec0f6aee24e238df68d7aab0 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 24 Oct 2024 09:52:51 +0300 Subject: [PATCH 02/10] Fix sv_game_build_branch referencing the wrong string (#477) --- dlls/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/game.cpp b/dlls/game.cpp index 6fc752f16..a81ae5a6d 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -19,7 +19,7 @@ #include "vcs_info.h" static cvar_t build_commit = { "sv_game_build_commit", g_VCSInfo_Commit }; -static cvar_t build_branch = { "sv_game_build_branch", g_VCSInfo_Commit }; +static cvar_t build_branch = { "sv_game_build_branch", g_VCSInfo_Branch }; cvar_t displaysoundlist = {"displaysoundlist","0"}; From 5417e6c820133aa9d46324a69340e7a5022cae9e Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 24 Oct 2024 09:53:30 +0300 Subject: [PATCH 03/10] Fix Debug builds with old ninja versions (#478) --- cl_dll/CMakeLists.txt | 6 ++++-- dlls/CMakeLists.txt | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 46d22efc1..c28315fbd 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -233,6 +233,8 @@ install( TARGETS ${CLDLL_LIBRARY} GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) -add_custom_command(TARGET ${CLDLL_LIBRARY} +if(CMAKE_BUILD_TYPE MATCHES "Release") + add_custom_command(TARGET ${CLDLL_LIBRARY} POST_BUILD DEPENDS ${CLDLL_LIBRARY} - COMMAND $<$:${CMAKE_STRIP}> -s $) + COMMAND ${CMAKE_STRIP} -s $) +endif() diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index cdfe02bda..e4f63e787 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -194,6 +194,8 @@ install( TARGETS ${SVDLL_LIBRARY} GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) -add_custom_command(TARGET ${SVDLL_LIBRARY} +if(CMAKE_BUILD_TYPE MATCHES "Release") + add_custom_command(TARGET ${SVDLL_LIBRARY} POST_BUILD DEPENDS ${SVDLL_LIBRARY} - COMMAND $<$:${CMAKE_STRIP}> -s $) + COMMAND ${CMAKE_STRIP} -s $) +endif() From 8dc408443068e1f6de2f4b7cc9b2257f2f84dd94 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 24 Oct 2024 09:53:51 +0300 Subject: [PATCH 04/10] Build github artifacts using Ninja (#479) --- .github/workflows/build.yml | 4 ++-- .github/workflows/manual.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8e6284a4..4c75a1c42 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,13 +52,13 @@ jobs: - name: Build on Linux if: startsWith(matrix.os, 'ubuntu') run: | - schroot --chroot steamrt_scout_i386 -- cmake -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_INSTALL_PREFIX="$PWD/dist" + schroot --chroot steamrt_scout_i386 -- cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_INSTALL_PREFIX="$PWD/dist" schroot --chroot steamrt_scout_i386 -- cmake --build build --target all schroot --chroot steamrt_scout_i386 -- cmake --build build --target install - name: Build on Linux with vgui if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc') run: | - schroot --chroot steamrt_scout_i386 -- cmake -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui" + schroot --chroot steamrt_scout_i386 -- cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui" cp vgui_support/vgui-dev/lib/vgui.so build-vgui/cl_dll schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target all schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target install diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index f34153b11..6002c9ad9 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -67,7 +67,7 @@ jobs: - name: Build on Linux if: startsWith(matrix.os, 'ubuntu') run: | - schroot --chroot steamrt_scout_i386 -- cmake -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_BUILD_TYPE=${{ github.event.inputs.buildtype }} -DCMAKE_INSTALL_PREFIX="$PWD/dist" -DUSE_VGUI=${{ github.event.inputs.usevgui }} + schroot --chroot steamrt_scout_i386 -- cmake -GNinja -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_BUILD_TYPE=${{ github.event.inputs.buildtype }} -DCMAKE_INSTALL_PREFIX="$PWD/dist" -DUSE_VGUI=${{ github.event.inputs.usevgui }} schroot --chroot steamrt_scout_i386 -- cmake --build build --target all schroot --chroot steamrt_scout_i386 -- cmake --build build --target install From ab853c99da97c9eca200c9384f0d16616735fda0 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 3 Nov 2024 00:13:54 +0300 Subject: [PATCH 05/10] client: wscript: force set vgui-dev path --- cl_dll/wscript | 1 + 1 file changed, 1 insertion(+) diff --git a/cl_dll/wscript b/cl_dll/wscript index 386a24525..5fe926677 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -20,6 +20,7 @@ def options(opt): opt.load('vgui') def configure(conf): + conf.options.VGUI_DEV = os.path.join('vgui_support', 'vgui-dev') # vgui is in submodule conf.env.USE_VGUI = conf.options.USE_VGUI conf.env.USE_NOVGUI_MOTD = conf.options.USE_NOVGUI_MOTD conf.env.USE_NOVGUI_SCOREBOARD = conf.options.USE_NOVGUI_SCOREBOARD From 852fc5abaa420e486389965f690a8d1519a6fa76 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 29 Oct 2024 18:18:36 +0300 Subject: [PATCH 06/10] Copy vgui.so to the base build directory to fix linking with it in github actions --- .github/workflows/build.yml | 1 + .github/workflows/manual.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c75a1c42..11d0d2c09 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,6 +60,7 @@ jobs: run: | schroot --chroot steamrt_scout_i386 -- cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui" cp vgui_support/vgui-dev/lib/vgui.so build-vgui/cl_dll + cp vgui_support/vgui-dev/lib/vgui.so build-vgui schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target all schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target install diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 6002c9ad9..6af12aa73 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -64,6 +64,7 @@ jobs: run: | mkdir -p build/cl_dll cp vgui_support/vgui-dev/lib/vgui.so build/cl_dll + cp vgui_support/vgui-dev/lib/vgui.so build - name: Build on Linux if: startsWith(matrix.os, 'ubuntu') run: | From 82f85a4a6e963e16f732a8eca900592ed8a6b3c5 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 7 Nov 2024 07:46:13 +0300 Subject: [PATCH 07/10] Add WebAssembly and Solaris definitions from engine --- cmake/LibraryNaming.cmake | 6 ++++++ public/build.h | 16 ++++++++++++++++ scripts/waifulib/library_naming.py | 6 ++++++ 3 files changed, 28 insertions(+) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index d71919fa2..5f2634363 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -54,6 +54,8 @@ check_group_build_target(XASH_SERENITY XASH_PLATFORM) check_group_build_target(XASH_IRIX XASH_PLATFORM) check_group_build_target(XASH_NSWITCH XASH_PLATFORM) check_group_build_target(XASH_PSVITA XASH_PLATFORM) +check_group_build_target(XASH_WASI XASH_PLATFORM) +check_group_build_target(XASH_SUNOS XASH_PLATFORM) check_group_build_target(XASH_X86 XASH_ARCHITECTURE) check_group_build_target(XASH_AMD64 XASH_ARCHITECTURE) check_group_build_target(XASH_ARM XASH_ARCHITECTURE) @@ -105,6 +107,10 @@ elseif(XASH_PSVITA) set(BUILDOS "psvita") elseif(XASH_IRIX) set(BUILDOS "irix") +elseif(XASH_WASI) + set(BUILDOS "wasi") +elseif(XASH_SUNOS) + set(BUILDOS "sunos") else() message(SEND_ERROR "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug") endif() diff --git a/public/build.h b/public/build.h index 851939b55..24fd9d5bb 100644 --- a/public/build.h +++ b/public/build.h @@ -81,10 +81,13 @@ Then you can use another oneliner to query all variables: #undef XASH_RISCV_SINGLEFP #undef XASH_RISCV_SOFTFP #undef XASH_SERENITY +#undef XASH_SUNOS #undef XASH_WIN32 #undef XASH_X86 #undef XASH_NSWITCH #undef XASH_PSVITA +#undef XASH_WASI +#undef XASH_WASM //================================================================ // @@ -126,6 +129,10 @@ Then you can use another oneliner to query all variables: #define XASH_NSWITCH 1 #elif defined __vita__ #define XASH_PSVITA 1 + #elif defined __wasi__ + #define XASH_WASI 1 + #elif defined __sun__ + #define XASH_SUNOS 1 #else #error #endif @@ -234,10 +241,19 @@ Then you can use another oneliner to query all variables: #else #error "Unknown RISC-V float ABI" #endif +#elif defined __wasm__ + #if defined __wasm64__ + #define XASH_64BIT 1 + #endif + #define XASH_WASM 1 #else #error "Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug" #endif +#if !XASH_64BIT && ( defined( __LP64__ ) || defined( _LP64 )) +#define XASH_64BIT 1 +#endif + #if XASH_ARM == 8 #define XASH_ARMv8 1 #elif XASH_ARM == 7 diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index ac2faf6f9..0095a88c9 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -60,6 +60,8 @@ 'XASH_X86', 'XASH_NSWITCH', 'XASH_PSVITA', +'XASH_WASI', +'XASH_SUNOS', ] def configure(conf): @@ -97,6 +99,10 @@ def configure(conf): buildos = "psvita" elif conf.env.XASH_IRIX: buildos = "irix" + elif conf.env.XASH_WASI: + buildos = "wasi" + elif conf.env.XASH_SUNOS: + buildos = "sunos" else: conf.fatal("Place your operating system name in build.h and library_naming.py!\n" "If this is a mistake, try to fix conditions above and report a bug") From fab8cfe7f496a3b57bfdd3ff0b91b1431fc607f0 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 18 Nov 2024 21:16:19 +0300 Subject: [PATCH 08/10] scripts: waifulib: library_naming: make file true_postfix.txt during configure with real platform info --- scripts/waifulib/library_naming.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index 0095a88c9..dc5f13ee1 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -77,8 +77,12 @@ def configure(conf): # engine/common/build.c if conf.env.XASH_ANDROID: buildos = "android" - elif conf.env.XASH_WIN32 or conf.env.XASH_LINUX or conf.env.XASH_APPLE: - buildos = "" # no prefix for default OS + elif conf.env.XASH_WIN32: + buildos = "win32" + elif conf.env.XASH_LINUX: + buildos = "linux" + elif conf.env.XASH_APPLE: + buildos = "apple" elif conf.env.XASH_FREEBSD: buildos = "freebsd" elif conf.env.XASH_NETBSD: @@ -110,10 +114,7 @@ def configure(conf): if conf.env.XASH_AMD64: buildarch = "amd64" elif conf.env.XASH_X86: - if conf.env.XASH_WIN32 or conf.env.XASH_LINUX or conf.env.XASH_APPLE: - buildarch = "" - else: - buildarch = "i386" + buildarch = "i386" elif conf.env.XASH_ARM and conf.env.XASH_64BIT: buildarch = "arm64" elif conf.env.XASH_ARM: @@ -166,6 +167,14 @@ def configure(conf): raise conf.fatal("Place your architecture name in build.h and library_naming.py!\n" "If this is a mistake, try to fix conditions above and report a bug") + node = conf.bldnode.make_node('true_postfix.txt') + node.write('%s-%s' % (buildos, buildarch)) + + if not conf.env.XASH_ANDROID and (conf.env.XASH_WIN32 or conf.env.XASH_LINUX or conf.env.XASH_APPLE): + buildos = '' + if conf.env.XASH_X86: + buildarch = '' + conf.env.revert() if buildos == 'android': From 387c266c05cf041c38f2296d74dec6e1ced6eb5a Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 18 Nov 2024 21:16:50 +0300 Subject: [PATCH 09/10] wscript: enable gccdeps like in engine --- wscript | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wscript b/wscript index be199f58c..3d1d4279a 100644 --- a/wscript +++ b/wscript @@ -48,7 +48,7 @@ def configure(conf): conf.env.MSVC_SUBSYSTEM = 'WINDOWS' # Load compilers early - conf.load('xcompile compiler_c compiler_cxx') + conf.load('xcompile compiler_c compiler_cxx gccdeps') # HACKHACK: override msvc DEST_CPU value by something that we understand if conf.env.DEST_CPU == 'amd64': @@ -63,8 +63,7 @@ def configure(conf): if conf.env.GIT_BRANCH: conf.define('XASH_BUILD_BRANCH', conf.env.GIT_BRANCH) - enforce_pic = True # modern defaults - conf.check_pic(enforce_pic) + conf.check_pic(True) # modern defaults # We restrict 64-bit builds ONLY for Win/Linux/OSX running on Intel architecture # Because compatibility with original GoldSrc From 5a6e0e0bd51793c8885d51b2343e26ee80bd42a2 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sat, 23 Nov 2024 16:28:31 +0300 Subject: [PATCH 10/10] Use latest scout steam runtime (#484) --- .github/workflows/build.yml | 5 +++-- .github/workflows/manual.yml | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11d0d2c09..6da018625 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,7 @@ jobs: env: CC: ${{ matrix.cc }} CXX: ${{ matrix.cxx }} + STEAMRT_SNAPSHOT: latest-steam-client-general-availability steps: - name: Checkout uses: actions/checkout@v4 @@ -38,10 +39,10 @@ jobs: uses: actions/cache@v4 with: path: com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz - key: ${{ runner.os }}-steam-runtime + key: steam-runtime-${{ env.STEAMRT_SNAPSHOT }} - name: Download steam-runtime if: startsWith(matrix.os, 'ubuntu') && steps.cache-steam-runtime.outputs.cache-hit != 'true' - run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/0.20210610.0/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz + run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/${{ env.STEAMRT_SNAPSHOT }}/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz - name: Install steam runtime if: startsWith(matrix.os, 'ubuntu') run: | diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 6af12aa73..270da8750 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -15,6 +15,10 @@ on: options: - 'OFF' - 'ON' + steamrt_snapshot: + type: string + description: SteamRT Snapshot + default: 'latest-steam-client-general-availability' jobs: build: runs-on: ${{ matrix.os }} @@ -48,10 +52,10 @@ jobs: uses: actions/cache@v4 with: path: com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz - key: ${{ runner.os }}-steam-runtime + key: steam-runtime-${{ github.event.inputs.steamrt_snapshot }} - name: Download steam-runtime if: startsWith(matrix.os, 'ubuntu') && steps.cache-steam-runtime.outputs.cache-hit != 'true' - run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/0.20210610.0/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz + run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/${{ github.event.inputs.steamrt_snapshot }}/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz - name: Install steam runtime if: startsWith(matrix.os, 'ubuntu') run: |