diff --git a/.github/workflows/emu-build-all-win.yml b/.github/workflows/emu-build-all-win.yml index e146d2808..485349f3c 100644 --- a/.github/workflows/emu-build-all-win.yml +++ b/.github/workflows/emu-build-all-win.yml @@ -48,7 +48,11 @@ jobs: - name: "Checkout branch" uses: actions/checkout@v4 with: - clean: false + # clean:true so stale generated/build artifacts from prior runs (e.g. a + # removed base_gcmessages.pb.* or old steam_api DLLs) can't get compiled, + # linked, or shipped. Deps live in C:\gbe-deps (junctioned later), so a + # clean checkout doesn't force a deps rebuild. + clean: true - name: "Setup MSBuild" uses: microsoft/setup-msbuild@v2 @@ -83,7 +87,11 @@ jobs: shell: cmd working-directory: "${{ github.workspace }}" run: | - "${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5.lua --genproto --emubuild=${{ github.sha }} --dosstub --winrsrc --winsign --os=windows vs2022 + rem No --dosstub/--winsign: that post-build tooling (file_dos_stub_x32.exe / + rem sign_helper.bat) crashes on the 32-bit DLL and removes the just-linked + rem output, and the emu DLLs don't need a replaced DOS stub or a code + rem signature to function. Keep --winrsrc (version resource) which is fine. + "${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5.lua --genproto --emubuild=${{ github.sha }} --winrsrc --os=windows vs2022 - name: "Build all targets" shell: cmd @@ -92,6 +100,11 @@ jobs: @echo off setlocal enabledelayedexpansion + rem The build job checks out with clean:false, so stale DLLs from a prior + rem build linger. Wipe the release output dir first so a target that fails + rem to build this run cannot ship a leftover DLL (false success). + if exist "%GITHUB_WORKSPACE%\build\win\vs2022\release" rmdir /s /q "%GITHUB_WORKSPACE%\build\win\vs2022\release" + for %%P in (api_regular api_experimental steamclient_experimental_stub steamclient_experimental steamclient_experimental_loader steamclient_experimental_extra lib_game_overlay_renderer lib_steamnetworkingsockets tool_lobby_connect tool_generate_interfaces) do ( for %%A in (x64 Win32) do ( echo === Building %%P [%%A release] === @@ -104,6 +117,33 @@ jobs: msbuild /nologo /t:lib_steam_old /m /v:m /p:Configuration=release,Platform=Win32 gbe.sln if errorlevel 1 echo Warning: lib_steam_old Win32 release build failed + rem Per-target failures above are warn-only (e.g. signing of a dev-only tool, + rem or lib_steam_old). Don't let them abort the job here; the next step gates + rem the release on the actual shippable DLLs existing. + exit /b 0 + + - name: "Verify shippable DLLs built" + shell: cmd + working-directory: "${{ github.workspace }}" + run: | + setlocal enabledelayedexpansion + set "OUT=%GITHUB_WORKSPACE%\build\win\vs2022\release" + set "MISSING=" + rem premake emits 32-bit to the x86 dir (and 64-bit to x64). + for %%F in ( + "regular\x64\steam_api64.dll" + "regular\x86\steam_api.dll" + "experimental\x64\steam_api64.dll" + "experimental\x86\steam_api.dll" + ) do ( + if exist "%OUT%\%%~F" ( echo OK: %%~F ) else ( echo MISSING: %%~F & set "MISSING=1" ) + ) + if defined MISSING ( + echo One or more shippable steam_api DLLs are missing - failing the build. + exit /b 1 + ) + echo All shippable steam_api DLLs present. + - name: "Package build (release)" shell: cmd working-directory: "${{ github.workspace }}" diff --git a/.github/workflows/emu-deps-win.yml b/.github/workflows/emu-deps-win.yml index 8cf613082..007d7f6d0 100644 --- a/.github/workflows/emu-deps-win.yml +++ b/.github/workflows/emu-deps-win.yml @@ -2,7 +2,19 @@ name: "Emu third-party dependencies (Windows)" on: workflow_call: + inputs: + force_rebuild: + description: "Wipe the local deps cache and rebuild from scratch" + required: false + type: boolean + default: false workflow_dispatch: + inputs: + force_rebuild: + description: "Wipe the local deps cache and rebuild from scratch" + required: false + type: boolean + default: false permissions: contents: "write" @@ -23,12 +35,24 @@ jobs: id: "local-deps-check" shell: cmd run: | - if exist "%LOCAL_DEPS_DIR%\vs2022\protobuf\install64" ( + if /I "${{ inputs.force_rebuild }}"=="true" ( + echo Force rebuild requested - wiping %LOCAL_DEPS_DIR%\vs2022 + if exist "%LOCAL_DEPS_DIR%\vs2022" rmdir /s /q "%LOCAL_DEPS_DIR%\vs2022" + ) + rem Require markers from multiple deps, not just protobuf: a partial cache + rem (e.g. protobuf present but zlibstatic.lib missing) used to pass this + rem check and never refresh, which broke api_regular linking. Treat a + rem missing critical lib as "needs rebuild". + set DEPS_OK=1 + if not exist "%LOCAL_DEPS_DIR%\vs2022\protobuf\install64" set DEPS_OK=0 + if not exist "%LOCAL_DEPS_DIR%\vs2022\zlib\install64\lib\zlibstatic.lib" set DEPS_OK=0 + if not exist "%LOCAL_DEPS_DIR%\vs2022\sdl\install64\lib\SDL3-static.lib" set DEPS_OK=0 + if "%DEPS_OK%"=="1" ( echo deps_exist=true>>%GITHUB_OUTPUT% - echo Deps already exist at %LOCAL_DEPS_DIR% + echo Deps already exist and look complete at %LOCAL_DEPS_DIR% ) else ( echo deps_exist=false>>%GITHUB_OUTPUT% - echo Deps not found, will build + echo Deps missing or incomplete, will build ) - name: "Checkout branch" @@ -60,6 +84,14 @@ jobs: ref: "third-party/deps/common" path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/common" + - name: "Enable long paths (best-effort)" + if: steps.local-deps-check.outputs.deps_exist != 'true' + shell: cmd + run: | + rem Deeply nested dep build paths (abseil etc.) can exceed Windows' 260-char + rem MAX_PATH. Best-effort enable long paths; ignore failure if not admin. + reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f || ver > nul + - name: "Build deps" if: steps.local-deps-check.outputs.deps_exist != 'true' shell: cmd diff --git a/dll/steam_client_interface_getter.cpp b/dll/steam_client_interface_getter.cpp index cdde57ebb..686be092d 100644 --- a/dll/steam_client_interface_getter.cpp +++ b/dll/steam_client_interface_getter.cpp @@ -30,7 +30,8 @@ ISteamBilling *Steam_Client::GetISteamBilling( HSteamUser hSteamUser, HSteamPipe return reinterpret_cast(static_cast(steam_billing)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } void *Steam_Client::GetISteamBilling_old( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) @@ -49,7 +50,8 @@ ISteamAppDisableUpdate *Steam_Client::GetISteamAppDisableUpdate( HSteamUser hSte return reinterpret_cast(static_cast(steam_app_disable_update)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // retrieves the ISteamTimeline interface associated with the handle @@ -68,7 +70,8 @@ ISteamTimeline *Steam_Client::GetISteamTimeline( HSteamUser hSteamUser, HSteamPi return reinterpret_cast(static_cast(steam_timeline)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // retrieves the ISteamGameStats interface associated with the handle @@ -89,7 +92,8 @@ ISteamGameStats *Steam_Client::GetISteamGameStats( HSteamUser hSteamUser, HSteam return reinterpret_cast(static_cast(steam_gamestats_tmp)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // retrieves the ISteamUser interface associated with the handle @@ -162,7 +166,8 @@ ISteamUser *Steam_Client::GetISteamUser( HSteamUser hSteamUser, HSteamPipe hStea return reinterpret_cast(static_cast(steam_user_tmp)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // retrieves the ISteamGameServer interface associated with the handle @@ -207,7 +212,8 @@ ISteamGameServer *Steam_Client::GetISteamGameServer( HSteamUser hSteamUser, HSte return reinterpret_cast(static_cast(steam_gameserver)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // returns the ISteamFriends interface @@ -254,7 +260,8 @@ ISteamFriends *Steam_Client::GetISteamFriends( HSteamUser hSteamUser, HSteamPipe return reinterpret_cast(static_cast(steam_friends)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // returns the ISteamUtils interface @@ -294,7 +301,8 @@ ISteamUtils *Steam_Client::GetISteamUtils( HSteamPipe hSteamPipe, const char *pc return reinterpret_cast(static_cast(steam_utils_temp)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // returns the ISteamMatchmaking interface @@ -323,7 +331,8 @@ ISteamMatchmaking *Steam_Client::GetISteamMatchmaking( HSteamUser hSteamUser, HS return reinterpret_cast(static_cast(steam_matchmaking)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // returns the ISteamMatchmakingServers interface @@ -338,7 +347,8 @@ ISteamMatchmakingServers *Steam_Client::GetISteamMatchmakingServers( HSteamUser return reinterpret_cast(static_cast(steam_matchmaking_servers)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // returns the a generic interface @@ -539,7 +549,8 @@ void *Steam_Client::GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe } PRINT_DEBUG("No interface: %s", pchVersion); - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // returns the ISteamUserStats interface @@ -576,7 +587,8 @@ ISteamUserStats *Steam_Client::GetISteamUserStats( HSteamUser hSteamUser, HSteam return reinterpret_cast(static_cast(steam_user_stats)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // returns the ISteamGameServerStats interface @@ -589,7 +601,8 @@ ISteamGameServerStats *Steam_Client::GetISteamGameServerStats( HSteamUser hSteam return reinterpret_cast(static_cast(steam_gameserverstats)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // returns apps interface @@ -625,7 +638,8 @@ ISteamApps *Steam_Client::GetISteamApps( HSteamUser hSteamUser, HSteamPipe hStea return reinterpret_cast(static_cast(steam_apps_temp)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // networking @@ -656,7 +670,8 @@ ISteamNetworking *Steam_Client::GetISteamNetworking( HSteamUser hSteamUser, HSte return reinterpret_cast(static_cast(steam_networking_temp)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // remote storage @@ -699,7 +714,8 @@ ISteamRemoteStorage *Steam_Client::GetISteamRemoteStorage( HSteamUser hSteamuser return reinterpret_cast(static_cast(steam_remote_storage)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // user screenshots @@ -716,7 +732,8 @@ ISteamScreenshots *Steam_Client::GetISteamScreenshots( HSteamUser hSteamuser, HS return reinterpret_cast(static_cast(steam_screenshots)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } @@ -741,7 +758,8 @@ ISteamHTTP *Steam_Client::GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hStea return reinterpret_cast(static_cast(steam_http_temp)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // Deprecated - the ISteamUnifiedMessages interface is no longer intended for public consumption. @@ -754,7 +772,8 @@ void *Steam_Client::DEPRECATED_GetISteamUnifiedMessages( HSteamUser hSteamuser, return reinterpret_cast(static_cast(steam_unified_messages)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } ISteamUnifiedMessages *Steam_Client::GetISteamUnifiedMessages( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) @@ -766,7 +785,8 @@ ISteamUnifiedMessages *Steam_Client::GetISteamUnifiedMessages( HSteamUser hSteam return reinterpret_cast(static_cast(steam_unified_messages)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // Exposes the ISteamController interface @@ -795,7 +815,8 @@ ISteamController *Steam_Client::GetISteamController( HSteamUser hSteamUser, HSte return reinterpret_cast(static_cast(steam_controller)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // Exposes the ISteamUGC interface @@ -858,7 +879,8 @@ ISteamUGC *Steam_Client::GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamP return reinterpret_cast(static_cast(steam_ugc_temp)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // returns app list interface, only available on specially registered apps @@ -871,7 +893,8 @@ ISteamAppList *Steam_Client::GetISteamAppList( HSteamUser hSteamUser, HSteamPipe return reinterpret_cast(static_cast(steam_applist)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // Music Player @@ -884,7 +907,8 @@ ISteamMusic *Steam_Client::GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSt return reinterpret_cast(static_cast(steam_music)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // Music Player Remote @@ -897,7 +921,8 @@ ISteamMusicRemote *Steam_Client::GetISteamMusicRemote(HSteamUser hSteamuser, HSt return reinterpret_cast(static_cast(steam_musicremote)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // html page display @@ -918,7 +943,8 @@ ISteamHTMLSurface *Steam_Client::GetISteamHTMLSurface(HSteamUser hSteamuser, HSt return reinterpret_cast(static_cast(steam_HTMLsurface)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // inventory @@ -942,7 +968,8 @@ ISteamInventory *Steam_Client::GetISteamInventory( HSteamUser hSteamuser, HSteam return reinterpret_cast(static_cast(steam_inventory_temp)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // Video @@ -961,7 +988,8 @@ ISteamVideo *Steam_Client::GetISteamVideo( HSteamUser hSteamuser, HSteamPipe hSt return reinterpret_cast(static_cast(steam_video)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // Parental controls @@ -974,7 +1002,8 @@ ISteamParentalSettings *Steam_Client::GetISteamParentalSettings( HSteamUser hSte return reinterpret_cast(static_cast(steam_parental)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } ISteamMasterServerUpdater *Steam_Client::GetISteamMasterServerUpdater( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) @@ -986,7 +1015,8 @@ ISteamMasterServerUpdater *Steam_Client::GetISteamMasterServerUpdater( HSteamUse return reinterpret_cast(static_cast(steam_masterserver_updater)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } ISteamContentServer *Steam_Client::GetISteamContentServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) @@ -1006,7 +1036,8 @@ ISteamGameSearch *Steam_Client::GetISteamGameSearch( HSteamUser hSteamuser, HSte return reinterpret_cast(static_cast(steam_game_search)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // Exposes the Steam Input interface for controller support @@ -1025,7 +1056,8 @@ ISteamInput *Steam_Client::GetISteamInput( HSteamUser hSteamUser, HSteamPipe hSt return reinterpret_cast(static_cast(steam_controller)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } // Steam Parties interface @@ -1038,7 +1070,8 @@ ISteamParties *Steam_Client::GetISteamParties( HSteamUser hSteamUser, HSteamPipe return reinterpret_cast(static_cast(steam_parties)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } ISteamRemotePlay *Steam_Client::GetISteamRemotePlay( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) @@ -1056,7 +1089,8 @@ ISteamRemotePlay *Steam_Client::GetISteamRemotePlay( HSteamUser hSteamUser, HSte return reinterpret_cast(static_cast(steam_remoteplay)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } ISteamAppTicket *Steam_Client::GetAppTicket( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) @@ -1068,7 +1102,8 @@ ISteamAppTicket *Steam_Client::GetAppTicket( HSteamUser hSteamUser, HSteamPipe h return reinterpret_cast(static_cast(steam_app_ticket)); } - report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME); + report_missing_impl(pchVersion, EMU_FUNC_NAME); + return nullptr; // unknown interface version: emulate real steamclient (null), never exit } void Steam_Client::report_missing_impl(std::string_view itf, std::string_view caller) @@ -1108,11 +1143,13 @@ void Steam_Client::report_missing_impl(std::string_view itf, std::string_view ca } catch(...) { } -#if defined(__WINDOWS__) - MessageBoxA(nullptr, ss.str().c_str(), "Missing interface", MB_OK); -#endif + // NOTE: no MessageBox here. The blocking "Missing interface" modal could + // fatally stall/kill games under Proton/Wine. report_missing_impl is now a + // pure (non-blocking, non-exiting) logger; callers decide how to recover. } +// Legacy: log + hard-exit. No longer used by the interface getters (they now +// return null like real steamclient on an unknown version) — kept for compat. void Steam_Client::report_missing_impl_and_exit(std::string_view itf, std::string_view caller) { report_missing_impl(itf, caller); diff --git a/premake5-deps.lua b/premake5-deps.lua index 2c9a04631..e6a9df7be 100644 --- a/premake5-deps.lua +++ b/premake5-deps.lua @@ -550,11 +550,26 @@ if _OPTIONS["build-zlib"] or _OPTIONS["all-build"] then local zlib_common_defs = { "ZLIB_BUILD_EXAMPLES=OFF", } + -- The current zlib installs its static lib as 'zs.lib', but downstream deps + -- (protobuf, curl) are pointed at ZLIB_LIBRARY=.../zlibstatic.lib by wild_zlib. + -- Mirror zs.lib -> zlibstatic.lib after each build so those hardcoded paths + -- resolve on a clean build (a stale zlibstatic.lib used to hide this on warm runners). + local function mirror_zlib_static(arch_iden) + local libdir = path.join(deps_dir, 'zlib', 'install' .. arch_iden, 'lib') + local zs = path.join(libdir, 'zs.lib') + local zstatic = path.join(libdir, 'zlibstatic.lib') + if os.isfile(zs) then + print('mirroring ' .. zs .. ' -> ' .. zstatic) + os.copyfile(zs, zstatic) + end + end if _OPTIONS["32-build"] then cmake_build('zlib', true, zlib_common_defs) + mirror_zlib_static('32') end if _OPTIONS["64-build"] then cmake_build('zlib', false, zlib_common_defs) + mirror_zlib_static('64') end end diff --git a/steam_old_lib/dllmain.cpp b/steam_old_lib/dllmain.cpp index 73fd974be..545fab2c0 100644 --- a/steam_old_lib/dllmain.cpp +++ b/steam_old_lib/dllmain.cpp @@ -18,12 +18,13 @@ #include // WinVerifyTrust -#ifndef EMU_RELEASE_BUILD #include "dbg_log/dbg_log.hpp" -#endif - -#ifndef EMU_RELEASE_BUILD +// Define the global dbg_logger unconditionally: PRINT_DEBUG (common_includes.h) +// references it in release builds too now (the GSE_FORCE_LOG refactor gates logging +// at runtime via dbg_log::is_active(), not at compile time). base.cpp defines it the +// same way; leaving this under EMU_RELEASE_BUILD made lib_steam_old fail to link in +// release (LNK2019 unresolved dbg_logger). dbg_log dbg_logger( []{ static wchar_t dll_path[8192]{}; @@ -33,7 +34,6 @@ dbg_log dbg_logger( + "STEAM_OLD_LOG_" + std::to_string(common_helpers::rand_number(UINT32_MAX)) + ".log"; }() ); -#endif static bool dll_loaded = false;