Skip to content

Commit 907fd50

Browse files
Update Arcade (#233)
- Annual update of .NET Arcade for .NET 9. - Fix new warning.
1 parent 8d6c7eb commit 907fd50

File tree

90 files changed

+816
-3022
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+816
-3022
lines changed

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1010
<DebugSymbols>true</DebugSymbols>
1111
<DebugType>portable</DebugType>
12+
<SuppressSymbolPackageFormatValidation>true</SuppressSymbolPackageFormatValidation>
1213
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
1314
<DefineConstants Condition=" '$(Configuration)' == 'Debug' ">$(DefineConstants);JETBRAINS_ANNOTATIONS</DefineConstants>
1415
<Nullable>enable</Nullable>

eng/Version.Details.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
</ProductDependencies>
66

77
<ToolsetDependencies>
8-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21519.3">
8+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.24453.1">
99
<Uri>https://github.com/dotnet/arcade</Uri>
10-
<Sha>85f3aa16d8797b5020f1fda11df1a958feb5f8df</Sha>
10+
<Sha>dd332f2d4e21daa8b79f84251ab156af9a0b11b2</Sha>
1111
<SourceBuild RepoName="arcade" ManagedOnly="true" />
1212
</Dependency>
1313

14-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.21519.3">
14+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.24453.1">
1515
<Uri>https://github.com/dotnet/arcade</Uri>
16-
<Sha>85f3aa16d8797b5020f1fda11df1a958feb5f8df</Sha>
16+
<Sha>dd332f2d4e21daa8b79f84251ab156af9a0b11b2</Sha>
1717
</Dependency>
1818
</ToolsetDependencies>
1919

eng/common/SetupNugetSources.ps1

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
# This file is a temporary workaround for internal builds to be able to restore from private AzDO feeds.
2-
# This file should be removed as part of this issue: https://github.com/dotnet/arcade/issues/4080
1+
# This script adds internal feeds required to build commits that depend on internal package sources. For instance,
2+
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables
3+
# disabled internal Maestro (darc-int*) feeds.
34
#
4-
# What the script does is iterate over all package sources in the pointed NuGet.config and add a credential entry
5-
# under <packageSourceCredentials> for each Maestro managed private feed. Two additional credential
6-
# entries are also added for the two private static internal feeds: dotnet3-internal and dotnet3-internal-transport.
5+
# Optionally, this script also adds a credential entry for each of the internal feeds if supplied.
76
#
8-
# This script needs to be called in every job that will restore packages and which the base repo has
9-
# private AzDO feeds in the NuGet.config.
10-
#
11-
# See example YAML call for this script below. Note the use of the variable `$(dn-bot-dnceng-artifact-feeds-rw)`
12-
# from the AzureDevOps-Artifact-Feeds-Pats variable group.
13-
#
14-
# Any disabledPackageSources entries which start with "darc-int" will be re-enabled as part of this script executing
7+
# See example call for this script below.
158
#
169
# - task: PowerShell@2
1710
# displayName: Setup Private Feeds Credentials
@@ -21,11 +14,18 @@
2114
# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
2215
# env:
2316
# Token: $(dn-bot-dnceng-artifact-feeds-rw)
17+
#
18+
# Note that the NuGetAuthenticate task should be called after SetupNugetSources.
19+
# This ensures that:
20+
# - Appropriate creds are set for the added internal feeds (if not supplied to the scrupt)
21+
# - The credential provider is installed.
22+
#
23+
# This logic is also abstracted into enable-internal-sources.yml.
2424

2525
[CmdletBinding()]
2626
param (
2727
[Parameter(Mandatory = $true)][string]$ConfigFile,
28-
[Parameter(Mandatory = $true)][string]$Password
28+
$Password
2929
)
3030

3131
$ErrorActionPreference = "Stop"
@@ -35,7 +35,7 @@ Set-StrictMode -Version 2.0
3535
. $PSScriptRoot\tools.ps1
3636

3737
# Add source entry to PackageSources
38-
function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $Password) {
38+
function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $pwd) {
3939
$packageSource = $sources.SelectSingleNode("add[@key='$SourceName']")
4040

4141
if ($packageSource -eq $null)
@@ -48,12 +48,17 @@ function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Usern
4848
else {
4949
Write-Host "Package source $SourceName already present."
5050
}
51-
52-
AddCredential -Creds $creds -Source $SourceName -Username $Username -Password $Password
51+
52+
AddCredential -Creds $creds -Source $SourceName -Username $Username -pwd $pwd
5353
}
5454

5555
# Add a credential node for the specified source
56-
function AddCredential($creds, $source, $username, $password) {
56+
function AddCredential($creds, $source, $username, $pwd) {
57+
# If no cred supplied, don't do anything.
58+
if (!$pwd) {
59+
return;
60+
}
61+
5762
# Looks for credential configuration for the given SourceName. Create it if none is found.
5863
$sourceElement = $creds.SelectSingleNode($Source)
5964
if ($sourceElement -eq $null)
@@ -82,17 +87,18 @@ function AddCredential($creds, $source, $username, $password) {
8287
$passwordElement.SetAttribute("key", "ClearTextPassword")
8388
$sourceElement.AppendChild($passwordElement) | Out-Null
8489
}
85-
$passwordElement.SetAttribute("value", $Password)
90+
91+
$passwordElement.SetAttribute("value", $pwd)
8692
}
8793

88-
function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $Password) {
94+
function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $pwd) {
8995
$maestroPrivateSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]")
9096

9197
Write-Host "Inserting credentials for $($maestroPrivateSources.Count) Maestro's private feeds."
9298

9399
ForEach ($PackageSource in $maestroPrivateSources) {
94100
Write-Host "`tInserting credential for Maestro's feed:" $PackageSource.Key
95-
AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -Password $Password
101+
AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -pwd $pwd
96102
}
97103
}
98104

@@ -110,11 +116,6 @@ if (!(Test-Path $ConfigFile -PathType Leaf)) {
110116
ExitWithExitCode 1
111117
}
112118

113-
if (!$Password) {
114-
Write-PipelineTelemetryError -Category 'Build' -Message 'Eng/common/SetupNugetSources.ps1 returned a non-zero exit code. Please supply a valid PAT'
115-
ExitWithExitCode 1
116-
}
117-
118119
# Load NuGet.config
119120
$doc = New-Object System.Xml.XmlDocument
120121
$filename = (Get-Item $ConfigFile).FullName
@@ -127,11 +128,14 @@ if ($sources -eq $null) {
127128
$doc.DocumentElement.AppendChild($sources) | Out-Null
128129
}
129130

130-
# Looks for a <PackageSourceCredentials> node. Create it if none is found.
131-
$creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials")
132-
if ($creds -eq $null) {
133-
$creds = $doc.CreateElement("packageSourceCredentials")
134-
$doc.DocumentElement.AppendChild($creds) | Out-Null
131+
$creds = $null
132+
if ($Password) {
133+
# Looks for a <PackageSourceCredentials> node. Create it if none is found.
134+
$creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials")
135+
if ($creds -eq $null) {
136+
$creds = $doc.CreateElement("packageSourceCredentials")
137+
$doc.DocumentElement.AppendChild($creds) | Out-Null
138+
}
135139
}
136140

137141
# Check for disabledPackageSources; we'll enable any darc-int ones we find there
@@ -144,23 +148,23 @@ if ($disabledSources -ne $null) {
144148
$userName = "dn-bot"
145149

146150
# Insert credential nodes for Maestro's private feeds
147-
InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Username $userName -Password $Password
151+
InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Username $userName -pwd $Password
148152

149153
# 3.1 uses a different feed url format so it's handled differently here
150154
$dotnet31Source = $sources.SelectSingleNode("add[@key='dotnet3.1']")
151155
if ($dotnet31Source -ne $null) {
152-
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username $userName -Password $Password
153-
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -Password $Password
156+
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password
157+
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password
154158
}
155159

156-
$dotnetVersions = @('5','6','7','8')
160+
$dotnetVersions = @('5','6','7','8','9')
157161

158162
foreach ($dotnetVersion in $dotnetVersions) {
159163
$feedPrefix = "dotnet" + $dotnetVersion;
160164
$dotnetSource = $sources.SelectSingleNode("add[@key='$feedPrefix']")
161165
if ($dotnetSource -ne $null) {
162-
AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal/nuget/v2" -Creds $creds -Username $userName -Password $Password
163-
AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v2" -Creds $creds -Username $userName -Password $Password
166+
AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password
167+
AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password
164168
}
165169
}
166170

eng/common/SetupNugetSources.sh

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
#!/usr/bin/env bash
22

3-
# This file is a temporary workaround for internal builds to be able to restore from private AzDO feeds.
4-
# This file should be removed as part of this issue: https://github.com/dotnet/arcade/issues/4080
3+
# This script adds internal feeds required to build commits that depend on internal package sources. For instance,
4+
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables
5+
# disabled internal Maestro (darc-int*) feeds.
6+
#
7+
# Optionally, this script also adds a credential entry for each of the internal feeds if supplied.
58
#
6-
# What the script does is iterate over all package sources in the pointed NuGet.config and add a credential entry
7-
# under <packageSourceCredentials> for each Maestro's managed private feed. Two additional credential
8-
# entries are also added for the two private static internal feeds: dotnet3-internal and dotnet3-internal-transport.
9-
#
10-
# This script needs to be called in every job that will restore packages and which the base repo has
11-
# private AzDO feeds in the NuGet.config.
12-
#
13-
# See example YAML call for this script below. Note the use of the variable `$(dn-bot-dnceng-artifact-feeds-rw)`
14-
# from the AzureDevOps-Artifact-Feeds-Pats variable group.
15-
#
16-
# Any disabledPackageSources entries which start with "darc-int" will be re-enabled as part of this script executing.
9+
# See example call for this script below.
1710
#
1811
# - task: Bash@3
19-
# displayName: Setup Private Feeds Credentials
12+
# displayName: Setup Internal Feeds
2013
# inputs:
2114
# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
22-
# arguments: $(Build.SourcesDirectory)/NuGet.config $Token
15+
# arguments: $(Build.SourcesDirectory)/NuGet.config
2316
# condition: ne(variables['Agent.OS'], 'Windows_NT')
24-
# env:
25-
# Token: $(dn-bot-dnceng-artifact-feeds-rw)
17+
# - task: NuGetAuthenticate@1
18+
#
19+
# Note that the NuGetAuthenticate task should be called after SetupNugetSources.
20+
# This ensures that:
21+
# - Appropriate creds are set for the added internal feeds (if not supplied to the scrupt)
22+
# - The credential provider is installed.
23+
#
24+
# This logic is also abstracted into enable-internal-sources.yml.
2625

2726
ConfigFile=$1
2827
CredToken=$2
@@ -48,11 +47,6 @@ if [ ! -f "$ConfigFile" ]; then
4847
ExitWithExitCode 1
4948
fi
5049

51-
if [ -z "$CredToken" ]; then
52-
Write-PipelineTelemetryError -category 'Build' "Error: Eng/common/SetupNugetSources.sh returned a non-zero exit code. Please supply a valid PAT"
53-
ExitWithExitCode 1
54-
fi
55-
5650
if [[ `uname -s` == "Darwin" ]]; then
5751
NL=$'\\\n'
5852
TB=''
@@ -105,7 +99,7 @@ if [ "$?" == "0" ]; then
10599
PackageSources+=('dotnet3.1-internal-transport')
106100
fi
107101

108-
DotNetVersions=('5' '6' '7' '8')
102+
DotNetVersions=('5' '6' '7' '8' '9')
109103

110104
for DotNetVersion in ${DotNetVersions[@]} ; do
111105
FeedPrefix="dotnet${DotNetVersion}";
@@ -140,18 +134,20 @@ PackageSources+="$IFS"
140134
PackageSources+=$(grep -oh '"darc-int-[^"]*"' $ConfigFile | tr -d '"')
141135
IFS=$PrevIFS
142136

143-
for FeedName in ${PackageSources[@]} ; do
144-
# Check if there is no existing credential for this FeedName
145-
grep -i "<$FeedName>" $ConfigFile
146-
if [ "$?" != "0" ]; then
147-
echo "Adding credentials for $FeedName."
137+
if [ "$CredToken" ]; then
138+
for FeedName in ${PackageSources[@]} ; do
139+
# Check if there is no existing credential for this FeedName
140+
grep -i "<$FeedName>" $ConfigFile
141+
if [ "$?" != "0" ]; then
142+
echo "Adding credentials for $FeedName."
148143

149-
PackageSourceCredentialsNodeFooter="</packageSourceCredentials>"
150-
NewCredential="${TB}${TB}<$FeedName>${NL}<add key=\"Username\" value=\"dn-bot\" />${NL}<add key=\"ClearTextPassword\" value=\"$CredToken\" />${NL}</$FeedName>"
144+
PackageSourceCredentialsNodeFooter="</packageSourceCredentials>"
145+
NewCredential="${TB}${TB}<$FeedName>${NL}<add key=\"Username\" value=\"dn-bot\" />${NL}<add key=\"ClearTextPassword\" value=\"$CredToken\" />${NL}</$FeedName>"
151146

152-
sed -i.bak "s|$PackageSourceCredentialsNodeFooter|$NewCredential${NL}$PackageSourceCredentialsNodeFooter|" $ConfigFile
153-
fi
154-
done
147+
sed -i.bak "s|$PackageSourceCredentialsNodeFooter|$NewCredential${NL}$PackageSourceCredentialsNodeFooter|" $ConfigFile
148+
fi
149+
done
150+
fi
155151

156152
# Re-enable any entries in disabledPackageSources where the feed name contains darc-int
157153
grep -i "<disabledPackageSources>" $ConfigFile

eng/common/build.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0build.ps1""" %*"
3+
exit /b %ErrorLevel%

eng/common/build.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Param(
1919
[switch] $pack,
2020
[switch] $publish,
2121
[switch] $clean,
22+
[switch][Alias('pb')]$productBuild,
2223
[switch][Alias('bl')]$binaryLog,
2324
[switch][Alias('nobl')]$excludeCIBinarylog,
2425
[switch] $ci,
@@ -58,6 +59,7 @@ function Print-Usage() {
5859
Write-Host " -sign Sign build outputs"
5960
Write-Host " -publish Publish artifacts (e.g. symbols)"
6061
Write-Host " -clean Clean the solution"
62+
Write-Host " -productBuild Build the solution in the way it will be built in the full .NET product (VMR) build (short: -pb)"
6163
Write-Host ""
6264

6365
Write-Host "Advanced settings:"
@@ -120,6 +122,7 @@ function Build {
120122
/p:Deploy=$deploy `
121123
/p:Test=$test `
122124
/p:Pack=$pack `
125+
/p:DotNetBuildRepo=$productBuild `
123126
/p:IntegrationTest=$integrationTest `
124127
/p:PerformanceTest=$performanceTest `
125128
/p:Sign=$sign `

eng/common/build.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ usage()
2222
echo " --sourceBuild Source-build the solution (short: -sb)"
2323
echo " Will additionally trigger the following actions: --restore, --build, --pack"
2424
echo " If --configuration is not set explicitly, will also set it to 'Release'"
25+
echo " --productBuild Build the solution in the way it will be built in the full .NET product (VMR) build (short: -pb)"
26+
echo " Will additionally trigger the following actions: --restore, --build, --pack"
27+
echo " If --configuration is not set explicitly, will also set it to 'Release'"
2528
echo " --rebuild Rebuild solution"
2629
echo " --test Run all unit tests in the solution (short: -t)"
2730
echo " --integrationTest Run all integration tests in the solution"
@@ -59,6 +62,7 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
5962
restore=false
6063
build=false
6164
source_build=false
65+
product_build=false
6266
rebuild=false
6367
test=false
6468
integration_test=false
@@ -105,7 +109,7 @@ while [[ $# > 0 ]]; do
105109
-binarylog|-bl)
106110
binary_log=true
107111
;;
108-
-excludeCIBinarylog|-nobl)
112+
-excludecibinarylog|-nobl)
109113
exclude_ci_binary_log=true
110114
;;
111115
-pipelineslog|-pl)
@@ -126,6 +130,13 @@ while [[ $# > 0 ]]; do
126130
-sourcebuild|-sb)
127131
build=true
128132
source_build=true
133+
product_build=true
134+
restore=true
135+
pack=true
136+
;;
137+
-productBuild|-pb)
138+
build=true
139+
product_build=true
129140
restore=true
130141
pack=true
131142
;;
@@ -219,7 +230,9 @@ function Build {
219230
/p:RepoRoot="$repo_root" \
220231
/p:Restore=$restore \
221232
/p:Build=$build \
233+
/p:DotNetBuildRepo=$product_build \
222234
/p:ArcadeBuildFromSource=$source_build \
235+
/p:DotNetBuildSourceOnly=$source_build \
223236
/p:Rebuild=$rebuild \
224237
/p:Test=$test \
225238
/p:Pack=$pack \

eng/common/cross/arm/sources.list.bionic

Lines changed: 0 additions & 11 deletions
This file was deleted.

eng/common/cross/arm/sources.list.focal

Lines changed: 0 additions & 11 deletions
This file was deleted.

eng/common/cross/arm/sources.list.jammy

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)