Skip to content

Commit 49dc7ec

Browse files
[main] Source code updates from dotnet/dotnet (#62072)
[main] Source code updates from dotnet/dotnet - Merge branch 'main' into darc-main-b6753722-f3ed-453f-b86f-4af7542068dc - Fix build script - Align M.CA package versions
1 parent 5e56818 commit 49dc7ec

File tree

15 files changed

+322
-337
lines changed

15 files changed

+322
-337
lines changed

eng/Common.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
- If we're building outside of the VMR, publish these assets from the Windows job.
4545
- If we're building inside the VMR, publish these assets from whichever job is producing non-RID-specific artifacts.
4646
-->
47-
<PublishAllBuildsAssetsInThisJob Condition="('$(OS)' == 'Windows_NT' and '$(DotNetBuildOrchestrator)' != 'true')
48-
or ('$(DotNetBuildOrchestrator)' == 'true' and '$(EnableDefaultRidSpecificArtifacts)' != 'true'
47+
<PublishAllBuildsAssetsInThisJob Condition="('$(OS)' == 'Windows_NT' and '$(DotNetBuildFromVMR)' != 'true')
48+
or ('$(DotNetBuildFromVMR)' == 'true' and '$(EnableDefaultRidSpecificArtifacts)' != 'true'
4949
and ('$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1'))">true</PublishAllBuildsAssetsInThisJob>
5050
<PublishInstallerBaseVersion Condition="'$(PublishInstallerBaseVersion)' == ''">$(PublishAllBuildsAssetsInThisJob)</PublishInstallerBaseVersion>
5151
</PropertyGroup>

eng/Version.Details.xml

Lines changed: 185 additions & 185 deletions
Large diffs are not rendered by default.

eng/Versions.props

Lines changed: 89 additions & 89 deletions
Large diffs are not rendered by default.

eng/build.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ Key for feed that can be used when downloading .NET runtimes and SDKs
102102
.PARAMETER ProductBuild
103103
Build the repository in product mode (short: -pb).
104104
105+
.PARAMETER fromVMR
106+
Set when building from within the VMR.
107+
105108
.EXAMPLE
106109
Building both native and managed projects.
107110
@@ -203,6 +206,9 @@ param(
203206
[Alias('pb')]
204207
[switch]$ProductBuild,
205208

209+
# Intentionally lowercase as tools.ps1 depends on it
210+
[switch]$fromVMR,
211+
206212
# Capture the rest
207213
[Parameter(ValueFromRemainingArguments = $true)]
208214
[string[]]$MSBuildArguments
@@ -283,6 +289,7 @@ $MSBuildArguments += "/p:TargetArchitecture=$Architecture"
283289
$MSBuildArguments += "/p:TargetOsName=win"
284290

285291
if ($ProductBuild) { $MSBuildArguments += "/p:DotNetBuild=$ProductBuild" }
292+
if ($fromVMR) { $MSBuildArguments += "/p:DotNetBuildFromVMR=$fromVMR" }
286293

287294
if (-not $Configuration) {
288295
$Configuration = if ($CI) { 'Release' } else { 'Debug' }
@@ -299,6 +306,7 @@ if ($RuntimeSourceFeed -or $RuntimeSourceFeedKey) {
299306
$ToolsetBuildArguments += $runtimeFeedKeyArg
300307
}
301308
if ($ProductBuild) { $ToolsetBuildArguments += "/p:DotNetBuild=$ProductBuild" }
309+
if ($fromVMR) { $ToolsetBuildArguments += "/p:DotNetBuildFromVMR=$fromVMR" }
302310

303311
# Split build categories between dotnet msbuild and desktop msbuild. Use desktop msbuild as little as possible.
304312
[string[]]$dotnetBuildArguments = ''

eng/build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ runtime_source_feed=''
3737
runtime_source_feed_key=''
3838
source_build=''
3939
product_build=''
40+
from_vmr=''
4041
warn_as_error=true
42+
from_vmr=''
4143

4244
if [ "$(uname)" = "Darwin" ]; then
4345
target_os_name='osx'
@@ -94,6 +96,7 @@ Options:
9496
9597
--sourceBuild|-sb Build the repository in source-only mode.
9698
--productBuild|-pb Build the repository in product-build mode.
99+
--fromVMR Set when building from within the VMR.
97100
98101
Description:
99102
This build script installs required tools and runs an MSBuild command on this repository
@@ -261,6 +264,9 @@ while [[ $# -gt 0 ]]; do
261264
-productbuild|-product-build|-pb)
262265
product_build=true
263266
;;
267+
-fromvmr|-from-vmr)
268+
from_vmr=true
269+
;;
264270
-warnaserror)
265271
shift
266272
[ -z "${1:-}" ] && __error "Missing value for parameter --warnaserror" && __usage
@@ -325,6 +331,7 @@ fi
325331
[ ! -z "$build_installers" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildInstallers=$build_installers"
326332
[ ! -z "$product_build" ] && msbuild_args[${#msbuild_args[*]}]="-p:DotNetBuild=$product_build"
327333
[ ! -z "$source_build" ] && msbuild_args[${#msbuild_args[*]}]="-p:DotNetBuildSourceOnly=$source_build"
334+
[ ! -z "$from_vmr" ] && msbuild_args[${#msbuild_args[*]}]="-p:DotNetBuildFromVMR=$from_vmr"
328335

329336
# Run restore by default unless --no-restore or --no-build was specified.
330337
[ -z "$run_restore" ] && run_restore=true
@@ -363,6 +370,7 @@ if [ ! -z "$runtime_source_feed$runtime_source_feed_key" ]; then
363370
fi
364371
[ ! -z "$product_build" ] && toolset_build_args[${#toolset_build_args[*]}]="-p:DotNetBuild=$product_build"
365372
[ ! -z "$source_build" ] && toolset_build_args[${#toolset_build_args[*]}]="-p:DotNetBuildSourceOnly=$source_build"
373+
[ ! -z "$from_vmr" ] && toolset_build_args[${#toolset_build_args[*]}]="-p:DotNetBuildFromVMR=$from_vmr"
366374

367375
# Initialize global variables need to be set before the import of Arcade is imported
368376
restore=$run_restore

eng/common/build.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Param(
2121
[switch] $publish,
2222
[switch] $clean,
2323
[switch][Alias('pb')]$productBuild,
24+
[switch]$fromVMR,
2425
[switch][Alias('bl')]$binaryLog,
2526
[switch][Alias('nobl')]$excludeCIBinarylog,
2627
[switch] $ci,
@@ -74,6 +75,7 @@ function Print-Usage() {
7475
Write-Host " -nativeToolsOnMachine Sets the native tools on machine environment variable (indicating that the script should use native tools on machine)"
7576
Write-Host " -nodeReuse <value> Sets nodereuse msbuild parameter ('true' or 'false')"
7677
Write-Host " -buildCheck Sets /check msbuild parameter"
78+
Write-Host " -fromVMR Set when building from within the VMR"
7779
Write-Host ""
7880

7981
Write-Host "Command line arguments not listed above are passed thru to msbuild."
@@ -128,6 +130,7 @@ function Build {
128130
/p:Test=$test `
129131
/p:Pack=$pack `
130132
/p:DotNetBuild=$productBuild `
133+
/p:DotNetBuildFromVMR=$fromVMR `
131134
/p:IntegrationTest=$integrationTest `
132135
/p:PerformanceTest=$performanceTest `
133136
/p:Sign=$sign `

eng/common/build.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ usage()
4343
echo " --nodeReuse <value> Sets nodereuse msbuild parameter ('true' or 'false')"
4444
echo " --warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
4545
echo " --buildCheck <value> Sets /check msbuild parameter"
46+
echo " --fromVMR Set when building from within the VMR"
4647
echo ""
4748
echo "Command line arguments not listed above are passed thru to msbuild."
4849
echo "Arguments can also be passed in with a single hyphen."
@@ -64,6 +65,7 @@ restore=false
6465
build=false
6566
source_build=false
6667
product_build=false
68+
from_vmr=false
6769
rebuild=false
6870
test=false
6971
integration_test=false
@@ -89,7 +91,7 @@ verbosity='minimal'
8991
runtime_source_feed=''
9092
runtime_source_feed_key=''
9193

92-
properties=''
94+
properties=()
9395
while [[ $# > 0 ]]; do
9496
opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")"
9597
case "$opt" in
@@ -142,6 +144,9 @@ while [[ $# > 0 ]]; do
142144
restore=true
143145
pack=true
144146
;;
147+
-fromvmr|-from-vmr)
148+
from_vmr=true
149+
;;
145150
-test|-t)
146151
test=true
147152
;;
@@ -187,7 +192,7 @@ while [[ $# > 0 ]]; do
187192
shift
188193
;;
189194
*)
190-
properties="$properties $1"
195+
properties+=("$1")
191196
;;
192197
esac
193198

@@ -221,7 +226,7 @@ function Build {
221226
InitializeCustomToolset
222227

223228
if [[ ! -z "$projects" ]]; then
224-
properties="$properties /p:Projects=$projects"
229+
properties+=("/p:Projects=$projects")
225230
fi
226231

227232
local bl=""
@@ -243,6 +248,7 @@ function Build {
243248
/p:Build=$build \
244249
/p:DotNetBuild=$product_build \
245250
/p:DotNetBuildSourceOnly=$source_build \
251+
/p:DotNetBuildFromVMR=$from_vmr \
246252
/p:Rebuild=$rebuild \
247253
/p:Test=$test \
248254
/p:Pack=$pack \
@@ -251,7 +257,7 @@ function Build {
251257
/p:Sign=$sign \
252258
/p:Publish=$publish \
253259
/p:RestoreStaticGraphEnableBinaryLogger=$binary_log \
254-
$properties
260+
${properties[@]+"${properties[@]}"}
255261

256262
ExitWithExitCode 0
257263
}

eng/common/core-templates/post-build/post-build.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,6 @@ stages:
193193
buildId: $(AzDOBuildId)
194194
artifactName: PackageArtifacts
195195
checkDownloadedFiles: true
196-
itemPattern: |
197-
**
198-
!**/Microsoft.SourceBuild.Intermediate.*.nupkg
199196

200197
# This is necessary whenever we want to publish/restore to an AzDO private feed
201198
# Since sdk-task.ps1 tries to restore packages we need to do this authentication here

eng/common/core-templates/steps/install-microbuild.yml

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -48,38 +48,3 @@ steps:
4848
eq(variables['_SignType'], 'real')
4949
)
5050
))
51-
52-
# Workaround for ESRP CLI on Linux - https://github.com/dotnet/source-build/issues/4964
53-
- ${{ if eq(parameters.enableMicrobuildForMacAndLinux, 'true') }}:
54-
- task: UseDotNet@2
55-
displayName: Install .NET 9.0 SDK for ESRP CLI Workaround
56-
inputs:
57-
packageType: sdk
58-
version: 9.0.x
59-
installationPath: ${{ parameters.microBuildOutputFolder }}/.dotnet
60-
workingDirectory: ${{ parameters.microBuildOutputFolder }}
61-
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
62-
63-
- task: PowerShell@2
64-
displayName: Workaround for ESRP CLI on Linux
65-
inputs:
66-
targetType: 'inline'
67-
script: |
68-
Write-Host "Copying Linux Path"
69-
$MBSIGN_APPFOLDER = '$(MBSIGN_APPFOLDER)'
70-
$MBSIGN_APPFOLDER = ($MBSIGN_APPFOLDER -replace '/build', '')
71-
72-
$versionRegex = '\d+\.\d+\.\d+'
73-
$package = Get-ChildItem -Path $MBSIGN_APPFOLDER -Directory |
74-
Where-Object { $_.Name -match $versionRegex }
75-
76-
if ($package.Count -ne 1) {
77-
Write-Host "There should be exactly one matching subfolder, but found $($package.Count)."
78-
exit 1
79-
}
80-
81-
$MBSIGN_APPFOLDER = $package[0].FullName + '/build'
82-
$MBSIGN_APPFOLDER | Write-Host
83-
$SignConfigPath = $MBSIGN_APPFOLDER + '/signconfig.xml'
84-
Copy-Item -Path "$(MBSIGN_APPFOLDER)/signconfig.xml" -Destination $SignConfigPath -Force
85-
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))

eng/common/tools.ps1

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ $ErrorActionPreference = 'Stop'
6565
# Base-64 encoded SAS token that has permission to storage container described by $runtimeSourceFeed
6666
[string]$runtimeSourceFeedKey = if (Test-Path variable:runtimeSourceFeedKey) { $runtimeSourceFeedKey } else { $null }
6767

68-
# True if the build is a product build
69-
[bool]$productBuild = if (Test-Path variable:productBuild) { $productBuild } else { $false }
68+
# True when the build is running within the VMR.
69+
[bool]$fromVMR = if (Test-Path variable:fromVMR) { $fromVMR } else { $false }
7070

7171
function Create-Directory ([string[]] $path) {
7272
New-Item -Path $path -Force -ItemType 'Directory' | Out-Null
@@ -644,7 +644,6 @@ function GetNuGetPackageCachePath() {
644644
$env:NUGET_PACKAGES = Join-Path $env:UserProfile '.nuget\packages\'
645645
} else {
646646
$env:NUGET_PACKAGES = Join-Path $RepoRoot '.packages\'
647-
$env:RESTORENOHTTPCACHE = $true
648647
}
649648
}
650649

@@ -850,8 +849,8 @@ function MSBuild-Core() {
850849
}
851850

852851
# When running on Azure Pipelines, override the returned exit code to avoid double logging.
853-
# Skip this when the build is a child of the VMR orchestrator build.
854-
if ($ci -and $env:SYSTEM_TEAMPROJECT -ne $null -and !$productBuild) {
852+
# Skip this when the build is a child of the VMR build.
853+
if ($ci -and $env:SYSTEM_TEAMPROJECT -ne $null -and !$fromVMR) {
855854
Write-PipelineSetResult -Result "Failed" -Message "msbuild execution failed."
856855
# Exiting with an exit code causes the azure pipelines task to log yet another "noise" error
857856
# The above Write-PipelineSetResult will cause the task to be marked as failure without adding yet another error

eng/common/tools.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ fi
7272
runtime_source_feed=${runtime_source_feed:-''}
7373
runtime_source_feed_key=${runtime_source_feed_key:-''}
7474

75-
# True if the build is a product build
76-
product_build=${product_build:-false}
75+
# True when the build is running within the VMR.
76+
from_vmr=${from_vmr:-false}
7777

7878
# Resolve any symlinks in the given path.
7979
function ResolvePath {
@@ -345,14 +345,12 @@ function InitializeBuildTool {
345345
_InitializeBuildToolCommand="msbuild"
346346
}
347347

348-
# Set RestoreNoHttpCache as a workaround for https://github.com/NuGet/Home/issues/3116
349348
function GetNuGetPackageCachePath {
350349
if [[ -z ${NUGET_PACKAGES:-} ]]; then
351350
if [[ "$use_global_nuget_cache" == true ]]; then
352351
export NUGET_PACKAGES="$HOME/.nuget/packages/"
353352
else
354353
export NUGET_PACKAGES="$repo_root/.packages/"
355-
export RESTORENOHTTPCACHE=true
356354
fi
357355
fi
358356

@@ -506,8 +504,8 @@ function MSBuild-Core {
506504
echo "Build failed with exit code $exit_code. Check errors above."
507505

508506
# When running on Azure Pipelines, override the returned exit code to avoid double logging.
509-
# Skip this when the build is a child of the VMR orchestrator build.
510-
if [[ "$ci" == true && -n ${SYSTEM_TEAMPROJECT:-} && "$product_build" != true ]]; then
507+
# Skip this when the build is a child of the VMR build.
508+
if [[ "$ci" == true && -n ${SYSTEM_TEAMPROJECT:-} && "$from_vmr" != true ]]; then
511509
Write-PipelineSetResult -result "Failed" -message "msbuild execution failed."
512510
# Exiting with an exit code causes the azure pipelines task to log yet another "noise" error
513511
# The above Write-PipelineSetResult will cause the task to be marked as failure without adding yet another error

global.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"sdk": {
3-
"version": "10.0.100-preview.4.25216.37"
3+
"version": "10.0.100-preview.6.25272.112"
44
},
55
"tools": {
6-
"dotnet": "10.0.100-preview.4.25216.37",
6+
"dotnet": "10.0.100-preview.6.25272.112",
77
"runtimes": {
88
"dotnet/x86": [
99
"$(MicrosoftInternalRuntimeAspNetCoreTransportVersion)"
@@ -27,9 +27,9 @@
2727
"jdk": "latest"
2828
},
2929
"msbuild-sdks": {
30-
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25270.108",
31-
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25270.108",
32-
"Microsoft.DotNet.SharedFramework.Sdk": "10.0.0-beta.25270.108",
30+
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25277.102",
31+
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25277.102",
32+
"Microsoft.DotNet.SharedFramework.Sdk": "10.0.0-beta.25277.102",
3333
"Microsoft.Build.NoTargets": "3.7.0",
3434
"Microsoft.Build.Traversal": "3.4.0"
3535
}

src/Framework/App.Ref.Internal/src/Microsoft.AspNetCore.App.Ref.Internal.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<IncludeBuildOutput>false</IncludeBuildOutput>
1212
<IncludeSymbols>false</IncludeSymbols>
1313
<NoPackageAnalysis>true</NoPackageAnalysis>
14+
<ExcludeFromSourceOnlyBuild>false</ExcludeFromSourceOnlyBuild>
1415
</PropertyGroup>
1516

1617
</Project>

src/Http/Http.Extensions/src/RequestDelegateFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1642,7 +1642,7 @@ private static Expression BindParameterFromService(ParameterInfo parameter, Requ
16421642
return Expression.Call(GetRequiredServiceMethod.MakeGenericMethod(parameter.ParameterType), RequestServicesExpr);
16431643
}
16441644

1645-
private static Expression BindParameterFromKeyedService(ParameterInfo parameter, object key, RequestDelegateFactoryContext factoryContext)
1645+
private static Expression BindParameterFromKeyedService(ParameterInfo parameter, object? key, RequestDelegateFactoryContext factoryContext)
16461646
{
16471647
var isOptional = IsOptionalParameter(parameter, factoryContext);
16481648

src/SignalR/server/Core/src/Internal/HubMethodDescriptor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public HubMethodDescriptor(ObjectMethodExecutor methodExecutor, IServiceProvider
9797
{
9898
if (keyedServiceProvider.IsKeyedService(GetServiceType(p.ParameterType), keyedServicesAttribute.Key))
9999
{
100-
KeyedServiceKeys ??= new List<(int, object)>();
100+
KeyedServiceKeys ??= new List<(int, object?)>();
101101
KeyedServiceKeys.Add((index, keyedServicesAttribute.Key));
102102
MarkServiceParameter(index);
103103
}
@@ -158,7 +158,7 @@ private bool MarkServiceParameter(int index)
158158

159159
public List<Type>? StreamingParameters { get; private set; }
160160

161-
public List<(int, object)>? KeyedServiceKeys { get; private set; }
161+
public List<(int, object?)>? KeyedServiceKeys { get; private set; }
162162

163163
public ObjectMethodExecutor MethodExecutor { get; }
164164

0 commit comments

Comments
 (0)