openvibers/source.openvibe.games Commits
Fix Linux SDK wrapper and Win32 libz link input
Changes
@@@ -9,6 +9,7 @@ on:default: "1"push:branches:++ - main- codex/openvibe-next-steps- copilot/continue-windows-dll-workpaths:nnew file mode 100644@@@ -0,0 +1,6 @@++# Linux podman wrapper + Win32 libz build fixes++++This patch fixes two local build blockers:++++1. `tools/build-sdk-linux.sh` no longer uses `exec ./buildallprojects`. It captures the exit status and treats the build as successful when Valve's podman wrapper emits post-build signal-forwarding noise after all required Linux64 outputs have already been produced.++2. `tools/build-sdk-windows.ps1` creates a tiny Win32 placeholder `libz.lib` in `engine/source-sdk-2013/src/lib/public` when targeting Proton/x86. Valve's public Source SDK checkout can generate an HL2MP Win32 client project that references `..\..\lib\public\libz.lib`, but that x86 library is not present in the checkout. The current OpenVibe HL2MP client path does not use zlib symbols; if future code does, link.exe will fail with unresolved externals and this placeholder must be replaced by a real zlib build.@@@ -12,4 +12,22 @@ cd "$SDK/src"dos2unix buildallprojects sdk_container >/dev/null 2>&1 || truechmod +x buildallprojects sdk_container >/dev/null 2>&1 || true--exec ./buildallprojects++# OPENVIBE_LINUX_BUILDCALLPROJECTS_STATUS_GUARD++# Valve's sdk_container/podman wrapper can print "forwarding signal 28 ... container has already been removed"++# after Ninja has already finished successfully. Do not hide real compiler errors, but if the expected++# Linux64 outputs exist, treat that post-build container cleanup status as success.++set +e++./buildallprojects++status=$?++set -e++++if [[ "$status" -ne 0 ]]; then++ if [[ -f "$SDK/game/mod_hl2mp/bin/linux64/client.so" && \++ -f "$SDK/game/mod_hl2mp/bin/linux64/server.so" && \++ -f "$SDK/game/mod_hl2mp/bin/linux64/game_shader_generic_example.so" ]]; then++ echo "[openvibe warn] buildallprojects exited $status after producing required Linux64 outputs; treating as success"++ exit 0++ fi++ echo "[openvibe error] buildallprojects exited $status and required Linux64 outputs are missing" >&2++ exit "$status"++fi@@@ -771,6 +771,49 @@ function Resolve-OpenVibeWin32PublicLibDependencies {Format-Table -AutoSize | Out-File $log -Append}++++# OPENVIBE_WIN32_LIBZ_STUB_FOR_PROTON++function Ensure-OpenVibeWin32LibZStub {++ param([string]$PublicLibDir)++++ if ($script:OpenVibeTargetArch -ne "x86") { return }++++ $log = Join-Path $LogDir "win32-libz-stub.txt"++ "=== Ensure-OpenVibeWin32LibZStub ===" | Out-File $log++ "publicLibDir=$PublicLibDir" | Out-File $log -Append++++ New-Item -ItemType Directory -Force -Path $PublicLibDir | Out-Null++ $dest = Join-Path $PublicLibDir "libz.lib"++ if (Test-Path $dest) {++ "present=$dest" | Out-File $log -Append++ Say "libz.lib already present: $dest"++ return++ }++++ # VPC's HL2MP Windows client project references ..\..\lib\public\libz.lib for Win32,++ # but Valve's public GitHub SDK checkout does not ship/build that x86 library. The current++ # OpenVibe HL2MP client path does not use zlib symbols; the missing input file alone breaks++ # the link. Provide a tiny inert COFF library so link.exe can continue. If future code starts++ # requiring real zlib symbols, the link will fail with unresolved externals and this stub must++ # be replaced with a real zlib build.++ $stubDir = Join-Path $LogDir "libz-stub"++ New-Item -ItemType Directory -Force -Path $stubDir | Out-Null++ $stubC = Join-Path $stubDir "openvibe_libz_stub.c"++ $stubObj = Join-Path $stubDir "openvibe_libz_stub.obj"++ Set-Content -Encoding ascii -Path $stubC -Value "int openvibe_libz_placeholder_symbol = 0;`r`n"++++ Say "creating Win32 placeholder libz.lib for Source SDK public lib dir"++ & cl.exe /nologo /c /TC /Fo$stubObj $stubC 2>&1 | Tee-Object -FilePath $log -Append | Out-Host++ if ($LASTEXITCODE -ne 0 -or !(Test-Path $stubObj)) { throw "Failed to compile libz stub object. Check win32-libz-stub.txt." }++++ & lib.exe /nologo /machine:X86 /out:$dest $stubObj 2>&1 | Tee-Object -FilePath $log -Append | Out-Host++ if ($LASTEXITCODE -ne 0 -or !(Test-Path $dest)) { throw "Failed to create placeholder libz.lib. Check win32-libz-stub.txt." }++++ $item = Get-Item $dest++ "created=$dest length=$($item.Length)" | Out-File $log -Append++ Say "created $dest"++}++# Generate projects if no relevant vcxproj files exist yet.$clientProjects = @(Get-ChildItem -Path $Src -Recurse -File -Filter "*client*hl2mp*.vcxproj" -ErrorAction SilentlyContinue)$serverProjects = @(Get-ChildItem -Path $Src -Recurse -File -Filter "*server*hl2mp*.vcxproj" -ErrorAction SilentlyContinue)@@@ -844,6 +887,7 @@ Build-SourceSdkDependencyProjects# OPENVIBE_RESOLVE_WIN32_PUBLIC_LIB_DEPS_CALL$resolvePublicLibDir = if ($script:OpenVibeTargetArch -eq "x86") { Join-Path $Src "lib/public" } else { Join-Path $Src "lib/public/x64" }Resolve-OpenVibeWin32PublicLibDependencies -Projects @($clientProject, $serverProject) -PublicLibDir $resolvePublicLibDir++Ensure-OpenVibeWin32LibZStub -PublicLibDir $resolvePublicLibDir# OPENVIBE_WIN32_PRE_CLIENT_LINK_LIB_AUDIT$publicLibDirAudit = if ($script:OpenVibeTargetArch -eq "x86") { Join-Path $Src "lib/public" } else { Join-Path $Src "lib/public/x64" }@@@ -851,7 +895,7 @@ $publicLibDirAudit = if ($script:OpenVibeTargetArch -eq "x86") { Join-Path $Src"target arch=$script:OpenVibeTargetArch" | Out-File (Join-Path $LogDir "public-libs-before-client-link.txt") -Append"dir=$publicLibDirAudit" | Out-File (Join-Path $LogDir "public-libs-before-client-link.txt") -Append# Spot-check known required libs--foreach ($lib in @("bitmap.lib","choreoobjects.lib","tier1.lib","tier2.lib","mathlib.lib","raytrace.lib","dmxloader.lib","dmserializers.lib","datamodel.lib","particles.lib","appframework.lib","vgui_controls.lib","vgui_surfacelib.lib","matsys_controls.lib")) {++foreach ($lib in @("bitmap.lib","choreoobjects.lib","tier1.lib","tier2.lib","mathlib.lib","raytrace.lib","dmxloader.lib","dmserializers.lib","datamodel.lib","particles.lib","appframework.lib","vgui_controls.lib","vgui_surfacelib.lib","matsys_controls.lib","libz.lib")) {$lp = Join-Path $publicLibDirAudit $libif (Test-Path $lp) {$item = Get-Item $lp
@@ -9,6 +9,7 @@ on:
@@ -9,6 +9,7 @@ on:
default: "1"
default: "1"
push:
push:
branches:
branches:
+ - main
- codex/openvibe-next-steps
- codex/openvibe-next-steps
- copilot/continue-windows-dll-work
- copilot/continue-windows-dll-work
paths:
paths:
new file mode 100644
new file mode 100644
@@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
+# Linux podman wrapper + Win32 libz build fixes
+
+This patch fixes two local build blockers:
+
+1. `tools/build-sdk-linux.sh` no longer uses `exec ./buildallprojects`. It captures the exit status and treats the build as successful when Valve's podman wrapper emits post-build signal-forwarding noise after all required Linux64 outputs have already been produced.
+2. `tools/build-sdk-windows.ps1` creates a tiny Win32 placeholder `libz.lib` in `engine/source-sdk-2013/src/lib/public` when targeting Proton/x86. Valve's public Source SDK checkout can generate an HL2MP Win32 client project that references `..\..\lib\public\libz.lib`, but that x86 library is not present in the checkout. The current OpenVibe HL2MP client path does not use zlib symbols; if future code does, link.exe will fail with unresolved externals and this placeholder must be replaced by a real zlib build.
@@ -12,4 +12,22 @@ cd "$SDK/src"
@@ -12,4 +12,22 @@ cd "$SDK/src"
dos2unix buildallprojects sdk_container >/dev/null 2>&1 || true
dos2unix buildallprojects sdk_container >/dev/null 2>&1 || true
chmod +x buildallprojects sdk_container >/dev/null 2>&1 || true
chmod +x buildallprojects sdk_container >/dev/null 2>&1 || true
-exec ./buildallprojects
+# OPENVIBE_LINUX_BUILDCALLPROJECTS_STATUS_GUARD
+# Valve's sdk_container/podman wrapper can print "forwarding signal 28 ... container has already been removed"
+# after Ninja has already finished successfully. Do not hide real compiler errors, but if the expected
+# Linux64 outputs exist, treat that post-build container cleanup status as success.
+set +e
+./buildallprojects
+status=$?
+set -e
+
+if [[ "$status" -ne 0 ]]; then
+ if [[ -f "$SDK/game/mod_hl2mp/bin/linux64/client.so" && \
+ -f "$SDK/game/mod_hl2mp/bin/linux64/server.so" && \
+ -f "$SDK/game/mod_hl2mp/bin/linux64/game_shader_generic_example.so" ]]; then
+ echo "[openvibe warn] buildallprojects exited $status after producing required Linux64 outputs; treating as success"
+ exit 0
+ fi
+ echo "[openvibe error] buildallprojects exited $status and required Linux64 outputs are missing" >&2
+ exit "$status"
+fi
@@ -771,6 +771,49 @@ function Resolve-OpenVibeWin32PublicLibDependencies {
@@ -771,6 +771,49 @@ function Resolve-OpenVibeWin32PublicLibDependencies {
Format-Table -AutoSize | Out-File $log -Append
Format-Table -AutoSize | Out-File $log -Append
}
}
+
+# OPENVIBE_WIN32_LIBZ_STUB_FOR_PROTON
+function Ensure-OpenVibeWin32LibZStub {
+ param([string]$PublicLibDir)
+
+ if ($script:OpenVibeTargetArch -ne "x86") { return }
+
+ $log = Join-Path $LogDir "win32-libz-stub.txt"
+ "=== Ensure-OpenVibeWin32LibZStub ===" | Out-File $log
+ "publicLibDir=$PublicLibDir" | Out-File $log -Append
+
+ New-Item -ItemType Directory -Force -Path $PublicLibDir | Out-Null
+ $dest = Join-Path $PublicLibDir "libz.lib"
+ if (Test-Path $dest) {
+ "present=$dest" | Out-File $log -Append
+ Say "libz.lib already present: $dest"
+ return
+ }
+
+ # VPC's HL2MP Windows client project references ..\..\lib\public\libz.lib for Win32,
+ # but Valve's public GitHub SDK checkout does not ship/build that x86 library. The current
+ # OpenVibe HL2MP client path does not use zlib symbols; the missing input file alone breaks
+ # the link. Provide a tiny inert COFF library so link.exe can continue. If future code starts
+ # requiring real zlib symbols, the link will fail with unresolved externals and this stub must
+ # be replaced with a real zlib build.
+ $stubDir = Join-Path $LogDir "libz-stub"
+ New-Item -ItemType Directory -Force -Path $stubDir | Out-Null
+ $stubC = Join-Path $stubDir "openvibe_libz_stub.c"
+ $stubObj = Join-Path $stubDir "openvibe_libz_stub.obj"
+ Set-Content -Encoding ascii -Path $stubC -Value "int openvibe_libz_placeholder_symbol = 0;`r`n"
+
+ Say "creating Win32 placeholder libz.lib for Source SDK public lib dir"
+ & cl.exe /nologo /c /TC /Fo$stubObj $stubC 2>&1 | Tee-Object -FilePath $log -Append | Out-Host
+ if ($LASTEXITCODE -ne 0 -or !(Test-Path $stubObj)) { throw "Failed to compile libz stub object. Check win32-libz-stub.txt." }
+
+ & lib.exe /nologo /machine:X86 /out:$dest $stubObj 2>&1 | Tee-Object -FilePath $log -Append | Out-Host
+ if ($LASTEXITCODE -ne 0 -or !(Test-Path $dest)) { throw "Failed to create placeholder libz.lib. Check win32-libz-stub.txt." }
+
+ $item = Get-Item $dest
+ "created=$dest length=$($item.Length)" | Out-File $log -Append
+ Say "created $dest"
+}
+
# Generate projects if no relevant vcxproj files exist yet.
# Generate projects if no relevant vcxproj files exist yet.
$clientProjects = @(Get-ChildItem -Path $Src -Recurse -File -Filter "*client*hl2mp*.vcxproj" -ErrorAction SilentlyContinue)
$clientProjects = @(Get-ChildItem -Path $Src -Recurse -File -Filter "*client*hl2mp*.vcxproj" -ErrorAction SilentlyContinue)
$serverProjects = @(Get-ChildItem -Path $Src -Recurse -File -Filter "*server*hl2mp*.vcxproj" -ErrorAction SilentlyContinue)
$serverProjects = @(Get-ChildItem -Path $Src -Recurse -File -Filter "*server*hl2mp*.vcxproj" -ErrorAction SilentlyContinue)
@@ -844,6 +887,7 @@ Build-SourceSdkDependencyProjects
@@ -844,6 +887,7 @@ Build-SourceSdkDependencyProjects
# OPENVIBE_RESOLVE_WIN32_PUBLIC_LIB_DEPS_CALL
# OPENVIBE_RESOLVE_WIN32_PUBLIC_LIB_DEPS_CALL
$resolvePublicLibDir = if ($script:OpenVibeTargetArch -eq "x86") { Join-Path $Src "lib/public" } else { Join-Path $Src "lib/public/x64" }
$resolvePublicLibDir = if ($script:OpenVibeTargetArch -eq "x86") { Join-Path $Src "lib/public" } else { Join-Path $Src "lib/public/x64" }
Resolve-OpenVibeWin32PublicLibDependencies -Projects @($clientProject, $serverProject) -PublicLibDir $resolvePublicLibDir
Resolve-OpenVibeWin32PublicLibDependencies -Projects @($clientProject, $serverProject) -PublicLibDir $resolvePublicLibDir
+Ensure-OpenVibeWin32LibZStub -PublicLibDir $resolvePublicLibDir
# OPENVIBE_WIN32_PRE_CLIENT_LINK_LIB_AUDIT
# OPENVIBE_WIN32_PRE_CLIENT_LINK_LIB_AUDIT
$publicLibDirAudit = if ($script:OpenVibeTargetArch -eq "x86") { Join-Path $Src "lib/public" } else { Join-Path $Src "lib/public/x64" }
$publicLibDirAudit = if ($script:OpenVibeTargetArch -eq "x86") { Join-Path $Src "lib/public" } else { Join-Path $Src "lib/public/x64" }
@@ -851,7 +895,7 @@ $publicLibDirAudit = if ($script:OpenVibeTargetArch -eq "x86") { Join-Path $Src
@@ -851,7 +895,7 @@ $publicLibDirAudit = if ($script:OpenVibeTargetArch -eq "x86") { Join-Path $Src
"target arch=$script:OpenVibeTargetArch" | Out-File (Join-Path $LogDir "public-libs-before-client-link.txt") -Append
"target arch=$script:OpenVibeTargetArch" | Out-File (Join-Path $LogDir "public-libs-before-client-link.txt") -Append
"dir=$publicLibDirAudit" | Out-File (Join-Path $LogDir "public-libs-before-client-link.txt") -Append
"dir=$publicLibDirAudit" | Out-File (Join-Path $LogDir "public-libs-before-client-link.txt") -Append
# Spot-check known required libs
# Spot-check known required libs
-foreach ($lib in @("bitmap.lib","choreoobjects.lib","tier1.lib","tier2.lib","mathlib.lib","raytrace.lib","dmxloader.lib","dmserializers.lib","datamodel.lib","particles.lib","appframework.lib","vgui_controls.lib","vgui_surfacelib.lib","matsys_controls.lib")) {
+foreach ($lib in @("bitmap.lib","choreoobjects.lib","tier1.lib","tier2.lib","mathlib.lib","raytrace.lib","dmxloader.lib","dmserializers.lib","datamodel.lib","particles.lib","appframework.lib","vgui_controls.lib","vgui_surfacelib.lib","matsys_controls.lib","libz.lib")) {
$lp = Join-Path $publicLibDirAudit $lib
$lp = Join-Path $publicLibDirAudit $lib
if (Test-Path $lp) {
if (Test-Path $lp) {
$item = Get-Item $lp
$item = Get-Item $lp