Merge in 'release/6.0.4xx' changes

This commit is contained in:
dotnet-bot 2022-08-15 02:17:57 +00:00
commit baae4cac8b
13 changed files with 143 additions and 63 deletions

View file

@ -197,23 +197,23 @@
</Dependency> </Dependency>
</ProductDependencies> </ProductDependencies>
<ToolsetDependencies> <ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.22314.7"> <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.22411.3">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>fdd3a242bc813f371023adff4e4c05c0be705d2a</Sha> <Sha>778552f02f31d50ec1c3c18a872cc482d04aec75</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" /> <SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.CMake.Sdk" Version="6.0.0-beta.22314.7"> <Dependency Name="Microsoft.DotNet.CMake.Sdk" Version="6.0.0-beta.22411.3">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>fdd3a242bc813f371023adff4e4c05c0be705d2a</Sha> <Sha>778552f02f31d50ec1c3c18a872cc482d04aec75</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" /> <SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="6.0.0-beta.22314.7"> <Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="6.0.0-beta.22411.3">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>fdd3a242bc813f371023adff4e4c05c0be705d2a</Sha> <Sha>778552f02f31d50ec1c3c18a872cc482d04aec75</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="6.0.0-servicing.22405.1"> <Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="6.0.0-servicing.22413.1">
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri> <Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
<Sha>3e4a01565292638b4e9841bd4a93f00155ccdebe</Sha> <Sha>7f458a0923e1984875989573ddbf44457ca97e72</Sha>
<SourceBuildTarball RepoName="source-build-reference-packages" ManagedOnly="true" /> <SourceBuildTarball RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency> </Dependency>
<Dependency Name="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-21480-02" CoherentParentDependency="Microsoft.DotNet.Arcade.Sdk"> <Dependency Name="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-21480-02" CoherentParentDependency="Microsoft.DotNet.Arcade.Sdk">

View file

@ -19,7 +19,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<!-- Dependency from https://github.com/dotnet/arcade --> <!-- Dependency from https://github.com/dotnet/arcade -->
<MicrosoftDotNetBuildTasksInstallersPackageVersion>6.0.0-beta.22314.7</MicrosoftDotNetBuildTasksInstallersPackageVersion> <MicrosoftDotNetBuildTasksInstallersPackageVersion>6.0.0-beta.22411.3</MicrosoftDotNetBuildTasksInstallersPackageVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<!-- Dependency from https://github.com/dotnet/winforms --> <!-- Dependency from https://github.com/dotnet/winforms -->

View file

@ -2,6 +2,8 @@ Param(
[Parameter(Mandatory=$true)][string] $ManifestDirPath # Manifest directory where sbom will be placed [Parameter(Mandatory=$true)][string] $ManifestDirPath # Manifest directory where sbom will be placed
) )
. $PSScriptRoot\pipeline-logging-functions.ps1
Write-Host "Creating dir $ManifestDirPath" Write-Host "Creating dir $ManifestDirPath"
# create directory for sbom manifest to be placed # create directory for sbom manifest to be placed
if (!(Test-Path -path $ManifestDirPath)) if (!(Test-Path -path $ManifestDirPath))

View file

@ -2,6 +2,18 @@
source="${BASH_SOURCE[0]}" source="${BASH_SOURCE[0]}"
# resolve $SOURCE until the file is no longer a symlink
while [[ -h $source ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. $scriptroot/pipeline-logging-functions.sh
manifest_dir=$1 manifest_dir=$1
if [ ! -d "$manifest_dir" ] ; then if [ ! -d "$manifest_dir" ] ; then

View file

@ -31,6 +31,10 @@ Wait time between retry attempts in seconds
.PARAMETER GlobalJsonFile .PARAMETER GlobalJsonFile
File path to global.json file File path to global.json file
.PARAMETER PathPromotion
Optional switch to enable either promote native tools specified in the global.json to the path (in Azure Pipelines)
or break the build if a native tool is not found on the path (on a local dev machine)
.NOTES .NOTES
#> #>
[CmdletBinding(PositionalBinding=$false)] [CmdletBinding(PositionalBinding=$false)]
@ -41,7 +45,8 @@ Param (
[switch] $Force = $False, [switch] $Force = $False,
[int] $DownloadRetries = 5, [int] $DownloadRetries = 5,
[int] $RetryWaitTimeInSeconds = 30, [int] $RetryWaitTimeInSeconds = 30,
[string] $GlobalJsonFile [string] $GlobalJsonFile,
[switch] $PathPromotion
) )
if (!$GlobalJsonFile) { if (!$GlobalJsonFile) {
@ -77,53 +82,100 @@ try {
ConvertFrom-Json | ConvertFrom-Json |
Select-Object -Expand 'native-tools' -ErrorAction SilentlyContinue Select-Object -Expand 'native-tools' -ErrorAction SilentlyContinue
if ($NativeTools) { if ($NativeTools) {
$NativeTools.PSObject.Properties | ForEach-Object { if ($PathPromotion -eq $True) {
$ToolName = $_.Name if ($env:SYSTEM_TEAMPROJECT) { # check to see if we're in an Azure pipelines build
$ToolVersion = $_.Value $NativeTools.PSObject.Properties | ForEach-Object {
$LocalInstallerArguments = @{ ToolName = "$ToolName" } $ToolName = $_.Name
$LocalInstallerArguments += @{ InstallPath = "$InstallBin" } $ToolVersion = $_.Value
$LocalInstallerArguments += @{ BaseUri = "$BaseUri" } $InstalledTools = @{}
$LocalInstallerArguments += @{ CommonLibraryDirectory = "$EngCommonBaseDir" }
$LocalInstallerArguments += @{ Version = "$ToolVersion" }
if ($Verbose) { if ((Get-Command "$ToolName" -ErrorAction SilentlyContinue) -eq $null) {
$LocalInstallerArguments += @{ Verbose = $True } if ($ToolVersion -eq "latest") {
$ToolVersion = ""
}
$ArcadeToolsDirectory = "C:\arcade-tools"
if (-not (Test-Path $ArcadeToolsDirectory)) {
Write-Error "Arcade tools directory '$ArcadeToolsDirectory' was not found; artifacts were not properly installed."
exit 1
}
$ToolDirectory = (Get-ChildItem -Path "$ArcadeToolsDirectory" -Filter "$ToolName-$ToolVersion*" | Sort-Object -Descending)[0]
if ([string]::IsNullOrWhiteSpace($ToolDirectory)) {
Write-Error "Unable to find directory for $ToolName $ToolVersion; please make sure the tool is installed on this image."
exit 1
}
$BinPathFile = "$($ToolDirectory.FullName)\binpath.txt"
if (-not (Test-Path -Path "$BinPathFile")) {
Write-Error "Unable to find binpath.txt in '$($ToolDirectory.FullName)' ($ToolName $ToolVersion); artifact is either installed incorrectly or is not a bootstrappable tool."
exit 1
}
$BinPath = Get-Content "$BinPathFile"
$ToolPath = Convert-Path -Path $BinPath
Write-Host "Adding $ToolName to the path ($ToolPath)..."
Write-Host "##vso[task.prependpath]$ToolPath"
$InstalledTools += @{ $ToolName = $ToolDirectory.FullName }
}
}
return $InstalledTools
} else {
$NativeTools.PSObject.Properties | ForEach-Object {
$ToolName = $_.Name
$ToolVersion = $_.Value
if ((Get-Command "$ToolName" -ErrorAction SilentlyContinue) -eq $null) {
Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message "$ToolName not found on path. Please install $ToolName $ToolVersion before proceeding."
}
}
exit 0
} }
if (Get-Variable 'Force' -ErrorAction 'SilentlyContinue') { } else {
if($Force) { $NativeTools.PSObject.Properties | ForEach-Object {
$LocalInstallerArguments += @{ Force = $True } $ToolName = $_.Name
$ToolVersion = $_.Value
$LocalInstallerArguments = @{ ToolName = "$ToolName" }
$LocalInstallerArguments += @{ InstallPath = "$InstallBin" }
$LocalInstallerArguments += @{ BaseUri = "$BaseUri" }
$LocalInstallerArguments += @{ CommonLibraryDirectory = "$EngCommonBaseDir" }
$LocalInstallerArguments += @{ Version = "$ToolVersion" }
if ($Verbose) {
$LocalInstallerArguments += @{ Verbose = $True }
}
if (Get-Variable 'Force' -ErrorAction 'SilentlyContinue') {
if($Force) {
$LocalInstallerArguments += @{ Force = $True }
}
}
if ($Clean) {
$LocalInstallerArguments += @{ Clean = $True }
}
Write-Verbose "Installing $ToolName version $ToolVersion"
Write-Verbose "Executing '$InstallerPath $($LocalInstallerArguments.Keys.ForEach({"-$_ '$($LocalInstallerArguments.$_)'"}) -join ' ')'"
& $InstallerPath @LocalInstallerArguments
if ($LASTEXITCODE -Ne "0") {
$errMsg = "$ToolName installation failed"
if ((Get-Variable 'DoNotAbortNativeToolsInstallationOnFailure' -ErrorAction 'SilentlyContinue') -and $DoNotAbortNativeToolsInstallationOnFailure) {
$showNativeToolsWarning = $true
if ((Get-Variable 'DoNotDisplayNativeToolsInstallationWarnings' -ErrorAction 'SilentlyContinue') -and $DoNotDisplayNativeToolsInstallationWarnings) {
$showNativeToolsWarning = $false
}
if ($showNativeToolsWarning) {
Write-Warning $errMsg
}
$toolInstallationFailure = $true
} else {
# We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482
Write-Host $errMsg
exit 1
}
} }
} }
if ($Clean) {
$LocalInstallerArguments += @{ Clean = $True } if ((Get-Variable 'toolInstallationFailure' -ErrorAction 'SilentlyContinue') -and $toolInstallationFailure) {
# We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482
Write-Host 'Native tools bootstrap failed'
exit 1
} }
Write-Verbose "Installing $ToolName version $ToolVersion"
Write-Verbose "Executing '$InstallerPath $($LocalInstallerArguments.Keys.ForEach({"-$_ '$($LocalInstallerArguments.$_)'"}) -join ' ')'"
& $InstallerPath @LocalInstallerArguments
if ($LASTEXITCODE -Ne "0") {
$errMsg = "$ToolName installation failed"
if ((Get-Variable 'DoNotAbortNativeToolsInstallationOnFailure' -ErrorAction 'SilentlyContinue') -and $DoNotAbortNativeToolsInstallationOnFailure) {
$showNativeToolsWarning = $true
if ((Get-Variable 'DoNotDisplayNativeToolsInstallationWarnings' -ErrorAction 'SilentlyContinue') -and $DoNotDisplayNativeToolsInstallationWarnings) {
$showNativeToolsWarning = $false
}
if ($showNativeToolsWarning) {
Write-Warning $errMsg
}
$toolInstallationFailure = $true
} else {
# We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482
Write-Host $errMsg
exit 1
}
}
}
if ((Get-Variable 'toolInstallationFailure' -ErrorAction 'SilentlyContinue') -and $toolInstallationFailure) {
# We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482
Write-Host 'Native tools bootstrap failed'
exit 1
} }
} }
else { else {
@ -139,7 +191,7 @@ try {
Write-Host "##vso[task.prependpath]$(Convert-Path -Path $InstallBin)" Write-Host "##vso[task.prependpath]$(Convert-Path -Path $InstallBin)"
return $InstallBin return $InstallBin
} }
else { elseif (-not ($PathPromotion)) {
Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message 'Native tools install directory does not exist, installation failed' Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message 'Native tools install directory does not exist, installation failed'
exit 1 exit 1
} }
@ -149,4 +201,4 @@ catch {
Write-Host $_.ScriptStackTrace Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message $_ Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message $_
ExitWithExitCode 1 ExitWithExitCode 1
} }

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="dotnet-core-internal-tooling" value="https://pkgs.dev.azure.com/devdiv/_packaging/dotnet-core-internal-tooling/nuget/v3/index.json" />
</packageSources>
</configuration>

View file

@ -8,6 +8,9 @@
<ItemGroup> <ItemGroup>
<!-- Clear references, the SDK may add some depending on UsuingToolXxx settings, but we only want to restore the following --> <!-- Clear references, the SDK may add some depending on UsuingToolXxx settings, but we only want to restore the following -->
<PackageReference Remove="@(PackageReference)"/> <PackageReference Remove="@(PackageReference)"/>
<PackageReference Include="Microsoft.ManifestTool.CrossPlatform" Version="$(MicrosoftManifestToolCrossPlatformVersion)" />
<PackageReference Include="Microsoft.VisualStudioEng.MicroBuild.Core" Version="$(MicrosoftVisualStudioEngMicroBuildCoreVersion)" />
<PackageReference Include="Microsoft.VisualStudioEng.MicroBuild.Plugins.SwixBuild" Version="$(MicrosoftVisualStudioEngMicroBuildPluginsSwixBuildVersion)" />
<PackageReference Include="Microsoft.DotNet.IBCMerge" Version="$(MicrosoftDotNetIBCMergeVersion)" Condition="'$(UsingToolIbcOptimization)' == 'true'" /> <PackageReference Include="Microsoft.DotNet.IBCMerge" Version="$(MicrosoftDotNetIBCMergeVersion)" Condition="'$(UsingToolIbcOptimization)' == 'true'" />
<PackageReference Include="Drop.App" Version="$(DropAppVersion)" ExcludeAssets="all" Condition="'$(UsingToolVisualStudioIbcTraining)' == 'true'"/> <PackageReference Include="Drop.App" Version="$(DropAppVersion)" ExcludeAssets="all" Condition="'$(UsingToolVisualStudioIbcTraining)' == 'true'"/>
</ItemGroup> </ItemGroup>

View file

@ -54,7 +54,7 @@ jobs:
# If it's not devdiv, it's dnceng # If it's not devdiv, it's dnceng
${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
name: NetCore1ESPool-Internal name: NetCore1ESPool-Internal
demands: ImageOverride -equals Build.Server.Amd64.VS2019 demands: ImageOverride -equals windows.vs2019.amd64
steps: steps:
- checkout: self - checkout: self
clean: true clean: true

View file

@ -41,7 +41,7 @@ jobs:
# If it's not devdiv, it's dnceng # If it's not devdiv, it's dnceng
${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
name: NetCore1ESPool-Internal name: NetCore1ESPool-Internal
demands: ImageOverride -equals Build.Server.Amd64.VS2019 demands: ImageOverride -equals windows.vs2019.amd64
variables: variables:
- group: OneLocBuildVariables # Contains the CeapexPat and GithubPat - group: OneLocBuildVariables # Contains the CeapexPat and GithubPat

View file

@ -90,7 +90,7 @@ jobs:
# If it's not devdiv, it's dnceng # If it's not devdiv, it's dnceng
${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
name: NetCore1ESPool-Internal name: NetCore1ESPool-Internal
demands: ImageOverride -equals Build.Server.Amd64.VS2019 demands: ImageOverride -equals windows.vs2019.amd64
runAsPublic: ${{ parameters.runAsPublic }} runAsPublic: ${{ parameters.runAsPublic }}
publishUsingPipelines: ${{ parameters.enablePublishUsingPipelines }} publishUsingPipelines: ${{ parameters.enablePublishUsingPipelines }}

View file

@ -101,7 +101,7 @@ stages:
# If it's not devdiv, it's dnceng # If it's not devdiv, it's dnceng
${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
name: NetCore1ESPool-Internal name: NetCore1ESPool-Internal
demands: ImageOverride -equals Build.Server.Amd64.VS2019 demands: ImageOverride -equals windows.vs2019.amd64
steps: steps:
- template: setup-maestro-vars.yml - template: setup-maestro-vars.yml
@ -138,7 +138,7 @@ stages:
# If it's not devdiv, it's dnceng # If it's not devdiv, it's dnceng
${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
name: NetCore1ESPool-Internal name: NetCore1ESPool-Internal
demands: ImageOverride -equals Build.Server.Amd64.VS2019 demands: ImageOverride -equals windows.vs2019.amd64
steps: steps:
- template: setup-maestro-vars.yml - template: setup-maestro-vars.yml
parameters: parameters:
@ -198,7 +198,7 @@ stages:
# If it's not devdiv, it's dnceng # If it's not devdiv, it's dnceng
${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
name: NetCore1ESPool-Internal name: NetCore1ESPool-Internal
demands: ImageOverride -equals Build.Server.Amd64.VS2019 demands: ImageOverride -equals windows.vs2019.amd64
steps: steps:
- template: setup-maestro-vars.yml - template: setup-maestro-vars.yml
parameters: parameters:
@ -255,7 +255,7 @@ stages:
# If it's not devdiv, it's dnceng # If it's not devdiv, it's dnceng
${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
name: NetCore1ESPool-Internal name: NetCore1ESPool-Internal
demands: ImageOverride -equals Build.Server.Amd64.VS2019 demands: ImageOverride -equals windows.vs2019.amd64
steps: steps:
- template: setup-maestro-vars.yml - template: setup-maestro-vars.yml
parameters: parameters:

View file

@ -635,6 +635,10 @@ function InitializeNativeTools() {
InstallDirectory = "$ToolsDir" InstallDirectory = "$ToolsDir"
} }
} }
if ($env:NativeToolsOnMachine) {
Write-Host "Variable NativeToolsOnMachine detected, enabling native tool path promotion..."
$nativeArgs += @{ PathPromotion = $true }
}
& "$PSScriptRoot/init-tools-native.ps1" @nativeArgs & "$PSScriptRoot/init-tools-native.ps1" @nativeArgs
} }
} }

View file

@ -11,7 +11,7 @@
"cmake": "3.16.4" "cmake": "3.16.4"
}, },
"msbuild-sdks": { "msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.22314.7", "Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.22411.3",
"Microsoft.DotNet.CMake.Sdk": "6.0.0-beta.22314.7" "Microsoft.DotNet.CMake.Sdk": "6.0.0-beta.22411.3"
} }
} }