Skip to content

[main] Source code updates from dotnet/dotnet #62072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eng/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
- If we're building outside of the VMR, publish these assets from the Windows job.
- If we're building inside the VMR, publish these assets from whichever job is producing non-RID-specific artifacts.
-->
<PublishAllBuildsAssetsInThisJob Condition="('$(OS)' == 'Windows_NT' and '$(DotNetBuildOrchestrator)' != 'true')
or ('$(DotNetBuildOrchestrator)' == 'true' and '$(EnableDefaultRidSpecificArtifacts)' != 'true'
<PublishAllBuildsAssetsInThisJob Condition="('$(OS)' == 'Windows_NT' and '$(DotNetBuildFromVMR)' != 'true')
or ('$(DotNetBuildFromVMR)' == 'true' and '$(EnableDefaultRidSpecificArtifacts)' != 'true'
and ('$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1'))">true</PublishAllBuildsAssetsInThisJob>
<PublishInstallerBaseVersion Condition="'$(PublishInstallerBaseVersion)' == ''">$(PublishAllBuildsAssetsInThisJob)</PublishInstallerBaseVersion>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions eng/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ and are generated based on the last package release.
<Version>$(MicrosoftCodeAnalysisVersion_LatestVS)</Version>
</LatestPackageReference>
<LatestPackageReference Update="Microsoft.CodeAnalysis.CSharp">
<Version>$(MicrosoftCodeAnalysisVersion_LatestVS)</Version>
<Version>$(Analyzer_MicrosoftCodeAnalysisCSharpVersion)</Version>
</LatestPackageReference>
<LatestPackageReference Update="Microsoft.CodeAnalysis.CSharp.Workspaces">
<Version>$(MicrosoftCodeAnalysisVersion_LatestVS)</Version>
<Version>$(Analyzer_MicrosoftCodeAnalysisCSharpWorkspacesVersion)</Version>
</LatestPackageReference>
<LatestPackageReference Update="Microsoft.CodeAnalysis.ExternalAccess.AspNetCore">
<Version>$(MicrosoftCodeAnalysisVersion_LatestVS)</Version>
Expand Down
370 changes: 185 additions & 185 deletions eng/Version.Details.xml

Large diffs are not rendered by default.

178 changes: 89 additions & 89 deletions eng/Versions.props

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ Key for feed that can be used when downloading .NET runtimes and SDKs
.PARAMETER ProductBuild
Build the repository in product mode (short: -pb).

.PARAMETER fromVMR
Set when building from within the VMR.

.EXAMPLE
Building both native and managed projects.

Expand Down Expand Up @@ -203,6 +206,9 @@ param(
[Alias('pb')]
[switch]$ProductBuild,

# Intentionally lowercase as tools.ps1 depends on it
[switch]$fromVMR,

# Capture the rest
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$MSBuildArguments
Expand Down Expand Up @@ -283,6 +289,7 @@ $MSBuildArguments += "/p:TargetArchitecture=$Architecture"
$MSBuildArguments += "/p:TargetOsName=win"

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

if (-not $Configuration) {
$Configuration = if ($CI) { 'Release' } else { 'Debug' }
Expand All @@ -299,6 +306,7 @@ if ($RuntimeSourceFeed -or $RuntimeSourceFeedKey) {
$ToolsetBuildArguments += $runtimeFeedKeyArg
}
if ($ProductBuild) { $ToolsetBuildArguments += "/p:DotNetBuild=$ProductBuild" }
if ($fromVMR) { $ToolsetBuildArguments += "/p:DotNetBuildFromVMR=$fromVMR" }

# Split build categories between dotnet msbuild and desktop msbuild. Use desktop msbuild as little as possible.
[string[]]$dotnetBuildArguments = ''
Expand Down
8 changes: 8 additions & 0 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ runtime_source_feed=''
runtime_source_feed_key=''
source_build=''
product_build=''
from_vmr=''
warn_as_error=true
from_vmr=''

if [ "$(uname)" = "Darwin" ]; then
target_os_name='osx'
Expand Down Expand Up @@ -94,6 +96,7 @@ Options:

--sourceBuild|-sb Build the repository in source-only mode.
--productBuild|-pb Build the repository in product-build mode.
--fromVMR Set when building from within the VMR.

Description:
This build script installs required tools and runs an MSBuild command on this repository
Expand Down Expand Up @@ -261,6 +264,9 @@ while [[ $# -gt 0 ]]; do
-productbuild|-product-build|-pb)
product_build=true
;;
-fromvmr|-from-vmr)
from_vmr=true
;;
-warnaserror)
shift
[ -z "${1:-}" ] && __error "Missing value for parameter --warnaserror" && __usage
Expand Down Expand Up @@ -325,6 +331,7 @@ fi
[ ! -z "$build_installers" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildInstallers=$build_installers"
[ ! -z "$product_build" ] && msbuild_args[${#msbuild_args[*]}]="-p:DotNetBuild=$product_build"
[ ! -z "$source_build" ] && msbuild_args[${#msbuild_args[*]}]="-p:DotNetBuildSourceOnly=$source_build"
[ ! -z "$from_vmr" ] && msbuild_args[${#msbuild_args[*]}]="-p:DotNetBuildFromVMR=$from_vmr"

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

# Initialize global variables need to be set before the import of Arcade is imported
restore=$run_restore
Expand Down
3 changes: 3 additions & 0 deletions eng/common/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Param(
[switch] $publish,
[switch] $clean,
[switch][Alias('pb')]$productBuild,
[switch]$fromVMR,
[switch][Alias('bl')]$binaryLog,
[switch][Alias('nobl')]$excludeCIBinarylog,
[switch] $ci,
Expand Down Expand Up @@ -74,6 +75,7 @@ function Print-Usage() {
Write-Host " -nativeToolsOnMachine Sets the native tools on machine environment variable (indicating that the script should use native tools on machine)"
Write-Host " -nodeReuse <value> Sets nodereuse msbuild parameter ('true' or 'false')"
Write-Host " -buildCheck Sets /check msbuild parameter"
Write-Host " -fromVMR Set when building from within the VMR"
Write-Host ""

Write-Host "Command line arguments not listed above are passed thru to msbuild."
Expand Down Expand Up @@ -128,6 +130,7 @@ function Build {
/p:Test=$test `
/p:Pack=$pack `
/p:DotNetBuild=$productBuild `
/p:DotNetBuildFromVMR=$fromVMR `
/p:IntegrationTest=$integrationTest `
/p:PerformanceTest=$performanceTest `
/p:Sign=$sign `
Expand Down
14 changes: 10 additions & 4 deletions eng/common/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ usage()
echo " --nodeReuse <value> Sets nodereuse msbuild parameter ('true' or 'false')"
echo " --warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
echo " --buildCheck <value> Sets /check msbuild parameter"
echo " --fromVMR Set when building from within the VMR"
echo ""
echo "Command line arguments not listed above are passed thru to msbuild."
echo "Arguments can also be passed in with a single hyphen."
Expand All @@ -64,6 +65,7 @@ restore=false
build=false
source_build=false
product_build=false
from_vmr=false
rebuild=false
test=false
integration_test=false
Expand All @@ -89,7 +91,7 @@ verbosity='minimal'
runtime_source_feed=''
runtime_source_feed_key=''

properties=''
properties=()
while [[ $# > 0 ]]; do
opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")"
case "$opt" in
Expand Down Expand Up @@ -142,6 +144,9 @@ while [[ $# > 0 ]]; do
restore=true
pack=true
;;
-fromvmr|-from-vmr)
from_vmr=true
;;
-test|-t)
test=true
;;
Expand Down Expand Up @@ -187,7 +192,7 @@ while [[ $# > 0 ]]; do
shift
;;
*)
properties="$properties $1"
properties+=("$1")
;;
esac

Expand Down Expand Up @@ -221,7 +226,7 @@ function Build {
InitializeCustomToolset

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

local bl=""
Expand All @@ -243,6 +248,7 @@ function Build {
/p:Build=$build \
/p:DotNetBuild=$product_build \
/p:DotNetBuildSourceOnly=$source_build \
/p:DotNetBuildFromVMR=$from_vmr \
/p:Rebuild=$rebuild \
/p:Test=$test \
/p:Pack=$pack \
Expand All @@ -251,7 +257,7 @@ function Build {
/p:Sign=$sign \
/p:Publish=$publish \
/p:RestoreStaticGraphEnableBinaryLogger=$binary_log \
$properties
${properties[@]+"${properties[@]}"}

ExitWithExitCode 0
}
Expand Down
3 changes: 0 additions & 3 deletions eng/common/core-templates/post-build/post-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,6 @@ stages:
buildId: $(AzDOBuildId)
artifactName: PackageArtifacts
checkDownloadedFiles: true
itemPattern: |
**
!**/Microsoft.SourceBuild.Intermediate.*.nupkg

# This is necessary whenever we want to publish/restore to an AzDO private feed
# Since sdk-task.ps1 tries to restore packages we need to do this authentication here
Expand Down
35 changes: 0 additions & 35 deletions eng/common/core-templates/steps/install-microbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,38 +48,3 @@ steps:
eq(variables['_SignType'], 'real')
)
))

# Workaround for ESRP CLI on Linux - https://github.com/dotnet/source-build/issues/4964
- ${{ if eq(parameters.enableMicrobuildForMacAndLinux, 'true') }}:
- task: UseDotNet@2
displayName: Install .NET 9.0 SDK for ESRP CLI Workaround
inputs:
packageType: sdk
version: 9.0.x
installationPath: ${{ parameters.microBuildOutputFolder }}/.dotnet
workingDirectory: ${{ parameters.microBuildOutputFolder }}
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))

- task: PowerShell@2
displayName: Workaround for ESRP CLI on Linux
inputs:
targetType: 'inline'
script: |
Write-Host "Copying Linux Path"
$MBSIGN_APPFOLDER = '$(MBSIGN_APPFOLDER)'
$MBSIGN_APPFOLDER = ($MBSIGN_APPFOLDER -replace '/build', '')

$versionRegex = '\d+\.\d+\.\d+'
$package = Get-ChildItem -Path $MBSIGN_APPFOLDER -Directory |
Where-Object { $_.Name -match $versionRegex }

if ($package.Count -ne 1) {
Write-Host "There should be exactly one matching subfolder, but found $($package.Count)."
exit 1
}

$MBSIGN_APPFOLDER = $package[0].FullName + '/build'
$MBSIGN_APPFOLDER | Write-Host
$SignConfigPath = $MBSIGN_APPFOLDER + '/signconfig.xml'
Copy-Item -Path "$(MBSIGN_APPFOLDER)/signconfig.xml" -Destination $SignConfigPath -Force
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
9 changes: 4 additions & 5 deletions eng/common/tools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ $ErrorActionPreference = 'Stop'
# Base-64 encoded SAS token that has permission to storage container described by $runtimeSourceFeed
[string]$runtimeSourceFeedKey = if (Test-Path variable:runtimeSourceFeedKey) { $runtimeSourceFeedKey } else { $null }

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

function Create-Directory ([string[]] $path) {
New-Item -Path $path -Force -ItemType 'Directory' | Out-Null
Expand Down Expand Up @@ -644,7 +644,6 @@ function GetNuGetPackageCachePath() {
$env:NUGET_PACKAGES = Join-Path $env:UserProfile '.nuget\packages\'
} else {
$env:NUGET_PACKAGES = Join-Path $RepoRoot '.packages\'
$env:RESTORENOHTTPCACHE = $true
}
}

Expand Down Expand Up @@ -850,8 +849,8 @@ function MSBuild-Core() {
}

# When running on Azure Pipelines, override the returned exit code to avoid double logging.
# Skip this when the build is a child of the VMR orchestrator build.
if ($ci -and $env:SYSTEM_TEAMPROJECT -ne $null -and !$productBuild) {
# Skip this when the build is a child of the VMR build.
if ($ci -and $env:SYSTEM_TEAMPROJECT -ne $null -and !$fromVMR) {
Write-PipelineSetResult -Result "Failed" -Message "msbuild execution failed."
# Exiting with an exit code causes the azure pipelines task to log yet another "noise" error
# The above Write-PipelineSetResult will cause the task to be marked as failure without adding yet another error
Expand Down
10 changes: 4 additions & 6 deletions eng/common/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ fi
runtime_source_feed=${runtime_source_feed:-''}
runtime_source_feed_key=${runtime_source_feed_key:-''}

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

# Resolve any symlinks in the given path.
function ResolvePath {
Expand Down Expand Up @@ -345,14 +345,12 @@ function InitializeBuildTool {
_InitializeBuildToolCommand="msbuild"
}

# Set RestoreNoHttpCache as a workaround for https://github.com/NuGet/Home/issues/3116
function GetNuGetPackageCachePath {
if [[ -z ${NUGET_PACKAGES:-} ]]; then
if [[ "$use_global_nuget_cache" == true ]]; then
export NUGET_PACKAGES="$HOME/.nuget/packages/"
else
export NUGET_PACKAGES="$repo_root/.packages/"
export RESTORENOHTTPCACHE=true
fi
fi

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

# When running on Azure Pipelines, override the returned exit code to avoid double logging.
# Skip this when the build is a child of the VMR orchestrator build.
if [[ "$ci" == true && -n ${SYSTEM_TEAMPROJECT:-} && "$product_build" != true ]]; then
# Skip this when the build is a child of the VMR build.
if [[ "$ci" == true && -n ${SYSTEM_TEAMPROJECT:-} && "$from_vmr" != true ]]; then
Write-PipelineSetResult -result "Failed" -message "msbuild execution failed."
# Exiting with an exit code causes the azure pipelines task to log yet another "noise" error
# The above Write-PipelineSetResult will cause the task to be marked as failure without adding yet another error
Expand Down
10 changes: 5 additions & 5 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"sdk": {
"version": "10.0.100-preview.4.25216.37"
"version": "10.0.100-preview.6.25272.112"
},
"tools": {
"dotnet": "10.0.100-preview.4.25216.37",
"dotnet": "10.0.100-preview.6.25272.112",
"runtimes": {
"dotnet/x86": [
"$(MicrosoftInternalRuntimeAspNetCoreTransportVersion)"
Expand All @@ -27,9 +27,9 @@
"jdk": "latest"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25270.108",
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25270.108",
"Microsoft.DotNet.SharedFramework.Sdk": "10.0.0-beta.25270.108",
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25277.102",
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25277.102",
"Microsoft.DotNet.SharedFramework.Sdk": "10.0.0-beta.25277.102",
"Microsoft.Build.NoTargets": "3.7.0",
"Microsoft.Build.Traversal": "3.4.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
<IncludeSymbols>false</IncludeSymbols>
<NoPackageAnalysis>true</NoPackageAnalysis>
<ExcludeFromSourceOnlyBuild>false</ExcludeFromSourceOnlyBuild>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Http/Http.Extensions/src/RequestDelegateFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,7 @@ private static Expression BindParameterFromService(ParameterInfo parameter, Requ
return Expression.Call(GetRequiredServiceMethod.MakeGenericMethod(parameter.ParameterType), RequestServicesExpr);
}

private static Expression BindParameterFromKeyedService(ParameterInfo parameter, object key, RequestDelegateFactoryContext factoryContext)
private static Expression BindParameterFromKeyedService(ParameterInfo parameter, object? key, RequestDelegateFactoryContext factoryContext)
{
var isOptional = IsOptionalParameter(parameter, factoryContext);

Expand Down
4 changes: 2 additions & 2 deletions src/SignalR/server/Core/src/Internal/HubMethodDescriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public HubMethodDescriptor(ObjectMethodExecutor methodExecutor, IServiceProvider
{
if (keyedServiceProvider.IsKeyedService(GetServiceType(p.ParameterType), keyedServicesAttribute.Key))
{
KeyedServiceKeys ??= new List<(int, object)>();
KeyedServiceKeys ??= new List<(int, object?)>();
KeyedServiceKeys.Add((index, keyedServicesAttribute.Key));
MarkServiceParameter(index);
}
Expand Down Expand Up @@ -158,7 +158,7 @@ private bool MarkServiceParameter(int index)

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

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

public ObjectMethodExecutor MethodExecutor { get; }

Expand Down
Loading