openvibers/source.openvibe.games Commits
Fix Windows Source SDK MP branch bootstrap
Changes
@@@ -1,23 +1,10 @@--# Windows DLL workflow bootstrap++# Windows Source SDK bootstrap--The Windows GitHub Actions runner does not have the local `engine/source-sdk-2013` checkout that exists on the Linux workstation.++The GitHub Actions Windows runner does not have Alex's local `engine/source-sdk-2013` checkout. The workflow bootstraps it by cloning ValveSoftware/source-sdk-2013.--The workflow now bootstraps Valve's Source SDK 2013 multiplayer tree into:++Important detail: the Source SDK 2013 multiplayer code is normally on the `mp` branch, not necessarily in a `mp/` directory on the default branch. The bootstrap script now supports both layouts:--```text--engine/source-sdk-2013--```++- `source-sdk-2013` checked out directly on the `mp` branch, with `src/...` at repo root++- older/mirrored layout with `mp/src/...`--Then it applies the OpenVibe SDK patch, skips the Linux QuickJS static-library build, builds QuickJS with MSVC, generates Visual Studio projects, builds `client.dll/server.dll`, and only uploads DLLs when `client.dll` contains OpenVibe command strings such as `ov_join`, `ov_menu`, or `OpenVibe`.----Use:----```bash--tools/gh-windows-build-and-install.sh--```----or debug the latest run with:----```bash--tools/windows-workflow-debug-and-install.sh--```++The workflow should not upload or install stock/stale DLLs. A DLL artifact is considered useful only when `client.dll` contains OpenVibe command strings such as `ov_join`, `ov_menu`, or `OpenVibe`.@@@ -4,48 +4,95 @@ $Root = if ($env:OPENVIBE_ROOT) { (Resolve-Path $env:OPENVIBE_ROOT).Path } else$Sdk = if ($env:OPENVIBE_SDK) { $env:OPENVIBE_SDK } else { Join-Path $Root 'engine/source-sdk-2013' }$Src = Join-Path $Sdk 'src'$Deps = Join-Path $Root '_deps'--$ValveRepo = Join-Path $Deps 'source-sdk-2013'$LogDir = Join-Path $Root 'artifacts/windows-build-debug'New-Item -ItemType Directory -Force -Path $LogDir | Out-Nullfunction Say($m) { Write-Host "[openvibe-sdk-bootstrap] $m" }++function Has-HL2MP($base) {++ return ((Test-Path (Join-Path $base 'src/game/client/hl2mp')) -and (Test-Path (Join-Path $base 'src/game/server/hl2mp')))++}++function Run-Git($args, $logName) {++ $log = Join-Path $LogDir $logName++ Say "git $args"++ & git @args 2>&1 | Tee-Object -FilePath $log++ if ($LASTEXITCODE -ne 0) { throw "git $args failed with exit code $LASTEXITCODE. See $log" }++}Say "root=$Root"Say "sdk=$Sdk"++Say "logdir=$LogDir"--if ((Test-Path (Join-Path $Src 'game/client/hl2mp')) -and (Test-Path (Join-Path $Src 'game/server/hl2mp'))) {-- Say "existing SDK tree looks usable"++if (Has-HL2MP $Sdk) {++ Say "existing SDK tree already contains HL2MP client/server"exit 0}New-Item -ItemType Directory -Force -Path $Deps | Out-Null--if (!(Test-Path (Join-Path $ValveRepo '.git'))) {-- Say "cloning ValveSoftware/source-sdk-2013"++# Valve's source-sdk-2013 repository is normally organized by branches: mp and sp.++# Some forks/mirrors use root folders like mp/src. Support both layouts.++$RepoUrl = if ($env:OPENVIBE_SOURCE_SDK_REPO) { $env:OPENVIBE_SOURCE_SDK_REPO } else { 'https://github.com/ValveSoftware/source-sdk-2013.git' }++$ValveRepo = Join-Path $Deps 'source-sdk-2013-mp'++++if (Test-Path $ValveRepo) { Remove-Item -Recurse -Force $ValveRepo }++++$cloned = $false++try {++ Say "cloning Valve Source SDK 2013 branch mp"++ Run-Git @('clone','--depth','1','--branch','mp',$RepoUrl,$ValveRepo) 'bootstrap-git-clone-mp.log'++ $cloned = $true++} catch {++ Say "mp branch clone failed: $($_.Exception.Message)"if (Test-Path $ValveRepo) { Remove-Item -Recurse -Force $ValveRepo }-- git clone --depth 1 https://github.com/ValveSoftware/source-sdk-2013.git $ValveRepo 2>&1 | Tee-Object -FilePath (Join-Path $LogDir 'bootstrap-git-clone.log')--} else {-- Say "updating cached Valve source-sdk-2013"-- Push-Location $ValveRepo-- git fetch --depth 1 origin 2>&1 | Tee-Object -FilePath (Join-Path $LogDir 'bootstrap-git-fetch.log')-- git reset --hard origin/master 2>&1 | Tee-Object -FilePath (Join-Path $LogDir 'bootstrap-git-reset.log')-- Pop-Location++ Say "falling back to default branch clone"++ Run-Git @('clone','--depth','1',$RepoUrl,$ValveRepo) 'bootstrap-git-clone-default.log'++ $cloned = $true++}++++if (-not $cloned) { throw "could not clone Source SDK repo" }++++"=== Valve repo root ===" | Out-File (Join-Path $LogDir 'valve-repo-root.txt')++Get-ChildItem -Force $ValveRepo | Select-Object Mode,Length,Name | Format-Table -AutoSize | Out-File (Join-Path $LogDir 'valve-repo-root.txt') -Append++"=== candidate src folders ===" | Out-File (Join-Path $LogDir 'valve-candidate-src.txt')++Get-ChildItem -Path $ValveRepo -Recurse -Directory -Filter src -ErrorAction SilentlyContinue |++ Select-Object FullName | Format-List | Out-File (Join-Path $LogDir 'valve-candidate-src.txt') -Append++++$candidates = @(++ $ValveRepo,++ (Join-Path $ValveRepo 'mp'),++ (Join-Path $ValveRepo 'srcsdk/mp'),++ (Join-Path $ValveRepo 'source-sdk-2013/mp')++)++++$SourceRoot = $null++foreach ($candidate in $candidates) {++ if (Has-HL2MP $candidate) {++ $SourceRoot = $candidate++ break++ }}--$Mp = Join-Path $ValveRepo 'mp'--if (!(Test-Path (Join-Path $Mp 'src'))) {-- Get-ChildItem -Force $ValveRepo | Select-Object Mode,Length,Name | Format-Table -AutoSize | Out-File (Join-Path $LogDir 'valve-repo-root.txt')-- throw "Valve source-sdk-2013 clone does not contain mp/src at $Mp/src"++if (-not $SourceRoot) {++ $matches = Get-ChildItem -Path $ValveRepo -Recurse -Directory -Filter hl2mp -ErrorAction SilentlyContinue |++ Where-Object { $_.FullName -match '[\\/]src[\\/]game[\\/](client|server)[\\/]hl2mp$' }++ $matches | Select-Object FullName | Format-List | Out-File (Join-Path $LogDir 'hl2mp-folder-search.txt')++ throw "Could not find Source SDK 2013 MP HL2MP layout after clone. Check valve-repo-root.txt, valve-candidate-src.txt, and hl2mp-folder-search.txt."}--Say "copying mp branch layout into $Sdk"++Say "source root=$SourceRoot"++Say "copying Source SDK MP layout into $Sdk"if (Test-Path $Sdk) { Remove-Item -Recurse -Force $Sdk }New-Item -ItemType Directory -Force -Path $Sdk | Out-Null--Copy-Item -Path (Join-Path $Mp '*') -Destination $Sdk -Recurse -Force++Copy-Item -Path (Join-Path $SourceRoot '*') -Destination $Sdk -Recurse -Force--if (!(Test-Path (Join-Path $Src 'game/client/hl2mp')) -or !(Test-Path (Join-Path $Src 'game/server/hl2mp'))) {++if (!(Has-HL2MP $Sdk)) {Get-ChildItem -Force $Sdk | Select-Object Mode,Length,Name | Format-Table -AutoSize | Out-File (Join-Path $LogDir 'sdk-root-after-copy.txt')-- throw "Bootstrapped SDK is missing expected HL2MP folders"++ throw "Bootstrapped SDK is missing expected HL2MP folders after copy"}++"=== SDK root after copy ===" | Out-File (Join-Path $LogDir 'sdk-root-after-copy.txt')++Get-ChildItem -Force $Sdk | Select-Object Mode,Length,Name | Format-Table -AutoSize | Out-File (Join-Path $LogDir 'sdk-root-after-copy.txt') -Append++"=== SDK src root after copy ===" | Out-File (Join-Path $LogDir 'sdk-src-root-after-copy.txt')++Get-ChildItem -Force (Join-Path $Sdk 'src') | Select-Object Mode,Length,Name | Format-Table -AutoSize | Out-File (Join-Path $LogDir 'sdk-src-root-after-copy.txt') -Append++Say "SDK bootstrapped successfully"
@@ -1,23 +1,10 @@
@@ -1,23 +1,10 @@
-# Windows DLL workflow bootstrap
+# Windows Source SDK bootstrap
-The Windows GitHub Actions runner does not have the local `engine/source-sdk-2013` checkout that exists on the Linux workstation.
+The GitHub Actions Windows runner does not have Alex's local `engine/source-sdk-2013` checkout. The workflow bootstraps it by cloning ValveSoftware/source-sdk-2013.
-The workflow now bootstraps Valve's Source SDK 2013 multiplayer tree into:
+Important detail: the Source SDK 2013 multiplayer code is normally on the `mp` branch, not necessarily in a `mp/` directory on the default branch. The bootstrap script now supports both layouts:
-```text
-engine/source-sdk-2013
-```
+- `source-sdk-2013` checked out directly on the `mp` branch, with `src/...` at repo root
+- older/mirrored layout with `mp/src/...`
-Then it applies the OpenVibe SDK patch, skips the Linux QuickJS static-library build, builds QuickJS with MSVC, generates Visual Studio projects, builds `client.dll/server.dll`, and only uploads DLLs when `client.dll` contains OpenVibe command strings such as `ov_join`, `ov_menu`, or `OpenVibe`.
-
-Use:
-
-```bash
-tools/gh-windows-build-and-install.sh
-```
-
-or debug the latest run with:
-
-```bash
-tools/windows-workflow-debug-and-install.sh
-```
+The workflow should not upload or install stock/stale DLLs. A DLL artifact is considered useful only when `client.dll` contains OpenVibe command strings such as `ov_join`, `ov_menu`, or `OpenVibe`.
@@ -4,48 +4,95 @@ $Root = if ($env:OPENVIBE_ROOT) { (Resolve-Path $env:OPENVIBE_ROOT).Path } else
@@ -4,48 +4,95 @@ $Root = if ($env:OPENVIBE_ROOT) { (Resolve-Path $env:OPENVIBE_ROOT).Path } else
$Sdk = if ($env:OPENVIBE_SDK) { $env:OPENVIBE_SDK } else { Join-Path $Root 'engine/source-sdk-2013' }
$Sdk = if ($env:OPENVIBE_SDK) { $env:OPENVIBE_SDK } else { Join-Path $Root 'engine/source-sdk-2013' }
$Src = Join-Path $Sdk 'src'
$Src = Join-Path $Sdk 'src'
$Deps = Join-Path $Root '_deps'
$Deps = Join-Path $Root '_deps'
-$ValveRepo = Join-Path $Deps 'source-sdk-2013'
$LogDir = Join-Path $Root 'artifacts/windows-build-debug'
$LogDir = Join-Path $Root 'artifacts/windows-build-debug'
New-Item -ItemType Directory -Force -Path $LogDir | Out-Null
New-Item -ItemType Directory -Force -Path $LogDir | Out-Null
function Say($m) { Write-Host "[openvibe-sdk-bootstrap] $m" }
function Say($m) { Write-Host "[openvibe-sdk-bootstrap] $m" }
+function Has-HL2MP($base) {
+ return ((Test-Path (Join-Path $base 'src/game/client/hl2mp')) -and (Test-Path (Join-Path $base 'src/game/server/hl2mp')))
+}
+function Run-Git($args, $logName) {
+ $log = Join-Path $LogDir $logName
+ Say "git $args"
+ & git @args 2>&1 | Tee-Object -FilePath $log
+ if ($LASTEXITCODE -ne 0) { throw "git $args failed with exit code $LASTEXITCODE. See $log" }
+}
Say "root=$Root"
Say "root=$Root"
Say "sdk=$Sdk"
Say "sdk=$Sdk"
+Say "logdir=$LogDir"
-if ((Test-Path (Join-Path $Src 'game/client/hl2mp')) -and (Test-Path (Join-Path $Src 'game/server/hl2mp'))) {
- Say "existing SDK tree looks usable"
+if (Has-HL2MP $Sdk) {
+ Say "existing SDK tree already contains HL2MP client/server"
exit 0
exit 0
}
}
New-Item -ItemType Directory -Force -Path $Deps | Out-Null
New-Item -ItemType Directory -Force -Path $Deps | Out-Null
-if (!(Test-Path (Join-Path $ValveRepo '.git'))) {
- Say "cloning ValveSoftware/source-sdk-2013"
+# Valve's source-sdk-2013 repository is normally organized by branches: mp and sp.
+# Some forks/mirrors use root folders like mp/src. Support both layouts.
+$RepoUrl = if ($env:OPENVIBE_SOURCE_SDK_REPO) { $env:OPENVIBE_SOURCE_SDK_REPO } else { 'https://github.com/ValveSoftware/source-sdk-2013.git' }
+$ValveRepo = Join-Path $Deps 'source-sdk-2013-mp'
+
+if (Test-Path $ValveRepo) { Remove-Item -Recurse -Force $ValveRepo }
+
+$cloned = $false
+try {
+ Say "cloning Valve Source SDK 2013 branch mp"
+ Run-Git @('clone','--depth','1','--branch','mp',$RepoUrl,$ValveRepo) 'bootstrap-git-clone-mp.log'
+ $cloned = $true
+} catch {
+ Say "mp branch clone failed: $($_.Exception.Message)"
if (Test-Path $ValveRepo) { Remove-Item -Recurse -Force $ValveRepo }
if (Test-Path $ValveRepo) { Remove-Item -Recurse -Force $ValveRepo }
- git clone --depth 1 https://github.com/ValveSoftware/source-sdk-2013.git $ValveRepo 2>&1 | Tee-Object -FilePath (Join-Path $LogDir 'bootstrap-git-clone.log')
-} else {
- Say "updating cached Valve source-sdk-2013"
- Push-Location $ValveRepo
- git fetch --depth 1 origin 2>&1 | Tee-Object -FilePath (Join-Path $LogDir 'bootstrap-git-fetch.log')
- git reset --hard origin/master 2>&1 | Tee-Object -FilePath (Join-Path $LogDir 'bootstrap-git-reset.log')
- Pop-Location
+ Say "falling back to default branch clone"
+ Run-Git @('clone','--depth','1',$RepoUrl,$ValveRepo) 'bootstrap-git-clone-default.log'
+ $cloned = $true
+}
+
+if (-not $cloned) { throw "could not clone Source SDK repo" }
+
+"=== Valve repo root ===" | Out-File (Join-Path $LogDir 'valve-repo-root.txt')
+Get-ChildItem -Force $ValveRepo | Select-Object Mode,Length,Name | Format-Table -AutoSize | Out-File (Join-Path $LogDir 'valve-repo-root.txt') -Append
+"=== candidate src folders ===" | Out-File (Join-Path $LogDir 'valve-candidate-src.txt')
+Get-ChildItem -Path $ValveRepo -Recurse -Directory -Filter src -ErrorAction SilentlyContinue |
+ Select-Object FullName | Format-List | Out-File (Join-Path $LogDir 'valve-candidate-src.txt') -Append
+
+$candidates = @(
+ $ValveRepo,
+ (Join-Path $ValveRepo 'mp'),
+ (Join-Path $ValveRepo 'srcsdk/mp'),
+ (Join-Path $ValveRepo 'source-sdk-2013/mp')
+)
+
+$SourceRoot = $null
+foreach ($candidate in $candidates) {
+ if (Has-HL2MP $candidate) {
+ $SourceRoot = $candidate
+ break
+ }
}
}
-$Mp = Join-Path $ValveRepo 'mp'
-if (!(Test-Path (Join-Path $Mp 'src'))) {
- Get-ChildItem -Force $ValveRepo | Select-Object Mode,Length,Name | Format-Table -AutoSize | Out-File (Join-Path $LogDir 'valve-repo-root.txt')
- throw "Valve source-sdk-2013 clone does not contain mp/src at $Mp/src"
+if (-not $SourceRoot) {
+ $matches = Get-ChildItem -Path $ValveRepo -Recurse -Directory -Filter hl2mp -ErrorAction SilentlyContinue |
+ Where-Object { $_.FullName -match '[\\/]src[\\/]game[\\/](client|server)[\\/]hl2mp$' }
+ $matches | Select-Object FullName | Format-List | Out-File (Join-Path $LogDir 'hl2mp-folder-search.txt')
+ throw "Could not find Source SDK 2013 MP HL2MP layout after clone. Check valve-repo-root.txt, valve-candidate-src.txt, and hl2mp-folder-search.txt."
}
}
-Say "copying mp branch layout into $Sdk"
+Say "source root=$SourceRoot"
+Say "copying Source SDK MP layout into $Sdk"
if (Test-Path $Sdk) { Remove-Item -Recurse -Force $Sdk }
if (Test-Path $Sdk) { Remove-Item -Recurse -Force $Sdk }
New-Item -ItemType Directory -Force -Path $Sdk | Out-Null
New-Item -ItemType Directory -Force -Path $Sdk | Out-Null
-Copy-Item -Path (Join-Path $Mp '*') -Destination $Sdk -Recurse -Force
+Copy-Item -Path (Join-Path $SourceRoot '*') -Destination $Sdk -Recurse -Force
-if (!(Test-Path (Join-Path $Src 'game/client/hl2mp')) -or !(Test-Path (Join-Path $Src 'game/server/hl2mp'))) {
+if (!(Has-HL2MP $Sdk)) {
Get-ChildItem -Force $Sdk | Select-Object Mode,Length,Name | Format-Table -AutoSize | Out-File (Join-Path $LogDir 'sdk-root-after-copy.txt')
Get-ChildItem -Force $Sdk | Select-Object Mode,Length,Name | Format-Table -AutoSize | Out-File (Join-Path $LogDir 'sdk-root-after-copy.txt')
- throw "Bootstrapped SDK is missing expected HL2MP folders"
+ throw "Bootstrapped SDK is missing expected HL2MP folders after copy"
}
}
+"=== SDK root after copy ===" | Out-File (Join-Path $LogDir 'sdk-root-after-copy.txt')
+Get-ChildItem -Force $Sdk | Select-Object Mode,Length,Name | Format-Table -AutoSize | Out-File (Join-Path $LogDir 'sdk-root-after-copy.txt') -Append
+"=== SDK src root after copy ===" | Out-File (Join-Path $LogDir 'sdk-src-root-after-copy.txt')
+Get-ChildItem -Force (Join-Path $Sdk 'src') | Select-Object Mode,Length,Name | Format-Table -AutoSize | Out-File (Join-Path $LogDir 'sdk-src-root-after-copy.txt') -Append
+
Say "SDK bootstrapped successfully"
Say "SDK bootstrapped successfully"