openvibers/source.openvibe.games Commits
Improve Windows DLL workflow diagnostics
Changes
@@@ -2,21 +2,33 @@ name: Build Windows Source DLLson:workflow_dispatch:++ inputs:++ diagnostics:++ description: "Upload verbose build diagnostics"++ required: false++ default: "1"push:branches:- codex/openvibe-next-stepspaths:-- - 'sdk/openvibe/**'-- - 'game/openvibe.games/**'-- - 'tools/build-sdk-windows.ps1'-- - 'tools/build-quickjs-lib-windows.ps1'-- - '.github/workflows/windows-source-sdk-dlls.yml'++ - ".github/workflows/windows-source-sdk-dlls.yml"++ - "tools/build-sdk-windows.ps1"++ - "tools/build-quickjs-lib-windows.ps1"++ - "tools/apply-openvibe-sdk.sh"++ - "sdk/openvibe/**"++ - "game/openvibe.games/js/**"++++permissions:++ contents: read++ actions: readjobs:windows-dlls:name: Windows client.dll/server.dllruns-on: windows-2022-- timeout-minutes: 90++ defaults:++ run:++ shell: pwshsteps:- name: Checkout OpenVibe@@@ -25,56 +37,94 @@ jobs:fetch-depth: 1- name: Configure git line endings-- shell: pwshrun: |git config --global core.autocrlf false++ git config --global core.eol lf++ git status --short- name: Setup MSBuilduses: microsoft/setup-msbuild@v2-- - name: Show toolchain-- shell: pwsh++ - name: Show toolchain and treerun: |-- where msbuild-- where cl-- git --version-- pwsh --version++ $ErrorActionPreference = 'Continue'++ Write-Host "pwd=$(Get-Location)"++ git rev-parse --short HEAD++ where.exe msbuild++ where.exe cl++ where.exe link++ where.exe bash++ Get-ChildItem -Force | Select-Object Mode,Length,Name++ if (Test-Path engine) { Get-ChildItem -Force engine | Select-Object Mode,Length,Name } else { Write-Host "[miss] engine directory" }++ if (Test-Path engine/source-sdk-2013/src) { Get-ChildItem -Force engine/source-sdk-2013/src | Select-Object Mode,Length,Name } else { Write-Host "[miss] engine/source-sdk-2013/src" }- name: Build Windows Source SDK DLLs-- shell: pwsh++ id: buildrun: |-- powershell -NoProfile -ExecutionPolicy Bypass -File tools\build-sdk-windows.ps1++ $ErrorActionPreference = 'Stop'++ New-Item -ItemType Directory -Force -Path artifacts/windows-build-debug | Out-Null++ powershell -NoProfile -ExecutionPolicy Bypass -File tools/build-sdk-windows.ps1 *>&1 | Tee-Object -FilePath artifacts/windows-build-debug/build-sdk-windows.log-- - name: Stage artifacts-- shell: pwsh++ - name: Stage build outputs and diagnostics++ if: always()run: |-- New-Item -Force -ItemType Directory artifact\game\openvibe.games\bin | Out-Null-- New-Item -Force -ItemType Directory artifact\logs | Out-Null++ $ErrorActionPreference = 'Continue'++ New-Item -ItemType Directory -Force -Path artifacts/windows-dlls | Out-Null++ New-Item -ItemType Directory -Force -Path artifacts/windows-build-debug | Out-Null++++ "=== repo ===" | Out-File artifacts/windows-build-debug/tree.txt++ Get-ChildItem -Force | Format-Table -AutoSize | Out-File artifacts/windows-build-debug/tree.txt -Append++ "=== dll search ===" | Out-File artifacts/windows-build-debug/dll-search.txt++ Get-ChildItem -Recurse -Force -Include client.dll,server.dll -ErrorAction SilentlyContinue |++ Select-Object FullName,Length,LastWriteTime |++ Format-List | Out-File artifacts/windows-build-debug/dll-search.txt -Append++ "=== vc/sln search ===" | Out-File artifacts/windows-build-debug/project-search.txt++ Get-ChildItem -Recurse -Force -Include *.sln,*.vcxproj,*.vcproj,*.log -ErrorAction SilentlyContinue |++ Select-Object FullName,Length,LastWriteTime |++ Format-List | Out-File artifacts/windows-build-debug/project-search.txt -Append-- $candidates = @(-- "game\openvibe.games\bin\client.dll",-- "game\openvibe.games\bin\server.dll",-- "engine\source-sdk-2013\game\mod_hl2mp\bin\client.dll",-- "engine\source-sdk-2013\game\mod_hl2mp\bin\server.dll",-- "engine\source-sdk-2013\game\mod_hl2mp\bin\client.pdb",-- "engine\source-sdk-2013\game\mod_hl2mp\bin\server.pdb"++ $clientCandidates = @(++ "game/openvibe.games/bin/client.dll",++ "engine/source-sdk-2013/game/mod_hl2mp/bin/client.dll",++ "engine/source-sdk-2013/game/mod_hl2mp/bin/win64/client.dll",++ "engine/source-sdk-2013/game/mod_hl2mp/bin/Release/client.dll",++ "engine/source-sdk-2013/src/game/client/Release_hl2mp/client.dll",++ "engine/source-sdk-2013/src/game/client/Release/client.dll"++ )++ $serverCandidates = @(++ "game/openvibe.games/bin/server.dll",++ "engine/source-sdk-2013/game/mod_hl2mp/bin/server.dll",++ "engine/source-sdk-2013/game/mod_hl2mp/bin/win64/server.dll",++ "engine/source-sdk-2013/game/mod_hl2mp/bin/Release/server.dll",++ "engine/source-sdk-2013/src/game/server/Release_hl2mp/server.dll",++ "engine/source-sdk-2013/src/game/server/Release/server.dll")-- foreach ($file in $candidates) {-- if (Test-Path $file) {-- Copy-Item $file artifact\game\openvibe.games\bin\ -Force-- }-- }++ $client = $clientCandidates | Where-Object { Test-Path $_ } | Select-Object -First 1++ $server = $serverCandidates | Where-Object { Test-Path $_ } | Select-Object -First 1++ if ($client) { Copy-Item $client artifacts/windows-dlls/client.dll -Force }++ if ($server) { Copy-Item $server artifacts/windows-dlls/server.dll -Force }-- if (Test-Path "windows-build.log") {-- Copy-Item windows-build.log artifact\logs\windows-build.log -Force++ if (Test-Path artifacts/windows-dlls/client.dll) {++ $clientText = (Select-String -Path artifacts/windows-dlls/client.dll -Pattern "ov_join|ov_menu|OpenVibe" -Encoding Byte -SimpleMatch -Quiet)++ Write-Host "client.dll staged"++ } else {++ Write-Host "[miss] no client.dll staged"}---- Get-ChildItem artifact -Recurse | Format-Table FullName,Length++ if (Test-Path artifacts/windows-dlls/server.dll) { Write-Host "server.dll staged" } else { Write-Host "[miss] no server.dll staged" }- name: Upload Windows DLL artifact++ if: always()uses: actions/upload-artifact@v4with:name: openvibe-windows-dlls-- path: artifact/**-- if-no-files-found: error++ path: artifacts/windows-dlls/**++ if-no-files-found: warn++++ - name: Upload Windows build diagnostics++ if: always()++ uses: actions/upload-artifact@v4++ with:++ name: openvibe-windows-build-debug++ path: artifacts/windows-build-debug/**++ if-no-files-found: warn@@@ -1,91 +1,132 @@--$ErrorActionPreference = 'Stop'++$ErrorActionPreference = "Stop"--$Root = if ($env:OPENVIBE_ROOT) { $env:OPENVIBE_ROOT } else { Join-Path $HOME 'src/openvibe-source' }--$Sdk = if ($env:OPENVIBE_SDK) { $env:OPENVIBE_SDK } else { Join-Path $Root 'engine/source-sdk-2013' }++$Root = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path++$Sdk = Join-Path $Root "engine/source-sdk-2013"++$Src = Join-Path $Sdk "src"++$Mod = Join-Path $Root "game/openvibe.games"++$OutBin = Join-Path $Mod "bin"++$Qjs = Join-Path $Src "game/shared/openvibe/third_party/quickjs"++$LogDir = Join-Path $Root "artifacts/windows-build-debug"++New-Item -ItemType Directory -Force -Path $LogDir | Out-Null--Write-Host "[openvibe-win] root=$Root"--Write-Host "[openvibe-win] sdk=$Sdk"++function Say($m) { Write-Host "[openvibe-win] $m" }++function Require($p, $msg) {++ if (!(Test-Path $p)) { throw "$msg`nMissing: $p" }++}--if (!(Test-Path (Join-Path $Sdk 'src'))) { throw "Source SDK not found at $Sdk" }++Say "root=$Root"++Say "sdk=$Sdk"++Say "src=$Src"++Require $Src "Source SDK checkout is missing from this runner. The workflow must have engine/source-sdk-2013 available in the repository/submodule before Windows DLLs can build."--# Apply OpenVibe SDK copy/patches through Git Bash, but skip Linux QuickJS .a build.--$bash = Get-Command bash.exe -ErrorAction SilentlyContinue++# Apply OpenVibe source files using Git Bash when available. This reuses the Linux patcher on Windows runners.++$bash = (Get-Command bash -ErrorAction SilentlyContinue)if ($bash) {-- $rootForBash = $Root-- try {-- $rootForBash = (& $bash.Source -lc "cygpath -u '$Root'" 2>$null).Trim()-- } catch {}-- Write-Host "[openvibe-win] applying SDK patch through bash at $rootForBash"-- & $bash.Source -lc "cd '$rootForBash' && OPENVIBE_SKIP_QJS_BUILD=1 ./tools/apply-openvibe-sdk.sh"-- if ($LASTEXITCODE -ne 0) { throw "apply-openvibe-sdk.sh failed" }++ Say "applying OpenVibe SDK patch through bash"++ & bash "$Root/tools/apply-openvibe-sdk.sh"++ if ($LASTEXITCODE -ne 0) { throw "apply-openvibe-sdk.sh failed with exit code $LASTEXITCODE" }++} else {++ throw "Git Bash is required on the Windows runner to apply the OpenVibe SDK patch."++}++++# Build QuickJS as MSVC objects/lib. The Linux .a cannot be linked into Windows DLLs.++if (Test-Path (Join-Path $Root "tools/build-quickjs-lib-windows.ps1")) {++ Say "building QuickJS Windows static library"++ & powershell -NoProfile -ExecutionPolicy Bypass -File (Join-Path $Root "tools/build-quickjs-lib-windows.ps1")++ if ($LASTEXITCODE -ne 0) { throw "build-quickjs-lib-windows.ps1 failed with exit code $LASTEXITCODE" }} else {-- Write-Warning "bash.exe not found. Skipping apply-openvibe-sdk.sh. Make sure SDK files are already applied."++ Say "no build-quickjs-lib-windows.ps1 found; continuing"}--& (Join-Path $Root 'tools/build-quickjs-lib-windows.ps1')----Push-Location (Join-Path $Sdk 'src')--try {-- $vpc = @(-- (Join-Path $Sdk 'src/devtools/bin/vpc.exe'),-- (Join-Path $Sdk 'devtools/bin/vpc.exe')-- ) | Where-Object { Test-Path $_ } | Select-Object -First 1---- if (Test-Path '.\createallprojects.bat') {-- Write-Host "[openvibe-win] running createallprojects.bat"-- & cmd.exe /c createallprojects.bat-- } elseif ($vpc) {-- Write-Host "[openvibe-win] running VPC: $vpc"-- $ok = $false-- $attempts = @(-- @('/2013','/hl2mp','/game','/mksln','games.sln'),-- @('/hl2mp','/game','/mksln','games.sln'),-- @('+game','/mksln','games.sln')-- )-- foreach ($args in $attempts) {-- & $vpc @args-- if ($LASTEXITCODE -eq 0) { $ok = $true; break }++Set-Location $Src++++# Generate Visual Studio project files if needed.++$solutions = @(Get-ChildItem -Path $Src -Recurse -Filter "*.sln" -ErrorAction SilentlyContinue)++if ($solutions.Count -eq 0) {++ Say "no .sln files found; trying Source SDK project generators"++ $generators = @(++ (Join-Path $Src "creategameprojects.bat"),++ (Join-Path $Src "createallprojects.bat"),++ (Join-Path $Src "createprojects.bat")++ )++ $ran = $false++ foreach ($gen in $generators) {++ if (Test-Path $gen) {++ Say "running $gen"++ & cmd /c "`"$gen`"" | Tee-Object -FilePath (Join-Path $LogDir "project-generation.log")++ $ran = $true++ break}-- if (!$ok) { throw "VPC solution generation failed" }-- } else {-- throw "Could not find createallprojects.bat or vpc.exe"}-- $sln = Get-ChildItem -Path . -Recurse -Filter *.sln | Where-Object { $_.Name -match 'game|hl2mp|everything|sdk' } | Select-Object -First 1-- if (!$sln) { $sln = Get-ChildItem -Path . -Recurse -Filter *.sln | Select-Object -First 1 }-- if (!$sln) { throw "No Visual Studio solution generated" }++ if (-not $ran) {++ $vpc = Join-Path $Src "devtools/bin/vpc.exe"++ if (Test-Path $vpc) {++ Say "running vpc.exe fallback"++ & $vpc /hl2mp +game /mksln OpenVibe_HL2MP.sln | Tee-Object -FilePath (Join-Path $LogDir "vpc.log")++ $ran = $true++ }++ }-- $msbuild = $null-- $vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio/Installer/vswhere.exe'-- if (Test-Path $vswhere) {-- $msbuild = (& $vswhere -latest -products * -requires Microsoft.Component.MSBuild -find 'MSBuild\**\Bin\MSBuild.exe' | Select-Object -First 1)++ $solutions = @(Get-ChildItem -Path $Src -Recurse -Filter "*.sln" -ErrorAction SilentlyContinue)++ if ($solutions.Count -eq 0) {++ Get-ChildItem -Path $Src -Force | Select-Object Mode,Length,Name | Format-Table -AutoSize | Out-File (Join-Path $LogDir "src-root-after-generator.txt")++ throw "No Visual Studio solution was generated. Check openvibe-windows-build-debug artifact."}-- if (!$msbuild) { $msbuild = (Get-Command msbuild.exe -ErrorAction SilentlyContinue).Source }-- if (!$msbuild) { throw "MSBuild not found. Install Visual Studio Build Tools with C++ workload." }---- Write-Host "[openvibe-win] building $($sln.FullName)"-- $built = $false-- foreach ($platform in @('Win32','x86')) {-- foreach ($config in @('Release','Release_HL2MP','Release HL2MP')) {-- Write-Host "[openvibe-win] trying Configuration=$config Platform=$platform"-- & $msbuild $sln.FullName /m /p:Configuration=$config /p:Platform=$platform-- if ($LASTEXITCODE -eq 0) { $built = $true; break }++}++++Say "solutions found:"++$solutions | ForEach-Object { Say " $($_.FullName)" }++++# Pick the most likely HL2MP/game solution.++$solution = $solutions |++ Where-Object { $_.Name -match "hl2mp|game|sdk|everything|OpenVibe" } |++ Select-Object -First 1++if (-not $solution) { $solution = $solutions | Select-Object -First 1 }++Say "selected solution=$($solution.FullName)"++++# Try common project targets/configurations. Source SDK projects vary by branch/version.++$configs = @("Release", "Release_HL2MP", "Release HL2MP")++$platforms = @("Win32", "x86")++$targets = @("client_hl2mp", "server_hl2mp", "client", "server", "Build")++++$builtAny = $false++foreach ($cfg in $configs) {++ foreach ($plat in $platforms) {++ foreach ($target in $targets) {++ Say "msbuild cfg=$cfg platform=$plat target=$target"++ & msbuild $solution.FullName /m /p:Configuration=$cfg /p:Platform=$plat /t:$target /v:minimal /nologo 2>&1 | Tee-Object -FilePath (Join-Path $LogDir "msbuild-$($cfg -replace '[^A-Za-z0-9]','_')-$plat-$target.log")++ if ($LASTEXITCODE -eq 0) {++ $builtAny = $true++ break++ }}-- if ($built) { break }++ if ($builtAny) { break }}-- if (!$built) { throw "MSBuild failed for all known configurations" }++ if ($builtAny) { break }}--finally {-- Pop-Location++++if (-not $builtAny) {++ throw "MSBuild could not build any known Source SDK HL2MP target. Check uploaded msbuild logs."}--$modBin = Join-Path $Root 'game/openvibe.games/bin'--New-Item -ItemType Directory -Force -Path $modBin | Out-Null++New-Item -ItemType Directory -Force -Path $OutBin | Out-Null++++$client = Get-ChildItem -Path $Sdk -Recurse -Filter client.dll -ErrorAction SilentlyContinue |++ Where-Object { $_.FullName -match "hl2mp|mod_hl2mp|client" } |++ Sort-Object LastWriteTime -Descending |++ Select-Object -First 1++$server = Get-ChildItem -Path $Sdk -Recurse -Filter server.dll -ErrorAction SilentlyContinue |++ Where-Object { $_.FullName -match "hl2mp|mod_hl2mp|server" } |++ Sort-Object LastWriteTime -Descending |++ Select-Object -First 1--$client = Get-ChildItem $Sdk -Recurse -Filter client.dll -ErrorAction SilentlyContinue | Where-Object { $_.FullName -match 'mod_hl2mp|hl2mp|game\\client' } | Sort-Object FullName | Select-Object -First 1--$server = Get-ChildItem $Sdk -Recurse -Filter server.dll -ErrorAction SilentlyContinue | Where-Object { $_.FullName -match 'mod_hl2mp|hl2mp|game\\server' } | Sort-Object FullName | Select-Object -First 1++if (-not $client) { throw "client.dll was not produced" }++if (-not $server) { throw "server.dll was not produced" }--if ($client) { Copy-Item $client.FullName (Join-Path $modBin 'client.dll') -Force; Write-Host "[openvibe-win] copied client.dll from $($client.FullName)" } else { Write-Warning "client.dll not found after build" }--if ($server) { Copy-Item $server.FullName (Join-Path $modBin 'server.dll') -Force; Write-Host "[openvibe-win] copied server.dll from $($server.FullName)" } else { Write-Warning "server.dll not found after build" }++Say "copy client=$($client.FullName)"++Say "copy server=$($server.FullName)"++Copy-Item $client.FullName (Join-Path $OutBin "client.dll") -Force++Copy-Item $server.FullName (Join-Path $OutBin "server.dll") -Force--Write-Host "[openvibe-win] done. Proton/Windows client uses game/openvibe.games/bin/client.dll"++Say "done"nnew file mode 100755@@@ -0,0 +1,26 @@++#!/usr/bin/env bash++set -euo pipefail++ROOT="${OPENVIBE_ROOT:-$HOME/src/openvibe-source}"++REPO="${OPENVIBE_REPO:-OpenVibers/OpenVibe.Games}"++WORKFLOW="${OPENVIBE_WINDOWS_WORKFLOW:-windows-source-sdk-dlls.yml}"++BRANCH="$(git -C "$ROOT" rev-parse --abbrev-ref HEAD)"++OUT="$ROOT/artifacts/windows-workflow-debug"++cd "$ROOT"++mkdir -p "$OUT"++run="$(gh run list --repo "$REPO" --workflow "$WORKFLOW" --branch "$BRANCH" --limit 1 --json databaseId --jq '.[0].databaseId')"++echo "[openvibe] latest run=$run"++gh run view "$run" --repo "$REPO" --log > "$OUT/run-${run}.log" 2>&1 || true++gh run view "$run" --repo "$REPO" --log-failed > "$OUT/run-${run}-failed.log" 2>&1 || true++gh run download "$run" --repo "$REPO" --dir "$OUT/run-${run}-artifacts" || true++printf '\n[openvibe] tail of failed log:\n'++tail -n 160 "$OUT/run-${run}-failed.log" || true++printf '\n[openvibe] artifacts saved under: %s\n' "$OUT/run-${run}-artifacts"++if [[ -f "$OUT/run-${run}-artifacts/openvibe-windows-dlls/client.dll" && -f "$OUT/run-${run}-artifacts/openvibe-windows-dlls/server.dll" ]]; then++ mkdir -p game/openvibe.games/bin++ cp -f "$OUT/run-${run}-artifacts/openvibe-windows-dlls/client.dll" game/openvibe.games/bin/client.dll++ cp -f "$OUT/run-${run}-artifacts/openvibe-windows-dlls/server.dll" game/openvibe.games/bin/server.dll++ echo "[openvibe] installed DLL artifacts"++ tools/verify-openvibe-dll-content.sh || true++else++ echo "[openvibe] no DLL artifact available yet; check debug artifact/logs"++fi
@@ -2,21 +2,33 @@ name: Build Windows Source DLLs
@@ -2,21 +2,33 @@ name: Build Windows Source DLLs
on:
on:
workflow_dispatch:
workflow_dispatch:
+ inputs:
+ diagnostics:
+ description: "Upload verbose build diagnostics"
+ required: false
+ default: "1"
push:
push:
branches:
branches:
- codex/openvibe-next-steps
- codex/openvibe-next-steps
paths:
paths:
- - 'sdk/openvibe/**'
- - 'game/openvibe.games/**'
- - 'tools/build-sdk-windows.ps1'
- - 'tools/build-quickjs-lib-windows.ps1'
- - '.github/workflows/windows-source-sdk-dlls.yml'
+ - ".github/workflows/windows-source-sdk-dlls.yml"
+ - "tools/build-sdk-windows.ps1"
+ - "tools/build-quickjs-lib-windows.ps1"
+ - "tools/apply-openvibe-sdk.sh"
+ - "sdk/openvibe/**"
+ - "game/openvibe.games/js/**"
+
+permissions:
+ contents: read
+ actions: read
jobs:
jobs:
windows-dlls:
windows-dlls:
name: Windows client.dll/server.dll
name: Windows client.dll/server.dll
runs-on: windows-2022
runs-on: windows-2022
- timeout-minutes: 90
+ defaults:
+ run:
+ shell: pwsh
steps:
steps:
- name: Checkout OpenVibe
- name: Checkout OpenVibe
@@ -25,56 +37,94 @@ jobs:
@@ -25,56 +37,94 @@ jobs:
fetch-depth: 1
fetch-depth: 1
- name: Configure git line endings
- name: Configure git line endings
- shell: pwsh
run: |
run: |
git config --global core.autocrlf false
git config --global core.autocrlf false
+ git config --global core.eol lf
+ git status --short
- name: Setup MSBuild
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
uses: microsoft/setup-msbuild@v2
- - name: Show toolchain
- shell: pwsh
+ - name: Show toolchain and tree
run: |
run: |
- where msbuild
- where cl
- git --version
- pwsh --version
+ $ErrorActionPreference = 'Continue'
+ Write-Host "pwd=$(Get-Location)"
+ git rev-parse --short HEAD
+ where.exe msbuild
+ where.exe cl
+ where.exe link
+ where.exe bash
+ Get-ChildItem -Force | Select-Object Mode,Length,Name
+ if (Test-Path engine) { Get-ChildItem -Force engine | Select-Object Mode,Length,Name } else { Write-Host "[miss] engine directory" }
+ if (Test-Path engine/source-sdk-2013/src) { Get-ChildItem -Force engine/source-sdk-2013/src | Select-Object Mode,Length,Name } else { Write-Host "[miss] engine/source-sdk-2013/src" }
- name: Build Windows Source SDK DLLs
- name: Build Windows Source SDK DLLs
- shell: pwsh
+ id: build
run: |
run: |
- powershell -NoProfile -ExecutionPolicy Bypass -File tools\build-sdk-windows.ps1
+ $ErrorActionPreference = 'Stop'
+ New-Item -ItemType Directory -Force -Path artifacts/windows-build-debug | Out-Null
+ powershell -NoProfile -ExecutionPolicy Bypass -File tools/build-sdk-windows.ps1 *>&1 | Tee-Object -FilePath artifacts/windows-build-debug/build-sdk-windows.log
- - name: Stage artifacts
- shell: pwsh
+ - name: Stage build outputs and diagnostics
+ if: always()
run: |
run: |
- New-Item -Force -ItemType Directory artifact\game\openvibe.games\bin | Out-Null
- New-Item -Force -ItemType Directory artifact\logs | Out-Null
+ $ErrorActionPreference = 'Continue'
+ New-Item -ItemType Directory -Force -Path artifacts/windows-dlls | Out-Null
+ New-Item -ItemType Directory -Force -Path artifacts/windows-build-debug | Out-Null
+
+ "=== repo ===" | Out-File artifacts/windows-build-debug/tree.txt
+ Get-ChildItem -Force | Format-Table -AutoSize | Out-File artifacts/windows-build-debug/tree.txt -Append
+ "=== dll search ===" | Out-File artifacts/windows-build-debug/dll-search.txt
+ Get-ChildItem -Recurse -Force -Include client.dll,server.dll -ErrorAction SilentlyContinue |
+ Select-Object FullName,Length,LastWriteTime |
+ Format-List | Out-File artifacts/windows-build-debug/dll-search.txt -Append
+ "=== vc/sln search ===" | Out-File artifacts/windows-build-debug/project-search.txt
+ Get-ChildItem -Recurse -Force -Include *.sln,*.vcxproj,*.vcproj,*.log -ErrorAction SilentlyContinue |
+ Select-Object FullName,Length,LastWriteTime |
+ Format-List | Out-File artifacts/windows-build-debug/project-search.txt -Append
- $candidates = @(
- "game\openvibe.games\bin\client.dll",
- "game\openvibe.games\bin\server.dll",
- "engine\source-sdk-2013\game\mod_hl2mp\bin\client.dll",
- "engine\source-sdk-2013\game\mod_hl2mp\bin\server.dll",
- "engine\source-sdk-2013\game\mod_hl2mp\bin\client.pdb",
- "engine\source-sdk-2013\game\mod_hl2mp\bin\server.pdb"
+ $clientCandidates = @(
+ "game/openvibe.games/bin/client.dll",
+ "engine/source-sdk-2013/game/mod_hl2mp/bin/client.dll",
+ "engine/source-sdk-2013/game/mod_hl2mp/bin/win64/client.dll",
+ "engine/source-sdk-2013/game/mod_hl2mp/bin/Release/client.dll",
+ "engine/source-sdk-2013/src/game/client/Release_hl2mp/client.dll",
+ "engine/source-sdk-2013/src/game/client/Release/client.dll"
+ )
+ $serverCandidates = @(
+ "game/openvibe.games/bin/server.dll",
+ "engine/source-sdk-2013/game/mod_hl2mp/bin/server.dll",
+ "engine/source-sdk-2013/game/mod_hl2mp/bin/win64/server.dll",
+ "engine/source-sdk-2013/game/mod_hl2mp/bin/Release/server.dll",
+ "engine/source-sdk-2013/src/game/server/Release_hl2mp/server.dll",
+ "engine/source-sdk-2013/src/game/server/Release/server.dll"
)
)
- foreach ($file in $candidates) {
- if (Test-Path $file) {
- Copy-Item $file artifact\game\openvibe.games\bin\ -Force
- }
- }
+ $client = $clientCandidates | Where-Object { Test-Path $_ } | Select-Object -First 1
+ $server = $serverCandidates | Where-Object { Test-Path $_ } | Select-Object -First 1
+ if ($client) { Copy-Item $client artifacts/windows-dlls/client.dll -Force }
+ if ($server) { Copy-Item $server artifacts/windows-dlls/server.dll -Force }
- if (Test-Path "windows-build.log") {
- Copy-Item windows-build.log artifact\logs\windows-build.log -Force
+ if (Test-Path artifacts/windows-dlls/client.dll) {
+ $clientText = (Select-String -Path artifacts/windows-dlls/client.dll -Pattern "ov_join|ov_menu|OpenVibe" -Encoding Byte -SimpleMatch -Quiet)
+ Write-Host "client.dll staged"
+ } else {
+ Write-Host "[miss] no client.dll staged"
}
}
-
- Get-ChildItem artifact -Recurse | Format-Table FullName,Length
+ if (Test-Path artifacts/windows-dlls/server.dll) { Write-Host "server.dll staged" } else { Write-Host "[miss] no server.dll staged" }
- name: Upload Windows DLL artifact
- name: Upload Windows DLL artifact
+ if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4
with:
with:
name: openvibe-windows-dlls
name: openvibe-windows-dlls
- path: artifact/**
- if-no-files-found: error
+ path: artifacts/windows-dlls/**
+ if-no-files-found: warn
+
+ - name: Upload Windows build diagnostics
+ if: always()
+ uses: actions/upload-artifact@v4
+ with:
+ name: openvibe-windows-build-debug
+ path: artifacts/windows-build-debug/**
+ if-no-files-found: warn
@@ -1,91 +1,132 @@
@@ -1,91 +1,132 @@
-$ErrorActionPreference = 'Stop'
+$ErrorActionPreference = "Stop"
-$Root = if ($env:OPENVIBE_ROOT) { $env:OPENVIBE_ROOT } else { Join-Path $HOME 'src/openvibe-source' }
-$Sdk = if ($env:OPENVIBE_SDK) { $env:OPENVIBE_SDK } else { Join-Path $Root 'engine/source-sdk-2013' }
+$Root = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
+$Sdk = Join-Path $Root "engine/source-sdk-2013"
+$Src = Join-Path $Sdk "src"
+$Mod = Join-Path $Root "game/openvibe.games"
+$OutBin = Join-Path $Mod "bin"
+$Qjs = Join-Path $Src "game/shared/openvibe/third_party/quickjs"
+$LogDir = Join-Path $Root "artifacts/windows-build-debug"
+New-Item -ItemType Directory -Force -Path $LogDir | Out-Null
-Write-Host "[openvibe-win] root=$Root"
-Write-Host "[openvibe-win] sdk=$Sdk"
+function Say($m) { Write-Host "[openvibe-win] $m" }
+function Require($p, $msg) {
+ if (!(Test-Path $p)) { throw "$msg`nMissing: $p" }
+}
-if (!(Test-Path (Join-Path $Sdk 'src'))) { throw "Source SDK not found at $Sdk" }
+Say "root=$Root"
+Say "sdk=$Sdk"
+Say "src=$Src"
+Require $Src "Source SDK checkout is missing from this runner. The workflow must have engine/source-sdk-2013 available in the repository/submodule before Windows DLLs can build."
-# Apply OpenVibe SDK copy/patches through Git Bash, but skip Linux QuickJS .a build.
-$bash = Get-Command bash.exe -ErrorAction SilentlyContinue
+# Apply OpenVibe source files using Git Bash when available. This reuses the Linux patcher on Windows runners.
+$bash = (Get-Command bash -ErrorAction SilentlyContinue)
if ($bash) {
if ($bash) {
- $rootForBash = $Root
- try {
- $rootForBash = (& $bash.Source -lc "cygpath -u '$Root'" 2>$null).Trim()
- } catch {}
- Write-Host "[openvibe-win] applying SDK patch through bash at $rootForBash"
- & $bash.Source -lc "cd '$rootForBash' && OPENVIBE_SKIP_QJS_BUILD=1 ./tools/apply-openvibe-sdk.sh"
- if ($LASTEXITCODE -ne 0) { throw "apply-openvibe-sdk.sh failed" }
+ Say "applying OpenVibe SDK patch through bash"
+ & bash "$Root/tools/apply-openvibe-sdk.sh"
+ if ($LASTEXITCODE -ne 0) { throw "apply-openvibe-sdk.sh failed with exit code $LASTEXITCODE" }
+} else {
+ throw "Git Bash is required on the Windows runner to apply the OpenVibe SDK patch."
+}
+
+# Build QuickJS as MSVC objects/lib. The Linux .a cannot be linked into Windows DLLs.
+if (Test-Path (Join-Path $Root "tools/build-quickjs-lib-windows.ps1")) {
+ Say "building QuickJS Windows static library"
+ & powershell -NoProfile -ExecutionPolicy Bypass -File (Join-Path $Root "tools/build-quickjs-lib-windows.ps1")
+ if ($LASTEXITCODE -ne 0) { throw "build-quickjs-lib-windows.ps1 failed with exit code $LASTEXITCODE" }
} else {
} else {
- Write-Warning "bash.exe not found. Skipping apply-openvibe-sdk.sh. Make sure SDK files are already applied."
+ Say "no build-quickjs-lib-windows.ps1 found; continuing"
}
}
-& (Join-Path $Root 'tools/build-quickjs-lib-windows.ps1')
-
-Push-Location (Join-Path $Sdk 'src')
-try {
- $vpc = @(
- (Join-Path $Sdk 'src/devtools/bin/vpc.exe'),
- (Join-Path $Sdk 'devtools/bin/vpc.exe')
- ) | Where-Object { Test-Path $_ } | Select-Object -First 1
-
- if (Test-Path '.\createallprojects.bat') {
- Write-Host "[openvibe-win] running createallprojects.bat"
- & cmd.exe /c createallprojects.bat
- } elseif ($vpc) {
- Write-Host "[openvibe-win] running VPC: $vpc"
- $ok = $false
- $attempts = @(
- @('/2013','/hl2mp','/game','/mksln','games.sln'),
- @('/hl2mp','/game','/mksln','games.sln'),
- @('+game','/mksln','games.sln')
- )
- foreach ($args in $attempts) {
- & $vpc @args
- if ($LASTEXITCODE -eq 0) { $ok = $true; break }
+Set-Location $Src
+
+# Generate Visual Studio project files if needed.
+$solutions = @(Get-ChildItem -Path $Src -Recurse -Filter "*.sln" -ErrorAction SilentlyContinue)
+if ($solutions.Count -eq 0) {
+ Say "no .sln files found; trying Source SDK project generators"
+ $generators = @(
+ (Join-Path $Src "creategameprojects.bat"),
+ (Join-Path $Src "createallprojects.bat"),
+ (Join-Path $Src "createprojects.bat")
+ )
+ $ran = $false
+ foreach ($gen in $generators) {
+ if (Test-Path $gen) {
+ Say "running $gen"
+ & cmd /c "`"$gen`"" | Tee-Object -FilePath (Join-Path $LogDir "project-generation.log")
+ $ran = $true
+ break
}
}
- if (!$ok) { throw "VPC solution generation failed" }
- } else {
- throw "Could not find createallprojects.bat or vpc.exe"
}
}
- $sln = Get-ChildItem -Path . -Recurse -Filter *.sln | Where-Object { $_.Name -match 'game|hl2mp|everything|sdk' } | Select-Object -First 1
- if (!$sln) { $sln = Get-ChildItem -Path . -Recurse -Filter *.sln | Select-Object -First 1 }
- if (!$sln) { throw "No Visual Studio solution generated" }
+ if (-not $ran) {
+ $vpc = Join-Path $Src "devtools/bin/vpc.exe"
+ if (Test-Path $vpc) {
+ Say "running vpc.exe fallback"
+ & $vpc /hl2mp +game /mksln OpenVibe_HL2MP.sln | Tee-Object -FilePath (Join-Path $LogDir "vpc.log")
+ $ran = $true
+ }
+ }
- $msbuild = $null
- $vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio/Installer/vswhere.exe'
- if (Test-Path $vswhere) {
- $msbuild = (& $vswhere -latest -products * -requires Microsoft.Component.MSBuild -find 'MSBuild\**\Bin\MSBuild.exe' | Select-Object -First 1)
+ $solutions = @(Get-ChildItem -Path $Src -Recurse -Filter "*.sln" -ErrorAction SilentlyContinue)
+ if ($solutions.Count -eq 0) {
+ Get-ChildItem -Path $Src -Force | Select-Object Mode,Length,Name | Format-Table -AutoSize | Out-File (Join-Path $LogDir "src-root-after-generator.txt")
+ throw "No Visual Studio solution was generated. Check openvibe-windows-build-debug artifact."
}
}
- if (!$msbuild) { $msbuild = (Get-Command msbuild.exe -ErrorAction SilentlyContinue).Source }
- if (!$msbuild) { throw "MSBuild not found. Install Visual Studio Build Tools with C++ workload." }
-
- Write-Host "[openvibe-win] building $($sln.FullName)"
- $built = $false
- foreach ($platform in @('Win32','x86')) {
- foreach ($config in @('Release','Release_HL2MP','Release HL2MP')) {
- Write-Host "[openvibe-win] trying Configuration=$config Platform=$platform"
- & $msbuild $sln.FullName /m /p:Configuration=$config /p:Platform=$platform
- if ($LASTEXITCODE -eq 0) { $built = $true; break }
+}
+
+Say "solutions found:"
+$solutions | ForEach-Object { Say " $($_.FullName)" }
+
+# Pick the most likely HL2MP/game solution.
+$solution = $solutions |
+ Where-Object { $_.Name -match "hl2mp|game|sdk|everything|OpenVibe" } |
+ Select-Object -First 1
+if (-not $solution) { $solution = $solutions | Select-Object -First 1 }
+Say "selected solution=$($solution.FullName)"
+
+# Try common project targets/configurations. Source SDK projects vary by branch/version.
+$configs = @("Release", "Release_HL2MP", "Release HL2MP")
+$platforms = @("Win32", "x86")
+$targets = @("client_hl2mp", "server_hl2mp", "client", "server", "Build")
+
+$builtAny = $false
+foreach ($cfg in $configs) {
+ foreach ($plat in $platforms) {
+ foreach ($target in $targets) {
+ Say "msbuild cfg=$cfg platform=$plat target=$target"
+ & msbuild $solution.FullName /m /p:Configuration=$cfg /p:Platform=$plat /t:$target /v:minimal /nologo 2>&1 | Tee-Object -FilePath (Join-Path $LogDir "msbuild-$($cfg -replace '[^A-Za-z0-9]','_')-$plat-$target.log")
+ if ($LASTEXITCODE -eq 0) {
+ $builtAny = $true
+ break
+ }
}
}
- if ($built) { break }
+ if ($builtAny) { break }
}
}
- if (!$built) { throw "MSBuild failed for all known configurations" }
+ if ($builtAny) { break }
}
}
-finally {
- Pop-Location
+
+if (-not $builtAny) {
+ throw "MSBuild could not build any known Source SDK HL2MP target. Check uploaded msbuild logs."
}
}
-$modBin = Join-Path $Root 'game/openvibe.games/bin'
-New-Item -ItemType Directory -Force -Path $modBin | Out-Null
+New-Item -ItemType Directory -Force -Path $OutBin | Out-Null
+
+$client = Get-ChildItem -Path $Sdk -Recurse -Filter client.dll -ErrorAction SilentlyContinue |
+ Where-Object { $_.FullName -match "hl2mp|mod_hl2mp|client" } |
+ Sort-Object LastWriteTime -Descending |
+ Select-Object -First 1
+$server = Get-ChildItem -Path $Sdk -Recurse -Filter server.dll -ErrorAction SilentlyContinue |
+ Where-Object { $_.FullName -match "hl2mp|mod_hl2mp|server" } |
+ Sort-Object LastWriteTime -Descending |
+ Select-Object -First 1
-$client = Get-ChildItem $Sdk -Recurse -Filter client.dll -ErrorAction SilentlyContinue | Where-Object { $_.FullName -match 'mod_hl2mp|hl2mp|game\\client' } | Sort-Object FullName | Select-Object -First 1
-$server = Get-ChildItem $Sdk -Recurse -Filter server.dll -ErrorAction SilentlyContinue | Where-Object { $_.FullName -match 'mod_hl2mp|hl2mp|game\\server' } | Sort-Object FullName | Select-Object -First 1
+if (-not $client) { throw "client.dll was not produced" }
+if (-not $server) { throw "server.dll was not produced" }
-if ($client) { Copy-Item $client.FullName (Join-Path $modBin 'client.dll') -Force; Write-Host "[openvibe-win] copied client.dll from $($client.FullName)" } else { Write-Warning "client.dll not found after build" }
-if ($server) { Copy-Item $server.FullName (Join-Path $modBin 'server.dll') -Force; Write-Host "[openvibe-win] copied server.dll from $($server.FullName)" } else { Write-Warning "server.dll not found after build" }
+Say "copy client=$($client.FullName)"
+Say "copy server=$($server.FullName)"
+Copy-Item $client.FullName (Join-Path $OutBin "client.dll") -Force
+Copy-Item $server.FullName (Join-Path $OutBin "server.dll") -Force
-Write-Host "[openvibe-win] done. Proton/Windows client uses game/openvibe.games/bin/client.dll"
+Say "done"
new file mode 100755
new file mode 100755
@@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+set -euo pipefail
+ROOT="${OPENVIBE_ROOT:-$HOME/src/openvibe-source}"
+REPO="${OPENVIBE_REPO:-OpenVibers/OpenVibe.Games}"
+WORKFLOW="${OPENVIBE_WINDOWS_WORKFLOW:-windows-source-sdk-dlls.yml}"
+BRANCH="$(git -C "$ROOT" rev-parse --abbrev-ref HEAD)"
+OUT="$ROOT/artifacts/windows-workflow-debug"
+cd "$ROOT"
+mkdir -p "$OUT"
+run="$(gh run list --repo "$REPO" --workflow "$WORKFLOW" --branch "$BRANCH" --limit 1 --json databaseId --jq '.[0].databaseId')"
+echo "[openvibe] latest run=$run"
+gh run view "$run" --repo "$REPO" --log > "$OUT/run-${run}.log" 2>&1 || true
+gh run view "$run" --repo "$REPO" --log-failed > "$OUT/run-${run}-failed.log" 2>&1 || true
+gh run download "$run" --repo "$REPO" --dir "$OUT/run-${run}-artifacts" || true
+printf '\n[openvibe] tail of failed log:\n'
+tail -n 160 "$OUT/run-${run}-failed.log" || true
+printf '\n[openvibe] artifacts saved under: %s\n' "$OUT/run-${run}-artifacts"
+if [[ -f "$OUT/run-${run}-artifacts/openvibe-windows-dlls/client.dll" && -f "$OUT/run-${run}-artifacts/openvibe-windows-dlls/server.dll" ]]; then
+ mkdir -p game/openvibe.games/bin
+ cp -f "$OUT/run-${run}-artifacts/openvibe-windows-dlls/client.dll" game/openvibe.games/bin/client.dll
+ cp -f "$OUT/run-${run}-artifacts/openvibe-windows-dlls/server.dll" game/openvibe.games/bin/server.dll
+ echo "[openvibe] installed DLL artifacts"
+ tools/verify-openvibe-dll-content.sh || true
+else
+ echo "[openvibe] no DLL artifact available yet; check debug artifact/logs"
+fi