@@ -9,7 +9,8 @@ Add-Type -AssemblyName System.IO.Compression.FileSystem
99function FirstMatchingSymbolDescriptionOrDefault {
1010 param (
1111 [string ] $FullPath , # Full path to the module that has to be checked
12- [string ] $TargetServerParam # Parameter to pass to `Symbol Tool` indicating the server to lookup for symbols
12+ [string ] $TargetServerParam , # Parameter to pass to `Symbol Tool` indicating the server to lookup for symbols
13+ [string ] $SymbolsPath
1314 )
1415
1516 $FileName = [System.IO.Path ]::GetFileName($FullPath )
@@ -33,9 +34,9 @@ function FirstMatchingSymbolDescriptionOrDefault {
3334
3435 # DWARF file for a .dylib
3536 $DylibDwarf = $SymbolPath.Replace ($Extension , " .dylib.dwarf" )
36-
37- .\dotnet-symbol.exe -- symbols -- modules $TargetServerParam $FullPath - o $SymbolsPath - d | Out-Null
38-
37+
38+ .\dotnet-symbol.exe -- symbols -- modules -- windows - pdbs $TargetServerParam $FullPath - o $SymbolsPath | Out-Null
39+
3940 if (Test-Path $PdbPath ) {
4041 return " PDB"
4142 }
@@ -73,8 +74,9 @@ function CountMissingSymbols {
7374 $MissingSymbols = 0
7475
7576 $PackageId = [System.IO.Path ]::GetFileNameWithoutExtension($PackagePath )
76- $ExtractPath = $ExtractPath + $PackageId ;
77- $SymbolsPath = $ExtractPath + $PackageId + " .Symbols" ;
77+ $PackageGuid = New-Guid
78+ $ExtractPath = Join-Path - Path $ExtractPath - ChildPath $PackageGuid
79+ $SymbolsPath = Join-Path - Path $ExtractPath - ChildPath " Symbols"
7880
7981 [System.IO.Compression.ZipFile ]::ExtractToDirectory($PackagePath , $ExtractPath )
8082
@@ -84,10 +86,15 @@ function CountMissingSymbols {
8486 Get-ChildItem - Recurse $ExtractPath |
8587 Where-Object {$RelevantExtensions -contains $_.Extension } |
8688 ForEach-Object {
87- Write-Host - NoNewLine " `t Checking file" $_.FullName " ... "
89+ if ($_.FullName -Match " \\ref\\" ) {
90+ Write-Host " `t Ignoring reference assembly file" $_.FullName
91+ return
92+ }
8893
89- $SymbolsOnMSDL = FirstMatchingSymbolDescriptionOrDefault $_.FullName " --microsoft-symbol-server"
90- $SymbolsOnSymWeb = FirstMatchingSymbolDescriptionOrDefault $_.FullName " --internal-server"
94+ $SymbolsOnMSDL = FirstMatchingSymbolDescriptionOrDefault $_.FullName " --microsoft-symbol-server" $SymbolsPath
95+ $SymbolsOnSymWeb = FirstMatchingSymbolDescriptionOrDefault $_.FullName " --internal-server" $SymbolsPath
96+
97+ Write-Host - NoNewLine " `t Checking file" $_.FullName " ... "
9198
9299 if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null ) {
93100 Write-Host " Symbols found on MSDL (" $SymbolsOnMSDL " ) and SymWeb (" $SymbolsOnSymWeb " )"
@@ -116,18 +123,35 @@ function CountMissingSymbols {
116123
117124function CheckSymbolsAvailable {
118125 if (Test-Path $ExtractPath ) {
119- Remove-Item - recurse $ExtractPath
126+ Remove-Item $ExtractPath - Force - Recurse - ErrorAction SilentlyContinue
120127 }
121128
122129 Get-ChildItem " $InputPath \*.nupkg" |
123130 ForEach-Object {
124131 $FileName = $_.Name
132+
133+ # These packages from Arcade-Services include some native libraries that
134+ # our current symbol uploader can't handle. Below is a workaround until
135+ # we get issue: https://github.com/dotnet/arcade/issues/2457 sorted.
136+ if ($FileName -Match " Microsoft\.DotNet\.Darc\." ) {
137+ Write-Host " Ignoring Arcade-services file: $FileName "
138+ Write-Host
139+ return
140+ }
141+ elseif ($FileName -Match " Microsoft\.DotNet\.Maestro\.Tasks\." ) {
142+ Write-Host " Ignoring Arcade-services file: $FileName "
143+ Write-Host
144+ return
145+ }
146+
125147 Write-Host " Validating $FileName "
126148 $Status = CountMissingSymbols " $InputPath \$FileName "
127149
128150 if ($Status -ne 0 ) {
129151 Write-Error " Missing symbols for $Status modules in the package $FileName "
130152 }
153+
154+ Write-Host
131155 }
132156}
133157
0 commit comments