From f494d23c7c4f68e923ddffde8f86613195b1c7bc Mon Sep 17 00:00:00 2001 From: Keith Mahoney <41657372+kmahone@users.noreply.github.com> Date: Thu, 12 Aug 2021 13:16:35 -0700 Subject: [PATCH] Fix source indexing to enable source debugging for official builds. (#5669) --- build/SourceIndexing/IndexPdbs.ps1 | 22 ++++++++++++++++++- .../SetUpInternalWindowsSDK.cmd | 4 ++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/build/SourceIndexing/IndexPdbs.ps1 b/build/SourceIndexing/IndexPdbs.ps1 index 5c86cccf70..e3cde91a8b 100644 --- a/build/SourceIndexing/IndexPdbs.ps1 +++ b/build/SourceIndexing/IndexPdbs.ps1 @@ -23,6 +23,7 @@ $mappedFiles = New-Object System.Collections.ArrayList foreach ($file in (Get-ChildItem -r:$recursive "$SearchDir\*.pdb")) { + $mappedFiles = New-Object System.Collections.ArrayList Write-Verbose "Found $file" $ErrorActionPreference = "Continue" # Azure Pipelines defaults to "Stop", continue past errors in this script. @@ -50,7 +51,7 @@ foreach ($file in (Get-ChildItem -r:$recursive "$SearchDir\*.pdb")) if ($relative) { $mapping = $allFiles[$i] + "*$relative" - $mappedFiles.Add($mapping) + $ignore = $mappedFiles.Add($mapping) Write-Verbose "Mapped path $($i): $mapping" } @@ -78,7 +79,26 @@ $($mappedFiles -join "`r`n") SRCSRV: end ------------------------------------------------ "@ | Set-Content $pdbstrFile + Write-Host + Write-Host + Write-Host (Get-Content $pdbstrFile) + Write-Host + Write-Host + + Write-Host "$pdbstrExe -p:""$file"" -w -s:srcsrv -i:$pdbstrFile" & $pdbstrExe -p:"$file" -w -s:srcsrv -i:$pdbstrFile + Write-Host + Write-Host + + Write-Host "$pdbstrExe -p:""$file"" -r -s:srcsrv" + & $pdbstrExe -p:"$file" -r -s:srcsrv + Write-Host + Write-Host + + Write-Host "$srctoolExe $file" + & $srctoolExe "$file" + Write-Host + Write-Host } # Return with exit 0 to override any weird error code from other tools diff --git a/tools/InternalWindowsSDKNuget/SetUpInternalWindowsSDK.cmd b/tools/InternalWindowsSDKNuget/SetUpInternalWindowsSDK.cmd index 35d52d4fcb..c96e318ac3 100644 --- a/tools/InternalWindowsSDKNuget/SetUpInternalWindowsSDK.cmd +++ b/tools/InternalWindowsSDKNuget/SetUpInternalWindowsSDK.cmd @@ -2,8 +2,8 @@ SETLOCAL set ERRORLEVEL= -echo executing %~dp0..\..\packages\InternalWindowsSDK.1.0.7\winsdksetup.exe /quiet -call %~dp0..\..\packages\InternalWindowsSDK.1.0.7\winsdksetup.exe /quiet +echo executing %~dp0..\..\packages\InternalWindowsSDK.1.0.7\winsdksetup.exe /features OptionId.UWPCpp OptionId.DesktopCPPx64 OptionId.DesktopCPPx86 OptionId.DesktopCPPARM64 OptionId.DesktopCPPARM /quiet +call %~dp0..\..\packages\InternalWindowsSDK.1.0.7\winsdksetup.exe /features OptionId.UWPCpp OptionId.DesktopCPPx64 OptionId.DesktopCPPx86 OptionId.DesktopCPPARM64 OptionId.DesktopCPPARM /quiet :END exit /B %ERRORLEVEL% \ No newline at end of file