Repository: microsoft/terminal (language: cpp)

Issue:
Where are PDB files for public builds?
I've been experiencing occasional hangs in the latest WT (1.11.3471.0 from the Store, on Windows 10.0.22000). I started to debug one myself, partly to help out and partly because it would have been nice to get those six or seven terminal sessions back, but I ran into an issue when VS2022 couldn't find the PDB files for the WT modules. I can see a number of issues here relating to how the PDBs are produced, but I couldn't find anywhere that said where to actually find them. Help? If they aren't getting added to the Microsoft public symbol servers, can someone add something to the docs or the wiki here on where they _can_ be found? Thanks!


Discussion / hints:
@dmchurch the easiest way to get the PDBs is to build WT locally.
@elsaco Wait, does that work? Can the PDBs from a local build be used to debug the official binaries? I was under the impression you need PDBs created during the build that made your executable.
I know that @DHowett knows the answer to this, I just can't find it by searching the repo for whatever reason ¯\\\_(ツ)_/¯

#2857 and #3138 implies we link them somehow... Maybe only WinDBG can figure out where the symbols are...
This one is on me -- we should certainly be publishing symbols publicly to let folks diagnose in the wild. Thanks for bringing it up :)
Didn't we do this in https://github.com/microsoft/terminal/pull/11852? Not sure where those go though...
Nah, that was something slightly different. I've engaged the folks who own the public symbol server and gotten clearance to push there! Today or Monday, I'll upload some historical symbols and make sure the build does so on its own in the future.

Fix patch:
diff --git a/.github/actions/spelling/expect/expect.txt b/.github/actions/spelling/expect/expect.txt
index 2f0a8a588e9..85ea31b952a 100644
--- a/.github/actions/spelling/expect/expect.txt
+++ b/.github/actions/spelling/expect/expect.txt
@@ -1460,6 +1460,7 @@ msctls
 msdata
 msdn
 msft
+MSDL
 MSGCMDLINEF
 MSGF
 MSGFILTER
diff --git a/build/pipelines/release.yml b/build/pipelines/release.yml
index 300d66c68c1..99cbf44bbb3 100644
--- a/build/pipelines/release.yml
+++ b/build/pipelines/release.yml
@@ -287,14 +287,17 @@ jobs:
       inputs:
         disableOutputRedirect: true
     - task: DownloadBuildArtifacts@0
-      displayName: Download Artifacts (*.appx, *.msix)
+      displayName: Download Artifacts (*.appx, *.msix, *.appxsym)
       inputs:
         downloadType: specific
         itemPattern: >-
           **/*.msix
 
           **/*.appx
+
+          **/*.appxsym
         extractTars: false
+
     - task: PowerShell@2
       displayName: Create WindowsTerminal*.msixbundle
       inputs:
@@ -334,6 +337,43 @@ jobs:
                   "ToolVersion": "1.0"
               }
           ]
+
+    # It seems easier to do this -- download every appxsym -- then enumerate all the PDBs in the build directory for the
+    # public symbol push. Otherwise, we would have to list all of the PDB files one by one.
+    - pwsh: |-
+        mkdir $(Build.SourcesDirectory)/appxsym-temp
+        Get-ChildItem "$(System.ArtifactsDirectory)" -Filter *.appxsym -Recurse | % {
+          $src = $_.FullName
+          $dest = Join-Path "$(Build.SourcesDirectory)/appxsym-temp/" $_.Name
+
+          mkdir $dest
+          Write-Host "Extracting $src to $dest..."
+          tar -x -v -f $src -C $dest
+        }
+      displayName: Extract symbols for public consumption
+
+    # Publish the app symbols to the public MSDL symbol server
+    # accessible via https://msdl.microsoft.com/download/symbols
+    - task: PublishSymbols@2
+      displayName: 'Publish app symbols to MSDL'
+      inputs:
+        symbolsFolder: '$(Build.SourcesDirectory)/appxsym-temp'
+        searchPattern: '**/*.pdb'
+        SymbolsMaximumWaitTime: 30
+        SymbolServerType: 'TeamServices'
+        SymbolsProduct: 'Windows Terminal Application Binaries'
+        SymbolsVersion: '$(XES_APPXMANIFESTVERSION)'
+        # The ADO task does not support indexing of GitHub sources.
+        indexSources: false
+        detailedLog: true
+      # There is a bug which causes this task to fail if LIB includes an inaccessible path (even though it does not depend on it).
+      # To work around this issue, we just force LIB to be any dir that we know exists.
+      # Copied from https://github.com/microsoft/icu/blob/f869c214adc87415dfe751d81f42f1bca55dcf5f/build/azure-nuget.yml#L564-L583
+      env:
+        LIB: $(Build.SourcesDirectory)
+        ArtifactServices_Symbol_AccountName: microsoftpublicsymbols
+        ArtifactServices_Symbol_PAT: $(ADO_microsoftpublicsymbols_PAT)
+
     - task: PublishBuildArtifacts@1
       displayName: 'Publish Artifact: appxbundle-signed'
       inputs:


Test patch: