@@ -9,7 +9,8 @@ Add-Type -AssemblyName System.IO.Compression.FileSystem
9
9
function FirstMatchingSymbolDescriptionOrDefault {
10
10
param (
11
11
[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
13
14
)
14
15
15
16
$FileName = [System.IO.Path ]::GetFileName($FullPath )
@@ -33,9 +34,9 @@ function FirstMatchingSymbolDescriptionOrDefault {
33
34
34
35
# DWARF file for a .dylib
35
36
$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
+
39
40
if (Test-Path $PdbPath ) {
40
41
return " PDB"
41
42
}
@@ -73,8 +74,9 @@ function CountMissingSymbols {
73
74
$MissingSymbols = 0
74
75
75
76
$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"
78
80
79
81
[System.IO.Compression.ZipFile ]::ExtractToDirectory($PackagePath , $ExtractPath )
80
82
@@ -84,10 +86,15 @@ function CountMissingSymbols {
84
86
Get-ChildItem - Recurse $ExtractPath |
85
87
Where-Object {$RelevantExtensions -contains $_.Extension } |
86
88
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
+ }
88
93
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 " ... "
91
98
92
99
if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null ) {
93
100
Write-Host " Symbols found on MSDL (" $SymbolsOnMSDL " ) and SymWeb (" $SymbolsOnSymWeb " )"
@@ -116,18 +123,35 @@ function CountMissingSymbols {
116
123
117
124
function CheckSymbolsAvailable {
118
125
if (Test-Path $ExtractPath ) {
119
- Remove-Item - recurse $ExtractPath
126
+ Remove-Item $ExtractPath - Force - Recurse - ErrorAction SilentlyContinue
120
127
}
121
128
122
129
Get-ChildItem " $InputPath \*.nupkg" |
123
130
ForEach-Object {
124
131
$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
+
125
147
Write-Host " Validating $FileName "
126
148
$Status = CountMissingSymbols " $InputPath \$FileName "
127
149
128
150
if ($Status -ne 0 ) {
129
151
Write-Error " Missing symbols for $Status modules in the package $FileName "
130
152
}
153
+
154
+ Write-Host
131
155
}
132
156
}
133
157
0 commit comments