2019-06-13 12:10:50 +00:00
|
|
|
param(
|
|
|
|
[Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where Symbols.NuGet packages to be checked are stored
|
|
|
|
[Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation
|
2019-08-22 12:34:05 +00:00
|
|
|
[Parameter(Mandatory=$false)][string] $GHRepoName, # GitHub name of the repo including the Org. E.g., dotnet/arcade
|
|
|
|
[Parameter(Mandatory=$false)][string] $GHCommit, # GitHub commit SHA used to build the packages
|
2019-06-13 12:10:50 +00:00
|
|
|
[Parameter(Mandatory=$true)][string] $SourcelinkCliVersion # Version of SourceLink CLI to use
|
|
|
|
)
|
|
|
|
|
2019-07-27 12:35:24 +00:00
|
|
|
. $PSScriptRoot\post-build-utils.ps1
|
2019-06-13 12:10:50 +00:00
|
|
|
|
|
|
|
# Cache/HashMap (File -> Exist flag) used to consult whether a file exist
|
|
|
|
# in the repository at a specific commit point. This is populated by inserting
|
|
|
|
# all files present in the repo at a specific commit point.
|
|
|
|
$global:RepoFiles = @{}
|
|
|
|
|
2019-08-22 12:34:05 +00:00
|
|
|
# Maximum number of jobs to run in parallel
|
2021-05-04 13:00:28 +00:00
|
|
|
$MaxParallelJobs = 16
|
2019-08-22 12:34:05 +00:00
|
|
|
|
2021-05-14 13:08:05 +00:00
|
|
|
$MaxRetries = 5
|
2021-08-19 13:02:51 +00:00
|
|
|
$RetryWaitTimeInSeconds = 30
|
2021-05-14 13:08:05 +00:00
|
|
|
|
2019-08-22 12:34:05 +00:00
|
|
|
# Wait time between check for system load
|
|
|
|
$SecondsBetweenLoadChecks = 10
|
|
|
|
|
2021-10-22 13:05:26 +00:00
|
|
|
if (!$InputPath -or !(Test-Path $InputPath)){
|
|
|
|
Write-Host "No files to validate."
|
|
|
|
ExitWithExitCode 0
|
|
|
|
}
|
|
|
|
|
2019-06-13 12:10:50 +00:00
|
|
|
$ValidatePackage = {
|
|
|
|
param(
|
|
|
|
[string] $PackagePath # Full path to a Symbols.NuGet package
|
|
|
|
)
|
|
|
|
|
|
|
|
. $using:PSScriptRoot\..\tools.ps1
|
|
|
|
|
|
|
|
# Ensure input file exist
|
|
|
|
if (!(Test-Path $PackagePath)) {
|
2019-08-22 12:34:05 +00:00
|
|
|
Write-Host "Input file does not exist: $PackagePath"
|
2021-05-14 13:08:05 +00:00
|
|
|
return [pscustomobject]@{
|
|
|
|
result = 1
|
|
|
|
packagePath = $PackagePath
|
|
|
|
}
|
2019-06-13 12:10:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Extensions for which we'll look for SourceLink information
|
|
|
|
# For now we'll only care about Portable & Embedded PDBs
|
2019-11-22 13:41:58 +00:00
|
|
|
$RelevantExtensions = @('.dll', '.exe', '.pdb')
|
2019-06-13 12:10:50 +00:00
|
|
|
|
2019-11-22 13:41:58 +00:00
|
|
|
Write-Host -NoNewLine 'Validating ' ([System.IO.Path]::GetFileName($PackagePath)) '...'
|
2019-06-13 12:10:50 +00:00
|
|
|
|
|
|
|
$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
|
|
|
|
$ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId
|
|
|
|
$FailedFiles = 0
|
|
|
|
|
|
|
|
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
|
|
|
|
2019-08-22 12:34:05 +00:00
|
|
|
[System.IO.Directory]::CreateDirectory($ExtractPath) | Out-Null
|
2019-06-13 12:10:50 +00:00
|
|
|
|
|
|
|
try {
|
|
|
|
$zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath)
|
|
|
|
|
|
|
|
$zip.Entries |
|
|
|
|
Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} |
|
|
|
|
ForEach-Object {
|
|
|
|
$FileName = $_.FullName
|
|
|
|
$Extension = [System.IO.Path]::GetExtension($_.Name)
|
|
|
|
$FakeName = -Join((New-Guid), $Extension)
|
|
|
|
$TargetFile = Join-Path -Path $ExtractPath -ChildPath $FakeName
|
|
|
|
|
|
|
|
# We ignore resource DLLs
|
2019-11-22 13:41:58 +00:00
|
|
|
if ($FileName.EndsWith('.resources.dll')) {
|
2021-05-14 13:08:05 +00:00
|
|
|
return [pscustomobject]@{
|
|
|
|
result = 0
|
|
|
|
packagePath = $PackagePath
|
|
|
|
}
|
2019-06-13 12:10:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true)
|
|
|
|
|
|
|
|
$ValidateFile = {
|
|
|
|
param(
|
|
|
|
[string] $FullPath, # Full path to the module that has to be checked
|
|
|
|
[string] $RealPath,
|
|
|
|
[ref] $FailedFiles
|
|
|
|
)
|
|
|
|
|
|
|
|
$sourcelinkExe = "$env:USERPROFILE\.dotnet\tools"
|
|
|
|
$sourcelinkExe = Resolve-Path "$sourcelinkExe\sourcelink.exe"
|
|
|
|
$SourceLinkInfos = & $sourcelinkExe print-urls $FullPath | Out-String
|
|
|
|
|
|
|
|
if ($LASTEXITCODE -eq 0 -and -not ([string]::IsNullOrEmpty($SourceLinkInfos))) {
|
|
|
|
$NumFailedLinks = 0
|
|
|
|
|
|
|
|
# We only care about Http addresses
|
|
|
|
$Matches = (Select-String '(http[s]?)(:\/\/)([^\s,]+)' -Input $SourceLinkInfos -AllMatches).Matches
|
|
|
|
|
|
|
|
if ($Matches.Count -ne 0) {
|
|
|
|
$Matches.Value |
|
|
|
|
ForEach-Object {
|
|
|
|
$Link = $_
|
|
|
|
$CommitUrl = "https://raw.githubusercontent.com/${using:GHRepoName}/${using:GHCommit}/"
|
|
|
|
|
|
|
|
$FilePath = $Link.Replace($CommitUrl, "")
|
|
|
|
$Status = 200
|
|
|
|
$Cache = $using:RepoFiles
|
|
|
|
|
2021-08-19 13:02:51 +00:00
|
|
|
$attempts = 0
|
2021-05-14 13:08:05 +00:00
|
|
|
|
2021-08-19 13:02:51 +00:00
|
|
|
while ($attempts -lt $using:MaxRetries) {
|
2021-05-14 13:08:05 +00:00
|
|
|
if ( !($Cache.ContainsKey($FilePath)) ) {
|
|
|
|
try {
|
|
|
|
$Uri = $Link -as [System.URI]
|
|
|
|
|
2021-08-26 13:02:55 +00:00
|
|
|
if ($Link -match "submodules") {
|
|
|
|
# Skip submodule links until sourcelink properly handles submodules
|
|
|
|
$Status = 200
|
|
|
|
}
|
|
|
|
elseif ($Uri.AbsoluteURI -ne $null -and ($Uri.Host -match 'github' -or $Uri.Host -match 'githubusercontent')) {
|
|
|
|
# Only GitHub links are valid
|
2021-05-14 13:08:05 +00:00
|
|
|
$Status = (Invoke-WebRequest -Uri $Link -UseBasicParsing -Method HEAD -TimeoutSec 5).StatusCode
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
# If it's not a github link, we want to break out of the loop and not retry.
|
|
|
|
$Status = 0
|
2021-08-19 13:02:51 +00:00
|
|
|
$attempts = $using:MaxRetries
|
2021-05-14 13:08:05 +00:00
|
|
|
}
|
2019-06-13 12:10:50 +00:00
|
|
|
}
|
2021-05-14 13:08:05 +00:00
|
|
|
catch {
|
|
|
|
Write-Host $_
|
2019-06-13 12:10:50 +00:00
|
|
|
$Status = 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-14 13:08:05 +00:00
|
|
|
if ($Status -ne 200) {
|
2021-08-19 13:02:51 +00:00
|
|
|
$attempts++
|
2021-05-14 13:08:05 +00:00
|
|
|
|
2021-08-19 13:02:51 +00:00
|
|
|
if ($attempts -lt $using:MaxRetries)
|
|
|
|
{
|
|
|
|
$attemptsLeft = $using:MaxRetries - $attempts
|
|
|
|
Write-Warning "Download failed, $attemptsLeft attempts remaining, will retry in $using:RetryWaitTimeInSeconds seconds"
|
|
|
|
Start-Sleep -Seconds $using:RetryWaitTimeInSeconds
|
|
|
|
}
|
|
|
|
else {
|
2021-05-14 13:08:05 +00:00
|
|
|
if ($NumFailedLinks -eq 0) {
|
|
|
|
if ($FailedFiles.Value -eq 0) {
|
|
|
|
Write-Host
|
|
|
|
}
|
|
|
|
|
|
|
|
Write-Host "`tFile $RealPath has broken links:"
|
|
|
|
}
|
|
|
|
|
|
|
|
Write-Host "`t`tFailed to retrieve $Link"
|
|
|
|
|
|
|
|
$NumFailedLinks++
|
2019-06-13 12:10:50 +00:00
|
|
|
}
|
|
|
|
}
|
2021-05-14 13:08:05 +00:00
|
|
|
else {
|
|
|
|
break
|
|
|
|
}
|
2019-06-13 12:10:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($NumFailedLinks -ne 0) {
|
|
|
|
$FailedFiles.value++
|
|
|
|
$global:LASTEXITCODE = 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&$ValidateFile $TargetFile $FileName ([ref]$FailedFiles)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch {
|
2021-05-14 13:08:05 +00:00
|
|
|
Write-Host $_
|
2019-06-13 12:10:50 +00:00
|
|
|
}
|
|
|
|
finally {
|
|
|
|
$zip.Dispose()
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($FailedFiles -eq 0) {
|
2019-11-22 13:41:58 +00:00
|
|
|
Write-Host 'Passed.'
|
2020-09-16 18:30:55 +00:00
|
|
|
return [pscustomobject]@{
|
|
|
|
result = 0
|
|
|
|
packagePath = $PackagePath
|
|
|
|
}
|
2019-06-13 12:10:50 +00:00
|
|
|
}
|
|
|
|
else {
|
2019-11-22 13:41:58 +00:00
|
|
|
Write-PipelineTelemetryError -Category 'SourceLink' -Message "$PackagePath has broken SourceLink links."
|
2020-09-16 18:30:55 +00:00
|
|
|
return [pscustomobject]@{
|
|
|
|
result = 1
|
|
|
|
packagePath = $PackagePath
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function CheckJobResult(
|
|
|
|
$result,
|
|
|
|
$packagePath,
|
[master] Update dependencies from dotnet/arcade (#8726)
* Update dependencies from https://github.com/dotnet/arcade build 20200924.4
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 5.0.0-beta.20474.4
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20200928.3
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 5.0.0-beta.20478.3
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20201006.7
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 5.0.0-beta.20506.7
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks,Microsoft.SourceLink.GitHub,XliffTasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20201009.12
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 6.0.0-beta.20509.12
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks,Microsoft.SourceLink.GitHub,XliffTasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20201020.8
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 6.0.0-beta.20520.8
Dependency coherency updates
Microsoft.SourceLink.GitHub,XliffTasks
From Version 1.1.0-beta-20464-02 -> To Version 1.1.0-beta-20519-02 (parent: Microsoft.DotNet.Arcade.Sdk
* Update FileInfoAssertions.cs
* Update FileInfoAssertions.cs
* Use tasks provided by Microsoft.DotNet.Build.Tasks.Installers when provided.
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
2020-10-23 07:44:02 +00:00
|
|
|
[ref]$ValidationFailures,
|
|
|
|
[switch]$logErrors) {
|
|
|
|
if ($result -ne '0') {
|
2020-11-24 14:15:47 +00:00
|
|
|
if ($logErrors) {
|
[master] Update dependencies from dotnet/arcade (#8726)
* Update dependencies from https://github.com/dotnet/arcade build 20200924.4
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 5.0.0-beta.20474.4
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20200928.3
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 5.0.0-beta.20478.3
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20201006.7
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 5.0.0-beta.20506.7
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks,Microsoft.SourceLink.GitHub,XliffTasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20201009.12
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 6.0.0-beta.20509.12
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks,Microsoft.SourceLink.GitHub,XliffTasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20201020.8
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 6.0.0-beta.20520.8
Dependency coherency updates
Microsoft.SourceLink.GitHub,XliffTasks
From Version 1.1.0-beta-20464-02 -> To Version 1.1.0-beta-20519-02 (parent: Microsoft.DotNet.Arcade.Sdk
* Update FileInfoAssertions.cs
* Update FileInfoAssertions.cs
* Use tasks provided by Microsoft.DotNet.Build.Tasks.Installers when provided.
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
2020-10-23 07:44:02 +00:00
|
|
|
Write-PipelineTelemetryError -Category 'SourceLink' -Message "$packagePath has broken SourceLink links."
|
|
|
|
}
|
2020-09-16 18:30:55 +00:00
|
|
|
$ValidationFailures.Value++
|
2019-06-13 12:10:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function ValidateSourceLinkLinks {
|
2019-11-22 13:41:58 +00:00
|
|
|
if ($GHRepoName -ne '' -and !($GHRepoName -Match '^[^\s\/]+/[^\s\/]+$')) {
|
|
|
|
if (!($GHRepoName -Match '^[^\s-]+-[^\s]+$')) {
|
|
|
|
Write-PipelineTelemetryError -Category 'SourceLink' -Message "GHRepoName should be in the format <org>/<repo> or <org>-<repo>. '$GHRepoName'"
|
2019-06-13 12:10:50 +00:00
|
|
|
ExitWithExitCode 1
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$GHRepoName = $GHRepoName -replace '^([^\s-]+)-([^\s]+)$', '$1/$2';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-22 13:41:58 +00:00
|
|
|
if ($GHCommit -ne '' -and !($GHCommit -Match '^[0-9a-fA-F]{40}$')) {
|
|
|
|
Write-PipelineTelemetryError -Category 'SourceLink' -Message "GHCommit should be a 40 chars hexadecimal string. '$GHCommit'"
|
2019-06-13 12:10:50 +00:00
|
|
|
ExitWithExitCode 1
|
|
|
|
}
|
|
|
|
|
2019-11-22 13:41:58 +00:00
|
|
|
if ($GHRepoName -ne '' -and $GHCommit -ne '') {
|
|
|
|
$RepoTreeURL = -Join('http://api.github.com/repos/', $GHRepoName, '/git/trees/', $GHCommit, '?recursive=1')
|
|
|
|
$CodeExtensions = @('.cs', '.vb', '.fs', '.fsi', '.fsx', '.fsscript')
|
2019-06-13 12:10:50 +00:00
|
|
|
|
2019-08-22 12:34:05 +00:00
|
|
|
try {
|
|
|
|
# Retrieve the list of files in the repo at that particular commit point and store them in the RepoFiles hash
|
|
|
|
$Data = Invoke-WebRequest $RepoTreeURL -UseBasicParsing | ConvertFrom-Json | Select-Object -ExpandProperty tree
|
2019-06-13 12:10:50 +00:00
|
|
|
|
2019-08-22 12:34:05 +00:00
|
|
|
foreach ($file in $Data) {
|
|
|
|
$Extension = [System.IO.Path]::GetExtension($file.path)
|
2019-06-13 12:10:50 +00:00
|
|
|
|
2019-08-22 12:34:05 +00:00
|
|
|
if ($CodeExtensions.Contains($Extension)) {
|
|
|
|
$RepoFiles[$file.path] = 1
|
|
|
|
}
|
2019-06-13 12:10:50 +00:00
|
|
|
}
|
|
|
|
}
|
2019-08-22 12:34:05 +00:00
|
|
|
catch {
|
|
|
|
Write-Host "Problems downloading the list of files from the repo. Url used: $RepoTreeURL . Execution will proceed without caching."
|
|
|
|
}
|
2019-06-13 12:10:50 +00:00
|
|
|
}
|
2019-11-22 13:41:58 +00:00
|
|
|
elseif ($GHRepoName -ne '' -or $GHCommit -ne '') {
|
|
|
|
Write-Host 'For using the http caching mechanism both GHRepoName and GHCommit should be informed.'
|
2019-06-13 12:10:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (Test-Path $ExtractPath) {
|
|
|
|
Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue
|
|
|
|
}
|
|
|
|
|
2020-06-11 17:47:07 +00:00
|
|
|
$ValidationFailures = 0
|
|
|
|
|
2019-06-13 12:10:50 +00:00
|
|
|
# Process each NuGet package in parallel
|
|
|
|
Get-ChildItem "$InputPath\*.symbols.nupkg" |
|
|
|
|
ForEach-Object {
|
2021-05-14 13:08:05 +00:00
|
|
|
Write-Host "Starting $($_.FullName)"
|
2019-08-22 12:34:05 +00:00
|
|
|
Start-Job -ScriptBlock $ValidatePackage -ArgumentList $_.FullName | Out-Null
|
|
|
|
$NumJobs = @(Get-Job -State 'Running').Count
|
|
|
|
|
|
|
|
while ($NumJobs -ge $MaxParallelJobs) {
|
|
|
|
Write-Host "There are $NumJobs validation jobs running right now. Waiting $SecondsBetweenLoadChecks seconds to check again."
|
|
|
|
sleep $SecondsBetweenLoadChecks
|
|
|
|
$NumJobs = @(Get-Job -State 'Running').Count
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($Job in @(Get-Job -State 'Completed')) {
|
2020-09-16 18:30:55 +00:00
|
|
|
$jobResult = Wait-Job -Id $Job.Id | Receive-Job
|
[master] Update dependencies from dotnet/arcade (#8726)
* Update dependencies from https://github.com/dotnet/arcade build 20200924.4
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 5.0.0-beta.20474.4
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20200928.3
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 5.0.0-beta.20478.3
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20201006.7
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 5.0.0-beta.20506.7
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks,Microsoft.SourceLink.GitHub,XliffTasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20201009.12
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 6.0.0-beta.20509.12
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks,Microsoft.SourceLink.GitHub,XliffTasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20201020.8
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 6.0.0-beta.20520.8
Dependency coherency updates
Microsoft.SourceLink.GitHub,XliffTasks
From Version 1.1.0-beta-20464-02 -> To Version 1.1.0-beta-20519-02 (parent: Microsoft.DotNet.Arcade.Sdk
* Update FileInfoAssertions.cs
* Update FileInfoAssertions.cs
* Use tasks provided by Microsoft.DotNet.Build.Tasks.Installers when provided.
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
2020-10-23 07:44:02 +00:00
|
|
|
CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$ValidationFailures) -LogErrors
|
2019-08-22 12:34:05 +00:00
|
|
|
Remove-Job -Id $Job.Id
|
|
|
|
}
|
2019-06-13 12:10:50 +00:00
|
|
|
}
|
|
|
|
|
2019-08-23 12:33:14 +00:00
|
|
|
foreach ($Job in @(Get-Job)) {
|
2019-08-22 12:34:05 +00:00
|
|
|
$jobResult = Wait-Job -Id $Job.Id | Receive-Job
|
[master] Update dependencies from dotnet/arcade (#8726)
* Update dependencies from https://github.com/dotnet/arcade build 20200924.4
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 5.0.0-beta.20474.4
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20200928.3
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 5.0.0-beta.20478.3
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20201006.7
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 5.0.0-beta.20506.7
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks,Microsoft.SourceLink.GitHub,XliffTasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20201009.12
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 6.0.0-beta.20509.12
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks,Microsoft.SourceLink.GitHub,XliffTasks
From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk
* Update dependencies from https://github.com/dotnet/arcade build 20201020.8
Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
From Version 5.0.0-beta.20471.1 -> To Version 6.0.0-beta.20520.8
Dependency coherency updates
Microsoft.SourceLink.GitHub,XliffTasks
From Version 1.1.0-beta-20464-02 -> To Version 1.1.0-beta-20519-02 (parent: Microsoft.DotNet.Arcade.Sdk
* Update FileInfoAssertions.cs
* Update FileInfoAssertions.cs
* Use tasks provided by Microsoft.DotNet.Build.Tasks.Installers when provided.
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
2020-10-23 07:44:02 +00:00
|
|
|
CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$ValidationFailures)
|
2020-06-11 17:47:07 +00:00
|
|
|
Remove-Job -Id $Job.Id
|
2019-08-22 12:34:05 +00:00
|
|
|
}
|
|
|
|
if ($ValidationFailures -gt 0) {
|
2019-11-22 13:41:58 +00:00
|
|
|
Write-PipelineTelemetryError -Category 'SourceLink' -Message "$ValidationFailures package(s) failed validation."
|
2019-08-22 12:34:05 +00:00
|
|
|
ExitWithExitCode 1
|
2019-06-13 12:10:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-27 12:35:24 +00:00
|
|
|
function InstallSourcelinkCli {
|
2019-11-22 13:41:58 +00:00
|
|
|
$sourcelinkCliPackageName = 'sourcelink'
|
2019-07-27 12:35:24 +00:00
|
|
|
|
|
|
|
$dotnetRoot = InitializeDotNetCli -install:$true
|
|
|
|
$dotnet = "$dotnetRoot\dotnet.exe"
|
|
|
|
$toolList = & "$dotnet" tool list --global
|
|
|
|
|
|
|
|
if (($toolList -like "*$sourcelinkCliPackageName*") -and ($toolList -like "*$sourcelinkCliVersion*")) {
|
|
|
|
Write-Host "SourceLink CLI version $sourcelinkCliVersion is already installed."
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
Write-Host "Installing SourceLink CLI version $sourcelinkCliVersion..."
|
2019-11-22 13:41:58 +00:00
|
|
|
Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.'
|
2019-07-27 12:35:24 +00:00
|
|
|
& "$dotnet" tool install $sourcelinkCliPackageName --version $sourcelinkCliVersion --verbosity "minimal" --global
|
2019-06-13 12:10:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
2019-07-27 12:35:24 +00:00
|
|
|
InstallSourcelinkCli
|
2019-06-13 12:10:50 +00:00
|
|
|
|
2021-05-14 13:08:05 +00:00
|
|
|
foreach ($Job in @(Get-Job)) {
|
|
|
|
Remove-Job -Id $Job.Id
|
|
|
|
}
|
|
|
|
|
2019-07-27 12:35:24 +00:00
|
|
|
ValidateSourceLinkLinks
|
2019-06-13 12:10:50 +00:00
|
|
|
}
|
|
|
|
catch {
|
|
|
|
Write-Host $_.Exception
|
|
|
|
Write-Host $_.ScriptStackTrace
|
2019-11-22 13:41:58 +00:00
|
|
|
Write-PipelineTelemetryError -Category 'SourceLink' -Message $_
|
2019-06-13 12:10:50 +00:00
|
|
|
ExitWithExitCode 1
|
|
|
|
}
|