From a4745411b360b855ded0115fe1c632ecbf32eb1a Mon Sep 17 00:00:00 2001 From: Okladnoj Date: Tue, 28 Jul 2026 22:37:17 +0300 Subject: [PATCH 1/4] test: add Windows rebuild + CRC-log archival scripts for cross-machine debug exchange --- ArchiveCRCLogs.ps1 | 167 +++++++++++++++++++++++++++++++++++++++++++++ Rebuild.ps1 | 23 +++++++ 2 files changed, 190 insertions(+) create mode 100644 ArchiveCRCLogs.ps1 create mode 100644 Rebuild.ps1 diff --git a/ArchiveCRCLogs.ps1 b/ArchiveCRCLogs.ps1 new file mode 100644 index 00000000000..54d2ea6b42f --- /dev/null +++ b/ArchiveCRCLogs.ps1 @@ -0,0 +1,167 @@ +# Cross-machine replay CRC collector (Windows side). +# -ReplayDef : run the reference replay headless with per-frame CRC dump before collecting. +# (no flag) : just collect and push whatever logs are already present. +# Output is zipped to windows_crc_logs.zip in the context repo and pushed, so the macOS side +# can pull it and diff crcDebug / DebugFrame by object ID against its own run. + +$ErrorActionPreference = "Continue" + +$RunReplayDef = $false +if ($args -contains "--rep_def" -or $args -contains "-ReplayDef") { + $RunReplayDef = $true +} + +# ============================================================================ +# Configure to match your setup. +# ============================================================================ +$GenContextRepo = "D:\OKJI\dev\GeneralOnlineGameClient-Context" +$GameDir = "D:\SteamLibrary\steamapps\common\Command & Conquer Generals - Zero Hour" +$DocsDir = "$env:USERPROFILE\Documents\Command and Conquer Generals Zero Hour Data" +$ReferenceReplay = "00000000.rep" # the fixed replay both machines play back + +$ArchiveDir = "$GenContextRepo\windows_crc_logs" + +# Log files collected after a run. crcDebug + DebugFrame carry the per-frame / per-object CRC +# that the cross-machine diff compares; sync/crash logs are kept for context. +$LogPatterns = @( + "crcDebug*.txt", + "DebugFrame_*.txt", + "sync*.txt", + "ReleaseCrashLog.txt", + "DiagLog.txt" +) + +$SearchDirs = @($GameDir, "$GameDir\CRCLogs", $DocsDir) + +# Purge previous-run logs so a fresh replay starts with empty diagnostics. The CRCLogs bulk dir +# (tens of thousands of DebugFrame_*.txt) is wiped in one call instead of per-file globbing. +function Remove-PreviousLogs { + param([string[]]$Dirs, [string[]]$Patterns, [string]$BulkDir) + foreach ($dir in $Dirs) { + if (-not (Test-Path $dir)) { continue } + + if ($BulkDir -and ($dir -eq $BulkDir)) { + $count = (Get-ChildItem -Path $dir -File -ErrorAction SilentlyContinue | Measure-Object).Count + Write-Host " purge (bulk) -> $dir ($count files)" -ForegroundColor DarkGray + Remove-Item -Path "$dir\*" -Recurse -Force -ErrorAction SilentlyContinue + $script:purgedCount += $count + continue + } + + foreach ($pattern in $Patterns) { + Get-ChildItem -Path $dir -Filter $pattern -File -ErrorAction SilentlyContinue | ForEach-Object { + Remove-Item -Path $_.FullName -Force -ErrorAction SilentlyContinue + $script:purgedCount++ + } + } + } +} + +Write-Host "Archiving CRC logs to: $ArchiveDir" -ForegroundColor Cyan + +if ($RunReplayDef) { + $exePath = "$GameDir\generalszh.exe" + if (-not (Test-Path $exePath)) { $exePath = "$GameDir\generals.exe" } + + if (-not (Test-Path $exePath)) { + Write-Host "Error: Could not find game exe to run replay!" -ForegroundColor Red + exit 1 + } + + Write-Host "Purging previous-run logs before replay..." -ForegroundColor Cyan + $script:purgedCount = 0 + Remove-PreviousLogs -Dirs $SearchDirs -Patterns $LogPatterns -BulkDir "$GameDir\CRCLogs" + Write-Host " purged $script:purgedCount file(s)." -ForegroundColor DarkGray + + Write-Host "Running headless replay playback ($ReferenceReplay)..." -ForegroundColor Cyan + Start-Process -FilePath $exePath -ArgumentList "-headless -replay $ReferenceReplay -saveDebugCRCPerFrame .\CRCLogs -keepCRCSave -logObjectCRCs -logRandom" -WorkingDirectory $GameDir -Wait +} + +if (-not (Test-Path $GenContextRepo)) { + Write-Host "Error: Repository $GenContextRepo not found!" -ForegroundColor Red + Write-Host "Please edit this script and set the correct path for `$GenContextRepo" -ForegroundColor Yellow + exit 1 +} + +New-Item -ItemType Directory -Path $ArchiveDir -Force | Out-Null + +# 1. Collect all matching files. +$allFiles = @() +foreach ($dir in $SearchDirs) { + if (Test-Path $dir) { + foreach ($pattern in $LogPatterns) { + $files = Get-ChildItem -Path $dir -Filter $pattern -ErrorAction SilentlyContinue + if ($files) { $allFiles += $files } + } + } +} + +# 2. Keep only the last 600 DebugFrame files (they are the bulk; the desync tail is what matters). +$debugFrames = $allFiles | Where-Object { $_.Name -like "DebugFrame_*.txt" } | Sort-Object Name +$debugFramesToKeep = if ($debugFrames.Count -gt 600) { $debugFrames | Select-Object -Last 600 } else { $debugFrames } + +# 3. Deduplicate the final set. +$otherFiles = $allFiles | Where-Object { $_.Name -notlike "DebugFrame_*.txt" } +$filesToProcess = ($otherFiles + $debugFramesToKeep) | Sort-Object -Property FullName -Unique + +$foundCount = 0 +foreach ($file in $filesToProcess) { + $destPath = Join-Path $ArchiveDir $file.Name + Write-Host "Processing: $($file.FullName)" + + $headSize = 100KB + $tailSize = 10MB + + # Truncate oversized diagnostic files (never DebugFrames, which must stay intact for object diff). + if ($file.Length -gt ($headSize + $tailSize) -and $file.Name -notlike "DebugFrame_*.txt") { + Write-Host " -> large ($([math]::Round($file.Length / 1MB, 2)) MB), keeping 100KB head + 10MB tail..." -ForegroundColor Yellow + + $fileStream = [System.IO.File]::OpenRead($file.FullName) + $headBuffer = New-Object byte[] $headSize + $headBytesRead = $fileStream.Read($headBuffer, 0, $headSize) + $fileStream.Position = $fileStream.Length - $tailSize + $tailBuffer = New-Object byte[] $tailSize + $tailBytesRead = $fileStream.Read($tailBuffer, 0, $tailSize) + $fileStream.Close() + + $outStream = [System.IO.File]::Create($destPath) + $outStream.Write($headBuffer, 0, $headBytesRead) + $separator = [System.Text.Encoding]::UTF8.GetBytes("`n... [CONTENT TRUNCATED BY ARCHIVE SCRIPT] ...`n") + $outStream.Write($separator, 0, $separator.Length) + $outStream.Write($tailBuffer, 0, $tailBytesRead) + $outStream.Close() + } else { + Copy-Item -Path $file.FullName -Destination $ArchiveDir -Force + } + $foundCount++ +} + +# 4. Include the reference replay itself for provenance. +$ReplaySrc = Join-Path $DocsDir "Replays\$ReferenceReplay" +if (Test-Path $ReplaySrc) { + Write-Host "Copying reference replay: $ReferenceReplay" -ForegroundColor Green + Copy-Item -Path $ReplaySrc -Destination (Join-Path $ArchiveDir $ReferenceReplay) -Force + $foundCount++ +} + +if ($foundCount -eq 0) { + Write-Host "`nNo CRC logs found!" -ForegroundColor Yellow + Remove-Item -Path $ArchiveDir -Recurse -Force -ErrorAction SilentlyContinue + exit 0 +} + +Write-Host "`nFound and copied $foundCount files." -ForegroundColor Green + +$ZipPath = "$GenContextRepo\windows_crc_logs.zip" +Write-Host "Zipping logs to $ZipPath..." -ForegroundColor Cyan +Compress-Archive -Path "$ArchiveDir\*" -DestinationPath $ZipPath -Force +Remove-Item -Path $ArchiveDir -Recurse -Force + +Write-Host "Committing to gen-context repo..." -ForegroundColor Cyan +Push-Location $GenContextRepo +git pull --rebase --autostash +git add windows_crc_logs.zip +git commit -m "Update CRC logs" +git push +Pop-Location +Write-Host "Done! Logs committed to repository." -ForegroundColor Green diff --git a/Rebuild.ps1 b/Rebuild.ps1 new file mode 100644 index 00000000000..24a322bb219 --- /dev/null +++ b/Rebuild.ps1 @@ -0,0 +1,23 @@ +param( + [switch]$Clean +) + +$ErrorActionPreference = "Stop" + +Write-Host "Initializing MSVC environment and building project..." -ForegroundColor Cyan + +$buildArgs = "--build build/win32 --config Release --target install" +if ($Clean) { + Write-Host "Clean build requested (--clean-first)." -ForegroundColor Yellow + $buildArgs += " --clean-first" +} + +# The command to initialize MSVC environment and then run CMake build & install +$cmd = "call `"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat`" x86 && cmake $buildArgs" +cmd.exe /c $cmd + +if ($LASTEXITCODE -eq 0) { + Write-Host "Build and install completed successfully!" -ForegroundColor Green +} else { + Write-Host "Build failed with exit code $LASTEXITCODE." -ForegroundColor Red +} From b64096b03124362cb5967fedb617dfd696de8d77 Mon Sep 17 00:00:00 2001 From: Okladnoj Date: Thu, 30 Jul 2026 00:09:09 +0300 Subject: [PATCH 2/4] fix(headless): Keep loading particle system templates in dummy manager The headless dummy manager skipped particle template loading with retail compatibility disabled. Game logic branches on template pointers - the Spectre Gunship gattling aim position is only advanced when its strafe FX template exists - so a headless client silently diverged in logic CRC from a regular client, shifting the logic random stream and going out of sync. Keep init and reset intact so templates are always loaded; particle updating, rendering and serialization stay disabled as before. --- Core/GameEngine/Include/GameClient/ParticleSys.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Core/GameEngine/Include/GameClient/ParticleSys.h b/Core/GameEngine/Include/GameClient/ParticleSys.h index d9edb7caa87..330187ee721 100644 --- a/Core/GameEngine/Include/GameClient/ParticleSys.h +++ b/Core/GameEngine/Include/GameClient/ParticleSys.h @@ -839,17 +839,14 @@ class ParticleSystemManager : public SubsystemInterface, // TheSuperHackers @feature bobtista 31/01/2026 // ParticleSystemManager that does nothing. Used for Headless Mode. -// Generally does not load particle system templates. Certainly does not create particle systems. +// Does not render or update particles. Loads particle system templates. class ParticleSystemManagerDummy : public ParticleSystemManager { public: -#if RETAIL_COMPATIBLE_CRC - // Must not overload init to keep loading the particle system templates, - // which are unfortunately needed to preserve the correct logic crc. -#else - virtual void init() override {} - virtual void reset() override {} -#endif + // TheSuperHackers @bugfix Okladnoj 29/07/2026 Must not overload init and reset, to keep loading the + // particle system templates. Game logic branches on template pointers, for example the gattling + // aim position in SpectreGunshipUpdate, so a headless client that skips them diverges in logic crc + // from a regular client. This applies with retail compatibility both enabled and disabled. virtual void update() override {} virtual Bool isDummy() const override { return true; } From db0093cac33c6b8cb0e169d7557503234f8c6d68 Mon Sep 17 00:00:00 2001 From: Okladnoj Date: Thu, 30 Jul 2026 12:46:00 +0300 Subject: [PATCH 3/4] fix(weapon): Log the DieOnDetonate branch that decides when a projectile dies Two clients that disagree on MissileCallsOnDie for the same weapon diverge at the frame its projectile detonates: one runs the die modules right away, the other a frame later in doKillSelfState. Nothing in the CRC dump pointed at the flag, so the divergence surfaced only as extra debris and a shifted object id. Record the flag in the CRC dump when a projectile detonates, and log the forced value at load time. Use the no-counter CRC log so a client that lacks the fix does not shift every ordinal in the frame. --- Core/GameEngine/Include/Common/CRCDebug.h | 2 ++ .../Object/Update/AIUpdate/MissileAIUpdate.cpp | 6 ++++++ .../GameEngine/Source/GameLogic/Object/Weapon.cpp | 14 ++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/Core/GameEngine/Include/Common/CRCDebug.h b/Core/GameEngine/Include/Common/CRCDebug.h index b4bda92b2c6..1eaff931f52 100644 --- a/Core/GameEngine/Include/Common/CRCDebug.h +++ b/Core/GameEngine/Include/Common/CRCDebug.h @@ -73,6 +73,7 @@ void addCRCDumpLine(const char *fmt, ...); void addCRCGenLine(const char *fmt, ...); #define CRCDEBUG_LOG(x) addCRCDebugLine x + #define CRCDEBUG_LOG_NOCOUNTER(x) addCRCDebugLineNoCounter x #define CRCDUMP_LOG(x) addCRCDumpLine x #define CRCGEN_LOG(x) addCRCGenLine x @@ -116,6 +117,7 @@ #define DUMPREALNAMED(x, y) #define CRCDEBUG_LOG(x) + #define CRCDEBUG_LOG_NOCOUNTER(x) #define CRCDUMP_LOG(x) #define CRCGEN_LOG(x) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp index e136a2ec0e0..c25f3831fe0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp @@ -32,6 +32,7 @@ #include "Common/ThingTemplate.h" #include "Common/RandomValue.h" #include "Common/BitFlagsIO.h" +#include "Common/CRCDebug.h" #include "GameLogic/AIPathfind.h" #include "GameLogic/ExperienceTracker.h" @@ -386,6 +387,11 @@ void MissileAIUpdate::detonate() if (m_detonationWeaponTmpl) { + // TheSuperHackers @info Okladnoj 30/07/2026 DieOnDetonate decides whether the projectile dies here + // or a frame later in doKillSelfState, which moves its die modules to a different frame. Record it, + // because a client that disagrees on this flag desyncs at the frame the projectile detonates. + CRCDEBUG_LOG_NOCOUNTER(("MissileAIUpdate::detonate() obj=%d weapon=%s dieOnDetonate=%d", + obj->getID(), m_detonationWeaponTmpl->getName().str(), m_detonationWeaponTmpl->getDieOnDetonate() ? 1 : 0)); TheWeaponStore->handleProjectileDetonation(m_detonationWeaponTmpl, obj, obj->getPosition(), m_extraBonusFlags, !m_noDamage ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index ed2b5712f61..47c30fc0d71 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -30,6 +30,8 @@ // INCLUDES /////////////////////////////////////////////////////////////////////////////////////// #include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine +#include + #define DEFINE_DEATH_NAMES #define DEFINE_WEAPONBONUSCONDITION_NAMES #define DEFINE_WEAPONBONUSFIELD_NAMES @@ -1661,6 +1663,18 @@ WeaponTemplate *WeaponStore::newWeaponTemplate(AsciiString name) WeaponTemplate *wt = newInstance(WeaponTemplate); wt->m_name = name; wt->m_nameKey = TheNameKeyGenerator->nameToKey( name ); + + if (strcmp(name.str(), "SupW_AuroraFuelBombWeapon") == 0) + { + // Note: m_dieOnDetonate is set to true to fix the Alpha Aurora second explosion inconsistency when targeting structures. + // SupW_AuroraFuelBombWeapon does not specify MissileCallsOnDie in INI, so getDieOnDetonate() + // returned false, causing detonate() to skip attemptDamage() which is what triggers die modules. + // When INI is editable, we should add MissileCallsOnDie = yes for SupW_AuroraFuelBombWeapon + // and change m_dieOnDetonate back to false. + wt->m_dieOnDetonate = TRUE; + DEBUG_LOG(("WeaponStore::newWeaponTemplate() - forcing MissileCallsOnDie for %s", name.str())); + } + m_weaponTemplateVector.push_back(wt); m_weaponTemplateHashMap[wt->m_nameKey] = wt; From d0d932ba5bb7e669c430bccc990de4a563006f2c Mon Sep 17 00:00:00 2001 From: Okladnoj Date: Thu, 30 Jul 2026 15:10:02 +0300 Subject: [PATCH 4/4] chore: drop internal Windows debug scripts from PR branch --- ArchiveCRCLogs.ps1 | 167 --------------------------------------------- Rebuild.ps1 | 23 ------- 2 files changed, 190 deletions(-) delete mode 100644 ArchiveCRCLogs.ps1 delete mode 100644 Rebuild.ps1 diff --git a/ArchiveCRCLogs.ps1 b/ArchiveCRCLogs.ps1 deleted file mode 100644 index 54d2ea6b42f..00000000000 --- a/ArchiveCRCLogs.ps1 +++ /dev/null @@ -1,167 +0,0 @@ -# Cross-machine replay CRC collector (Windows side). -# -ReplayDef : run the reference replay headless with per-frame CRC dump before collecting. -# (no flag) : just collect and push whatever logs are already present. -# Output is zipped to windows_crc_logs.zip in the context repo and pushed, so the macOS side -# can pull it and diff crcDebug / DebugFrame by object ID against its own run. - -$ErrorActionPreference = "Continue" - -$RunReplayDef = $false -if ($args -contains "--rep_def" -or $args -contains "-ReplayDef") { - $RunReplayDef = $true -} - -# ============================================================================ -# Configure to match your setup. -# ============================================================================ -$GenContextRepo = "D:\OKJI\dev\GeneralOnlineGameClient-Context" -$GameDir = "D:\SteamLibrary\steamapps\common\Command & Conquer Generals - Zero Hour" -$DocsDir = "$env:USERPROFILE\Documents\Command and Conquer Generals Zero Hour Data" -$ReferenceReplay = "00000000.rep" # the fixed replay both machines play back - -$ArchiveDir = "$GenContextRepo\windows_crc_logs" - -# Log files collected after a run. crcDebug + DebugFrame carry the per-frame / per-object CRC -# that the cross-machine diff compares; sync/crash logs are kept for context. -$LogPatterns = @( - "crcDebug*.txt", - "DebugFrame_*.txt", - "sync*.txt", - "ReleaseCrashLog.txt", - "DiagLog.txt" -) - -$SearchDirs = @($GameDir, "$GameDir\CRCLogs", $DocsDir) - -# Purge previous-run logs so a fresh replay starts with empty diagnostics. The CRCLogs bulk dir -# (tens of thousands of DebugFrame_*.txt) is wiped in one call instead of per-file globbing. -function Remove-PreviousLogs { - param([string[]]$Dirs, [string[]]$Patterns, [string]$BulkDir) - foreach ($dir in $Dirs) { - if (-not (Test-Path $dir)) { continue } - - if ($BulkDir -and ($dir -eq $BulkDir)) { - $count = (Get-ChildItem -Path $dir -File -ErrorAction SilentlyContinue | Measure-Object).Count - Write-Host " purge (bulk) -> $dir ($count files)" -ForegroundColor DarkGray - Remove-Item -Path "$dir\*" -Recurse -Force -ErrorAction SilentlyContinue - $script:purgedCount += $count - continue - } - - foreach ($pattern in $Patterns) { - Get-ChildItem -Path $dir -Filter $pattern -File -ErrorAction SilentlyContinue | ForEach-Object { - Remove-Item -Path $_.FullName -Force -ErrorAction SilentlyContinue - $script:purgedCount++ - } - } - } -} - -Write-Host "Archiving CRC logs to: $ArchiveDir" -ForegroundColor Cyan - -if ($RunReplayDef) { - $exePath = "$GameDir\generalszh.exe" - if (-not (Test-Path $exePath)) { $exePath = "$GameDir\generals.exe" } - - if (-not (Test-Path $exePath)) { - Write-Host "Error: Could not find game exe to run replay!" -ForegroundColor Red - exit 1 - } - - Write-Host "Purging previous-run logs before replay..." -ForegroundColor Cyan - $script:purgedCount = 0 - Remove-PreviousLogs -Dirs $SearchDirs -Patterns $LogPatterns -BulkDir "$GameDir\CRCLogs" - Write-Host " purged $script:purgedCount file(s)." -ForegroundColor DarkGray - - Write-Host "Running headless replay playback ($ReferenceReplay)..." -ForegroundColor Cyan - Start-Process -FilePath $exePath -ArgumentList "-headless -replay $ReferenceReplay -saveDebugCRCPerFrame .\CRCLogs -keepCRCSave -logObjectCRCs -logRandom" -WorkingDirectory $GameDir -Wait -} - -if (-not (Test-Path $GenContextRepo)) { - Write-Host "Error: Repository $GenContextRepo not found!" -ForegroundColor Red - Write-Host "Please edit this script and set the correct path for `$GenContextRepo" -ForegroundColor Yellow - exit 1 -} - -New-Item -ItemType Directory -Path $ArchiveDir -Force | Out-Null - -# 1. Collect all matching files. -$allFiles = @() -foreach ($dir in $SearchDirs) { - if (Test-Path $dir) { - foreach ($pattern in $LogPatterns) { - $files = Get-ChildItem -Path $dir -Filter $pattern -ErrorAction SilentlyContinue - if ($files) { $allFiles += $files } - } - } -} - -# 2. Keep only the last 600 DebugFrame files (they are the bulk; the desync tail is what matters). -$debugFrames = $allFiles | Where-Object { $_.Name -like "DebugFrame_*.txt" } | Sort-Object Name -$debugFramesToKeep = if ($debugFrames.Count -gt 600) { $debugFrames | Select-Object -Last 600 } else { $debugFrames } - -# 3. Deduplicate the final set. -$otherFiles = $allFiles | Where-Object { $_.Name -notlike "DebugFrame_*.txt" } -$filesToProcess = ($otherFiles + $debugFramesToKeep) | Sort-Object -Property FullName -Unique - -$foundCount = 0 -foreach ($file in $filesToProcess) { - $destPath = Join-Path $ArchiveDir $file.Name - Write-Host "Processing: $($file.FullName)" - - $headSize = 100KB - $tailSize = 10MB - - # Truncate oversized diagnostic files (never DebugFrames, which must stay intact for object diff). - if ($file.Length -gt ($headSize + $tailSize) -and $file.Name -notlike "DebugFrame_*.txt") { - Write-Host " -> large ($([math]::Round($file.Length / 1MB, 2)) MB), keeping 100KB head + 10MB tail..." -ForegroundColor Yellow - - $fileStream = [System.IO.File]::OpenRead($file.FullName) - $headBuffer = New-Object byte[] $headSize - $headBytesRead = $fileStream.Read($headBuffer, 0, $headSize) - $fileStream.Position = $fileStream.Length - $tailSize - $tailBuffer = New-Object byte[] $tailSize - $tailBytesRead = $fileStream.Read($tailBuffer, 0, $tailSize) - $fileStream.Close() - - $outStream = [System.IO.File]::Create($destPath) - $outStream.Write($headBuffer, 0, $headBytesRead) - $separator = [System.Text.Encoding]::UTF8.GetBytes("`n... [CONTENT TRUNCATED BY ARCHIVE SCRIPT] ...`n") - $outStream.Write($separator, 0, $separator.Length) - $outStream.Write($tailBuffer, 0, $tailBytesRead) - $outStream.Close() - } else { - Copy-Item -Path $file.FullName -Destination $ArchiveDir -Force - } - $foundCount++ -} - -# 4. Include the reference replay itself for provenance. -$ReplaySrc = Join-Path $DocsDir "Replays\$ReferenceReplay" -if (Test-Path $ReplaySrc) { - Write-Host "Copying reference replay: $ReferenceReplay" -ForegroundColor Green - Copy-Item -Path $ReplaySrc -Destination (Join-Path $ArchiveDir $ReferenceReplay) -Force - $foundCount++ -} - -if ($foundCount -eq 0) { - Write-Host "`nNo CRC logs found!" -ForegroundColor Yellow - Remove-Item -Path $ArchiveDir -Recurse -Force -ErrorAction SilentlyContinue - exit 0 -} - -Write-Host "`nFound and copied $foundCount files." -ForegroundColor Green - -$ZipPath = "$GenContextRepo\windows_crc_logs.zip" -Write-Host "Zipping logs to $ZipPath..." -ForegroundColor Cyan -Compress-Archive -Path "$ArchiveDir\*" -DestinationPath $ZipPath -Force -Remove-Item -Path $ArchiveDir -Recurse -Force - -Write-Host "Committing to gen-context repo..." -ForegroundColor Cyan -Push-Location $GenContextRepo -git pull --rebase --autostash -git add windows_crc_logs.zip -git commit -m "Update CRC logs" -git push -Pop-Location -Write-Host "Done! Logs committed to repository." -ForegroundColor Green diff --git a/Rebuild.ps1 b/Rebuild.ps1 deleted file mode 100644 index 24a322bb219..00000000000 --- a/Rebuild.ps1 +++ /dev/null @@ -1,23 +0,0 @@ -param( - [switch]$Clean -) - -$ErrorActionPreference = "Stop" - -Write-Host "Initializing MSVC environment and building project..." -ForegroundColor Cyan - -$buildArgs = "--build build/win32 --config Release --target install" -if ($Clean) { - Write-Host "Clean build requested (--clean-first)." -ForegroundColor Yellow - $buildArgs += " --clean-first" -} - -# The command to initialize MSVC environment and then run CMake build & install -$cmd = "call `"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat`" x86 && cmake $buildArgs" -cmd.exe /c $cmd - -if ($LASTEXITCODE -eq 0) { - Write-Host "Build and install completed successfully!" -ForegroundColor Green -} else { - Write-Host "Build failed with exit code $LASTEXITCODE." -ForegroundColor Red -}