Skip to content

[dev] Source code updates from dotnet/dotnet #6702

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

Merged
merged 3 commits into from
Aug 14, 2025
Merged
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
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<SystemMemoryPackageVersion Condition="'$(SystemMemoryPackageVersion)' == ''">4.6.3</SystemMemoryPackageVersion>
<SystemSecurityCryptographyPkcsVersion Condition="'$(SystemSecurityCryptographyPkcsVersion)' == ''">9.0.6</SystemSecurityCryptographyPkcsVersion>
<SystemSecurityCryptographyProtectedDataVersion Condition="'$(SystemSecurityCryptographyProtectedDataVersion)' == ''">9.0.6</SystemSecurityCryptographyProtectedDataVersion>
<MicrosoftDotNetXliffTasksVersion Condition="'$(MicrosoftDotNetXliffTasksVersion)' == ''">10.0.0-beta.25260.104</MicrosoftDotNetXliffTasksVersion>
</PropertyGroup>

<ItemGroup>
Expand All @@ -50,7 +51,7 @@
<PackageVersion Include="Microsoft.DataAI.NuGetRecommender.Contracts" Version="2.1.0" />
<PackageVersion Include="Microsoft.DotNet.Build.Tasks.Feed" Version="10.0.0-beta.25401.1" />
<PackageVersion Include="Microsoft.DotNet.Maestro.Tasks" Version="1.1.0-beta.24415.2" />
<PackageVersion Include="Microsoft.DotNet.XliffTasks" Version="10.0.0-beta.25260.104" />
<PackageVersion Include="Microsoft.DotNet.XliffTasks" Version="$(MicrosoftDotNetXliffTasksVersion)" />
<PackageVersion Include="Microsoft.DotNet.SignTool" Version="10.0.0-beta.25367.5" />
<PackageVersion Include="Microsoft.Extensions.CommandLineUtils.Sources" Version="3.0.0-preview6.19253.5" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Abstractions" Version="$(MicrosoftExtensionsFileProvidersAbstractionsPackageVersion)" />
Expand Down
2 changes: 2 additions & 0 deletions build/config.props
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
<!--Setting the Pre-release/Build meta-data from CI if Version is set-->
<PropertyGroup Condition="'$(BuildNumber)' != ''">
<PreReleaseVersion>$(BuildNumber)</PreReleaseVersion>
<!-- Add 500 to the revision number to avoid clashing with the existing msft official build. -->
<PreReleaseVersion Condition="'$(DotNetBuildFromVMR)' == 'true'">$([MSBuild]::Add($(BuildNumber), 500))</PreReleaseVersion>
</PropertyGroup>

<!--Setting the product information for Beta builds-->
Expand Down
3 changes: 1 addition & 2 deletions build/sign.targets
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
</PropertyGroup>

<PropertyGroup Condition="'$(SignWithNuGetKey)' == 'true' Or '$(SignWithMicrosoftKey)' == 'true'">
<DelaySign Condition="'$(IsXplat)' != 'true'">true</DelaySign>
<PublicSign Condition="'$(IsXplat)' == 'true'">true</PublicSign>
<PublicSign>true</PublicSign>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion eng/Version.Details.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ This file should be imported by eng/Versions.props
<!-- dotnet/corefx dependencies -->
<SystemComponentModelCompositionPackageVersion>4.5.0</SystemComponentModelCompositionPackageVersion>
<!-- dotnet/dotnet dependencies -->
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.25401.103</MicrosoftDotNetArcadeSdkPackageVersion>
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.25409.103</MicrosoftDotNetArcadeSdkPackageVersion>
<MicrosoftDotNetXliffTasksPackageVersion>10.0.0-beta.25409.103</MicrosoftDotNetXliffTasksPackageVersion>
</PropertyGroup>
<!--Property group for alternate package version names-->
<PropertyGroup>
Expand All @@ -43,5 +44,6 @@ This file should be imported by eng/Versions.props
<SystemComponentModelCompositionVersion>$(SystemComponentModelCompositionPackageVersion)</SystemComponentModelCompositionVersion>
<!-- dotnet/dotnet dependencies -->
<MicrosoftDotNetArcadeSdkVersion>$(MicrosoftDotNetArcadeSdkPackageVersion)</MicrosoftDotNetArcadeSdkVersion>
<MicrosoftDotNetXliffTasksVersion>$(MicrosoftDotNetXliffTasksPackageVersion)</MicrosoftDotNetXliffTasksVersion>
</PropertyGroup>
</Project>
10 changes: 7 additions & 3 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<Source Uri="https://github.com/dotnet/dotnet" Mapping="nuget-client" Sha="8b29a1682219da555ee27e4fdda55dc3884b316f" BarId="277635" />
<Source Uri="https://github.com/dotnet/dotnet" Mapping="nuget-client" Sha="e9f665e52848a3615736c099e5631af531b66a5c" BarId="278626" />
<!--
Currently this file is required to publish builds to .NET build asset registry.
See https://github.com/dotnet/arcade/issues/2396 for details.
Expand Down Expand Up @@ -56,9 +56,13 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25401.103">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25409.103">
<Uri>https://github.com/dotnet/dotnet</Uri>
<Sha>8b29a1682219da555ee27e4fdda55dc3884b316f</Sha>
<Sha>e9f665e52848a3615736c099e5631af531b66a5c</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="10.0.0-beta.25409.103">
<Uri>https://github.com/dotnet/dotnet</Uri>
<Sha>e9f665e52848a3615736c099e5631af531b66a5c</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
13 changes: 13 additions & 0 deletions eng/common/tools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,20 @@ function Retry($downloadBlock, $maxRetries = 5) {

function GetDotNetInstallScript([string] $dotnetRoot) {
$installScript = Join-Path $dotnetRoot 'dotnet-install.ps1'
$shouldDownload = $false

if (!(Test-Path $installScript)) {
$shouldDownload = $true
} else {
# Check if the script is older than 30 days
$fileAge = (Get-Date) - (Get-Item $installScript).LastWriteTime
if ($fileAge.Days -gt 30) {
Write-Host "Existing install script is too old, re-downloading..."
$shouldDownload = $true
}
}

if ($shouldDownload) {
Create-Directory $dotnetRoot
$ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit
$uri = "https://builds.dotnet.microsoft.com/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.ps1"
Expand Down
24 changes: 24 additions & 0 deletions eng/common/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,29 @@ function GetDotNetInstallScript {
local root=$1
local install_script="$root/dotnet-install.sh"
local install_script_url="https://builds.dotnet.microsoft.com/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.sh"
local timestamp_file="$root/.dotnet-install.timestamp"
local should_download=false

if [[ ! -a "$install_script" ]]; then
should_download=true
elif [[ -f "$timestamp_file" ]]; then
# Check if the script is older than 30 days using timestamp file
local download_time=$(cat "$timestamp_file" 2>/dev/null || echo "0")
local current_time=$(date +%s)
local age_seconds=$((current_time - download_time))

# 30 days = 30 * 24 * 60 * 60 = 2592000 seconds
if [[ $age_seconds -gt 2592000 ]]; then
echo "Existing install script is too old, re-downloading..."
should_download=true
fi
else
# No timestamp file exists, assume script is old and re-download
echo "No timestamp found for existing install script, re-downloading..."
should_download=true
fi

if [[ "$should_download" == true ]]; then
mkdir -p "$root"

echo "Downloading '$install_script_url'"
Expand All @@ -328,6 +349,9 @@ function GetDotNetInstallScript {
ExitWithExitCode $exit_code
}
fi

# Create timestamp file to track download time in seconds from epoch
date +%s > "$timestamp_file"
fi
# return value
_GetDotNetInstallScript="$install_script"
Expand Down
3 changes: 1 addition & 2 deletions eng/dotnet-build/build.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
@echo off
powershell -NoLogo -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0build.ps1"""%*"
exit /b %ErrorLevel%
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0build.ps1""" %*"
93 changes: 27 additions & 66 deletions eng/dotnet-build/build.ps1
Original file line number Diff line number Diff line change
@@ -1,86 +1,47 @@

# The VMR orchestrator passes a number of stnadar
[CmdletBinding(PositionalBinding=$false)]
param (
[string][Alias('c')]$configuration = "Release",
[string][Alias('v')]$verbosity = "minimal",
[switch]$ci,
[switch]$prepareMachine,
[string]$msbuildEngine = $null,
[switch][Alias('bl')]$binaryLog,
[switch][Alias('nobl')]$excludeCIBinarylog,
[switch][Alias('pb')]$productBuild,
[switch]$fromVMR,
[bool]$warnAsError = $true,
[bool]$nodeReuse = $true,
[Parameter(ValueFromRemainingArguments = $true)][string[]]$properties
)

# This will exec a process using the console and return it's exit code.
# This will not throw when the process fails.
# Returns process exit code.
function Exec-Process([string]$command, [string]$commandArgs) {
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = $command
$startInfo.Arguments = $commandArgs
Write-Host $command
WRite-Host $commandArgs
$startInfo.UseShellExecute = $false
$startInfo.WorkingDirectory = Get-Location

$process = New-Object System.Diagnostics.Process
$process.StartInfo = $startInfo
$process.Start() | Out-Null

$finished = $false
try {
while (-not $process.WaitForExit(100)) {
# Non-blocking loop done to allow ctr-c interrupts
}

$finished = $true
return $global:LASTEXITCODE = $process.ExitCode
}
finally {
# If we didn't finish then an error occurred or the user hit ctrl-c. Either
# way kill the process
if (-not $finished) {
$process.Kill()
}
}
}

$dotnet = Join-Path $env:DOTNET_PATH dotnet.exe
$repoRoot = Resolve-Path "$PSScriptRoot/../../"
$nugetPackagesRoot = Join-Path $repoRoot "artifacts/.packages/"

# Environment variables
$env:NUGET_PACKAGES=$nugetPackagesRoot
. $PSScriptRoot\..\common\tools.ps1

# MSBuild arguments
$dotnetArguments = @()
$dotnetArguments += "$PSScriptRoot/dotnet-build.proj"
$dotnetArguments += "/p:RepoRoot=$repoRoot"
$dotnetArguments += "/p:Configuration=$configuration"
$dotnetArguments += "/p:DotNetBuild=$productBuild"
$dotnetArguments += "/p:DotNetBuildFromVMR=$fromVMR"
function Build {
$bl = if ($binaryLog) { '/bl:' + (Join-Path $LogDir 'Build.binlog') } else { '' }

$bl = if ($binaryLog) { "/bl:" + (Join-Path $repoRoot "artifacts/log/$configuration/Build.binlog") } else { '' }
if ($ci) {
$nodeReuse = $false
}

$cmdArgs = "$dotnet msbuild /m /nologo /clp:Summary /v:$verbosity /nr:$nodeReuse /p:ContinuousIntegrationBuild=$ci"

if ($warnAsError) {
$cmdArgs += ' /warnaserror /p:TreatWarningsAsErrors=true'
}
else {
$cmdArgs += ' /p:TreatWarningsAsErrors=false'
MSBuild "$PSScriptRoot\dotnet-build.proj" `
$bl `
/p:Configuration=$configuration `
/p:RepoRoot=$RepoRoot `
/p:DotNetBuild=$productBuild `
/p:DotNetBuildFromVMR=$fromVMR `
@properties
}

try {
$exitCode = Exec-Process $cmdArgs $bl "$dotnetArguments" "$properties"
if ($exitCode -ne 0) {
exit $exitCode
if ($ci) {
if (-not $excludeCIBinarylog) {
$binaryLog = $true
}
$nodeReuse = $false
}

Build
}
catch {
exit 1
}
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_
ExitWithExitCode 1
}

ExitWithExitCode 0
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"pinned": true
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25401.103",
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25409.103",
"Microsoft.Build.NoTargets": "3.7.0"
}
}
Loading