Skip to content

Commit 5ac0dff

Browse files
pjcollinsjonathanpeppers
authored andcommitted
[ci] Add EXE files to windows-toolchain-pdb artifact (#7279)
The `windows-toolchain-pdb` artifact has been updated to include a ZIP containing both PDB and EXE files. This artifact will now be uploaded to blob storage and included in the `nuget-artifacts` GitHub status. These changes will allow the .NET Visual Studio insertion pipeline to archive the symbols in this zip file, as its symbol archiving step already [has support for processing ZIP files][0] listed in the `nuget-artifacts` GitHub status. [0]: https://github.com/xamarin/sdk-insertions/blob/15cc361f17d8c34f208ab8d8be024ba39307b295/templates/common/archive-symbols.yml#L40-L72
1 parent 102982b commit 5ac0dff

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

build-tools/automation/azure-pipelines.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ stages:
115115

116116
- script: >
117117
mkdir -p $(System.DefaultWorkingDirectory)/xamarin-android/bin/Build$(XA.Build.Configuration)/windows-toolchain-pdb &&
118-
ln $(System.DefaultWorkingDirectory)/xamarin-android/bin/$(XA.Build.Configuration)/lib/packs/Microsoft.Android.Sdk.Darwin/*/tools/binutils/bin/*.pdb
119-
$(System.DefaultWorkingDirectory)/xamarin-android/bin/Build$(XA.Build.Configuration)/windows-toolchain-pdb/
118+
cd $(System.DefaultWorkingDirectory)/xamarin-android/bin/$(XA.Build.Configuration)/lib/packs/Microsoft.Android.Sdk.Darwin/*/tools/binutils/windows-toolchain-pdb &&
119+
zip -r $(System.DefaultWorkingDirectory)/xamarin-android/bin/Build$(XA.Build.Configuration)/windows-toolchain-pdb/windows-toolchain-pdb.zip .
120120
workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-android
121-
displayName: copy Windows toolchain pdb files
121+
displayName: zip Windows toolchain pdb files
122122
123123
- task: PublishPipelineArtifact@1
124124
displayName: upload Windows toolchain pdb files
@@ -1499,6 +1499,11 @@ stages:
14991499
artifactName: vs-msi-nugets
15001500
downloadPath: $(Build.StagingDirectory)\nuget-signed
15011501

1502+
- task: DownloadPipelineArtifact@2
1503+
inputs:
1504+
artifactName: $(WindowsToolchainPdbArtifactName)
1505+
downloadPath: $(Build.StagingDirectory)\nuget-signed
1506+
15021507
- task: NuGetCommand@2
15031508
displayName: push nupkgs
15041509
inputs:

build-tools/xaprepare/xaprepare/Steps/Step_InstallGNUBinutils.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ bool CopyToDestination (Context context, string label, string sourceDir, string
6565

6666
string osSourcePath = Path.Combine (sourceDir, osName);
6767
string sourcePath = Path.Combine (osSourcePath, "bin");
68+
string symbolArchiveDir = Path.Combine (destinationDir, "windows-toolchain-pdb");
6869
foreach (var kvp in Configurables.Defaults.AndroidToolchainPrefixes) {
6970
string prefix = kvp.Value;
7071
CopyTools (prefix);
@@ -108,18 +109,18 @@ void CopyTools (string prefix)
108109
continue;
109110
}
110111

111-
toolSourcePath = Path.ChangeExtension (toolSourcePath, ".pdb");
112-
if (!File.Exists (toolSourcePath)) {
112+
// Copy PDBs and corresponding EXEs to a folder to be zipped up for symbol archiving
113+
string toolSourcePdbPath = Path.ChangeExtension (toolSourcePath, ".pdb");
114+
if (!File.Exists (toolSourcePdbPath)) {
113115
continue;
114116
}
115117

116-
toolDestinationPath = Path.ChangeExtension (toolDestinationPath, ".pdb");
118+
toolDestinationPath = Path.Combine (symbolArchiveDir, toolName);
119+
string toolDestinationPdbPath = Path.ChangeExtension (toolDestinationPath, ".pdb");
117120

118-
Log.StatusLine ($" {context.Characters.Bullet} Installing ", toolName, tailColor: ConsoleColor.White);
121+
Log.StatusLine ($" {context.Characters.Bullet} Copying symbols for ", toolName, tailColor: ConsoleColor.White);
119122
Utilities.CopyFile (toolSourcePath, toolDestinationPath);
120-
121-
versionMarkerPath = GetVersionMarker (toolDestinationPath);
122-
File.WriteAllText (versionMarkerPath, DateTime.UtcNow.ToString ());
123+
Utilities.CopyFile (toolSourcePdbPath, toolDestinationPdbPath);
123124
}
124125
}
125126
}

0 commit comments

Comments
 (0)