Fix source indexing to enable source debugging for official builds. #5669
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #5577
There are two methods that can be used to enable pdbs to find matching source code: SourceLink and Source Server. WinUI supports both. For Microsoft.UI.Xaml 2.6 both of these were broken in different ways.
SourceLink was generating invalid urls due to the build being run from an Azure DevOps fork of this repo instead of directly from GitHub. This should be resolved in the next release of 2.6.
For Source Server support we have a script, IndexPDBs.ps1, that writes the required file url mapping into the pdb using tools from the Windows Debugging Tools (pdbstr.exe, srctool.exe). However, this script stopped working when using the internal SDK which we use for official builds of WinUI. The internal SDK installs a more recent version of these tools, which fail silently when run in the Pipeline. I have not been able to reproduce the issue locally when using these tools. It only seems to happen when run in the Pipeline. So the solution is to not install the updated Windows Debugging Tools from this SDK and instead only install the specific SDK components that we need to build.
In addition to making this fix, I have updated IndexPDBs.ps1 with some extra logging to aid in debugging.