Skip to content

Commit fdcc71e

Browse files
Update dependencies from https://github.com/dotnet/arcade build 20250518.1 (#744)
[dev] Update dependencies from dotnet/arcade
1 parent 6f1b7c6 commit fdcc71e

File tree

10 files changed

+603
-25
lines changed

10 files changed

+603
-25
lines changed

eng/Version.Details.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@
7373
</Dependency>
7474
</ProductDependencies>
7575
<ToolsetDependencies>
76-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25259.2">
76+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25268.1">
7777
<Uri>https://github.com/dotnet/arcade</Uri>
78-
<Sha>80c4e4d26cb85c86f7e1be77d2d9eceeef0f3493</Sha>
78+
<Sha>35a34fa5ab9b2f97d3f7bdf48a7c2100727308b3</Sha>
7979
</Dependency>
80-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="10.0.0-beta.25259.2">
80+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="10.0.0-beta.25268.1">
8181
<Uri>https://github.com/dotnet/arcade</Uri>
82-
<Sha>80c4e4d26cb85c86f7e1be77d2d9eceeef0f3493</Sha>
82+
<Sha>35a34fa5ab9b2f97d3f7bdf48a7c2100727308b3</Sha>
8383
</Dependency>
8484
</ToolsetDependencies>
8585
</Dependencies>

eng/common/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ while [[ $# > 0 ]]; do
129129
-pack)
130130
pack=true
131131
;;
132-
-sourcebuild|-sb)
132+
-sourcebuild|-source-build|-sb)
133133
build=true
134134
source_build=true
135135
product_build=true
136136
restore=true
137137
pack=true
138138
;;
139-
-productbuild|-pb)
139+
-productbuild|-product-build|-pb)
140140
build=true
141141
product_build=true
142142
restore=true

eng/common/core-templates/steps/source-build.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,9 @@ steps:
3838
targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}'
3939
fi
4040
41-
runtimeOsArgs=
42-
if [ '${{ parameters.platform.runtimeOS }}' != '' ]; then
43-
runtimeOsArgs='/p:RuntimeOS=${{ parameters.platform.runtimeOS }}'
44-
fi
45-
46-
baseOsArgs=
47-
if [ '${{ parameters.platform.baseOS }}' != '' ]; then
48-
baseOsArgs='/p:BaseOS=${{ parameters.platform.baseOS }}'
41+
baseRidArgs=
42+
if [ '${{ parameters.platform.baseRID }}' != '' ]; then
43+
baseRidArgs='/p:BaseRid=${{ parameters.platform.baseRID }}'
4944
fi
5045
5146
portableBuildArgs=
@@ -56,14 +51,12 @@ steps:
5651
${{ coalesce(parameters.platform.buildScript, './build.sh') }} --ci \
5752
--configuration $buildConfig \
5853
--restore --build --pack -bl \
54+
--source-build \
5955
${{ parameters.platform.buildArguments }} \
6056
$internalRuntimeDownloadArgs \
6157
$targetRidArgs \
62-
$runtimeOsArgs \
63-
$baseOsArgs \
58+
$baseRidArgs \
6459
$portableBuildArgs \
65-
/p:DotNetBuildSourceOnly=true \
66-
/p:DotNetBuildRepo=true \
6760
displayName: Build
6861

6962
- template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
### These steps synchronize new code from product repositories into the VMR (https://github.com/dotnet/dotnet).
2+
### They initialize the darc CLI and pull the new updates.
3+
### Changes are applied locally onto the already cloned VMR (located in $vmrPath).
4+
5+
parameters:
6+
- name: targetRef
7+
displayName: Target revision in dotnet/<repo> to synchronize
8+
type: string
9+
default: $(Build.SourceVersion)
10+
11+
- name: vmrPath
12+
displayName: Path where the dotnet/dotnet is checked out to
13+
type: string
14+
default: $(Agent.BuildDirectory)/vmr
15+
16+
- name: additionalSyncs
17+
displayName: Optional list of package names whose repo's source will also be synchronized in the local VMR, e.g. NuGet.Protocol
18+
type: object
19+
default: []
20+
21+
steps:
22+
- checkout: vmr
23+
displayName: Clone dotnet/dotnet
24+
path: vmr
25+
clean: true
26+
27+
- checkout: self
28+
displayName: Clone $(Build.Repository.Name)
29+
path: repo
30+
fetchDepth: 0
31+
32+
# This step is needed so that when we get a detached HEAD / shallow clone,
33+
# we still pull the commit into the temporary repo clone to use it during the sync.
34+
# Also unshallow the clone so that forwardflow command would work.
35+
- script: |
36+
git branch repo-head
37+
git rev-parse HEAD
38+
displayName: Label PR commit
39+
workingDirectory: $(Agent.BuildDirectory)/repo
40+
41+
- script: |
42+
vmr_sha=$(grep -oP '(?<=Sha=")[^"]*' $(Agent.BuildDirectory)/repo/eng/Version.Details.xml)
43+
echo "##vso[task.setvariable variable=vmr_sha]$vmr_sha"
44+
displayName: Obtain the vmr sha from Version.Details.xml (Unix)
45+
condition: ne(variables['Agent.OS'], 'Windows_NT')
46+
workingDirectory: $(Agent.BuildDirectory)/repo
47+
48+
- powershell: |
49+
[xml]$xml = Get-Content -Path $(Agent.BuildDirectory)/repo/eng/Version.Details.xml
50+
$vmr_sha = $xml.SelectSingleNode("//Source").Sha
51+
Write-Output "##vso[task.setvariable variable=vmr_sha]$vmr_sha"
52+
displayName: Obtain the vmr sha from Version.Details.xml (Windows)
53+
condition: eq(variables['Agent.OS'], 'Windows_NT')
54+
workingDirectory: $(Agent.BuildDirectory)/repo
55+
56+
- script: |
57+
git fetch --all
58+
git checkout $(vmr_sha)
59+
displayName: Checkout VMR at correct sha for repo flow
60+
workingDirectory: ${{ parameters.vmrPath }}
61+
62+
- script: |
63+
git config --global user.name "dotnet-maestro[bot]"
64+
git config --global user.email "dotnet-maestro[bot]@users.noreply.github.com"
65+
displayName: Set git author to dotnet-maestro[bot]
66+
workingDirectory: ${{ parameters.vmrPath }}
67+
68+
- script: |
69+
./eng/common/vmr-sync.sh \
70+
--vmr ${{ parameters.vmrPath }} \
71+
--tmp $(Agent.TempDirectory) \
72+
--azdev-pat '$(dn-bot-all-orgs-code-r)' \
73+
--ci \
74+
--debug
75+
76+
if [ "$?" -ne 0 ]; then
77+
echo "##vso[task.logissue type=error]Failed to synchronize the VMR"
78+
exit 1
79+
fi
80+
displayName: Sync repo into VMR (Unix)
81+
condition: ne(variables['Agent.OS'], 'Windows_NT')
82+
workingDirectory: $(Agent.BuildDirectory)/repo
83+
84+
- script: |
85+
git config --global diff.astextplain.textconv echo
86+
git config --system core.longpaths true
87+
displayName: Configure Windows git (longpaths, astextplain)
88+
condition: eq(variables['Agent.OS'], 'Windows_NT')
89+
90+
- powershell: |
91+
./eng/common/vmr-sync.ps1 `
92+
-vmr ${{ parameters.vmrPath }} `
93+
-tmp $(Agent.TempDirectory) `
94+
-azdevPat '$(dn-bot-all-orgs-code-r)' `
95+
-ci `
96+
-debugOutput
97+
98+
if ($LASTEXITCODE -ne 0) {
99+
echo "##vso[task.logissue type=error]Failed to synchronize the VMR"
100+
exit 1
101+
}
102+
displayName: Sync repo into VMR (Windows)
103+
condition: eq(variables['Agent.OS'], 'Windows_NT')
104+
workingDirectory: $(Agent.BuildDirectory)/repo
105+
106+
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
107+
- task: CopyFiles@2
108+
displayName: Collect failed patches
109+
condition: failed()
110+
inputs:
111+
SourceFolder: '$(Agent.TempDirectory)'
112+
Contents: '*.patch'
113+
TargetFolder: '$(Build.ArtifactStagingDirectory)/FailedPatches'
114+
115+
- publish: '$(Build.ArtifactStagingDirectory)/FailedPatches'
116+
artifact: $(System.JobDisplayName)_FailedPatches
117+
displayName: Upload failed patches
118+
condition: failed()
119+
120+
- ${{ each assetName in parameters.additionalSyncs }}:
121+
# The vmr-sync script ends up staging files in the local VMR so we have to commit those
122+
- script:
123+
git commit --allow-empty -am "Forward-flow $(Build.Repository.Name)"
124+
displayName: Commit local VMR changes
125+
workingDirectory: ${{ parameters.vmrPath }}
126+
127+
- script: |
128+
set -ex
129+
130+
echo "Searching for details of asset ${{ assetName }}..."
131+
132+
# Use darc to get dependencies information
133+
dependencies=$(./.dotnet/dotnet darc get-dependencies --name '${{ assetName }}' --ci)
134+
135+
# Extract repository URL and commit hash
136+
repository=$(echo "$dependencies" | grep 'Repo:' | sed 's/Repo:[[:space:]]*//' | head -1)
137+
138+
if [ -z "$repository" ]; then
139+
echo "##vso[task.logissue type=error]Asset ${{ assetName }} not found in the dependency list"
140+
exit 1
141+
fi
142+
143+
commit=$(echo "$dependencies" | grep 'Commit:' | sed 's/Commit:[[:space:]]*//' | head -1)
144+
145+
echo "Updating the VMR from $repository / $commit..."
146+
cd ..
147+
git clone $repository ${{ assetName }}
148+
cd ${{ assetName }}
149+
git checkout $commit
150+
git branch "sync/$commit"
151+
152+
./eng/common/vmr-sync.sh \
153+
--vmr ${{ parameters.vmrPath }} \
154+
--tmp $(Agent.TempDirectory) \
155+
--azdev-pat '$(dn-bot-all-orgs-code-r)' \
156+
--ci \
157+
--debug
158+
159+
if [ "$?" -ne 0 ]; then
160+
echo "##vso[task.logissue type=error]Failed to synchronize the VMR"
161+
exit 1
162+
fi
163+
displayName: Sync ${{ assetName }} into (Unix)
164+
condition: ne(variables['Agent.OS'], 'Windows_NT')
165+
workingDirectory: $(Agent.BuildDirectory)/repo
166+
167+
- powershell: |
168+
$ErrorActionPreference = 'Stop'
169+
170+
Write-Host "Searching for details of asset ${{ assetName }}..."
171+
172+
$dependencies = .\.dotnet\dotnet darc get-dependencies --name '${{ assetName }}' --ci
173+
174+
$repository = $dependencies | Select-String -Pattern 'Repo:\s+([^\s]+)' | Select-Object -First 1
175+
$repository -match 'Repo:\s+([^\s]+)' | Out-Null
176+
$repository = $matches[1]
177+
178+
if ($repository -eq $null) {
179+
Write-Error "Asset ${{ assetName }} not found in the dependency list"
180+
exit 1
181+
}
182+
183+
$commit = $dependencies | Select-String -Pattern 'Commit:\s+([^\s]+)' | Select-Object -First 1
184+
$commit -match 'Commit:\s+([^\s]+)' | Out-Null
185+
$commit = $matches[1]
186+
187+
Write-Host "Updating the VMR from $repository / $commit..."
188+
cd ..
189+
git clone $repository ${{ assetName }}
190+
cd ${{ assetName }}
191+
git checkout $commit
192+
git branch "sync/$commit"
193+
194+
.\eng\common\vmr-sync.ps1 `
195+
-vmr ${{ parameters.vmrPath }} `
196+
-tmp $(Agent.TempDirectory) `
197+
-azdevPat '$(dn-bot-all-orgs-code-r)' `
198+
-ci `
199+
-debugOutput
200+
201+
if ($LASTEXITCODE -ne 0) {
202+
echo "##vso[task.logissue type=error]Failed to synchronize the VMR"
203+
exit 1
204+
}
205+
displayName: Sync ${{ assetName }} into (Windows)
206+
condition: ne(variables['Agent.OS'], 'Windows_NT')
207+
workingDirectory: $(Agent.BuildDirectory)/repo

eng/common/templates/vmr-build-pr.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
trigger: none
2+
pr:
3+
branches:
4+
include:
5+
- main
6+
- release/*
7+
paths:
8+
exclude:
9+
- documentation/*
10+
- README.md
11+
- CODEOWNERS
12+
13+
variables:
14+
- template: /eng/common/templates/variables/pool-providers.yml@self
15+
16+
- name: skipComponentGovernanceDetection # we run CG on internal builds only
17+
value: true
18+
19+
- name: Codeql.Enabled # we run CodeQL on internal builds only
20+
value: false
21+
22+
resources:
23+
repositories:
24+
- repository: vmr
25+
type: github
26+
name: dotnet/dotnet
27+
endpoint: dotnet
28+
29+
stages:
30+
- template: /eng/pipelines/templates/stages/vmr-build.yml@vmr
31+
parameters:
32+
isBuiltFromVmr: false
33+
scope: lite

eng/common/tools.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ $ErrorActionPreference = 'Stop'
6868
# True if the build is a product build
6969
[bool]$productBuild = if (Test-Path variable:productBuild) { $productBuild } else { $false }
7070

71-
[String[]]$properties = if (Test-Path variable:properties) { $properties } else { @() }
72-
7371
function Create-Directory ([string[]] $path) {
7472
New-Item -Path $path -Force -ItemType 'Directory' | Out-Null
7573
}
@@ -853,7 +851,7 @@ function MSBuild-Core() {
853851

854852
# When running on Azure Pipelines, override the returned exit code to avoid double logging.
855853
# Skip this when the build is a child of the VMR orchestrator build.
856-
if ($ci -and $env:SYSTEM_TEAMPROJECT -ne $null -and !$productBuild -and -not($properties -like "*DotNetBuildRepo=true*")) {
854+
if ($ci -and $env:SYSTEM_TEAMPROJECT -ne $null -and !$productBuild) {
857855
Write-PipelineSetResult -Result "Failed" -Message "msbuild execution failed."
858856
# Exiting with an exit code causes the azure pipelines task to log yet another "noise" error
859857
# The above Write-PipelineSetResult will cause the task to be marked as failure without adding yet another error

eng/common/tools.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
# CI mode - set to true on CI server for PR validation build or official build.
66
ci=${ci:-false}
77

8+
# Build mode
9+
source_build=${source_build:-false}
10+
811
# Set to true to use the pipelines logger which will enable Azure logging output.
912
# https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md
1013
# This flag is meant as a temporary opt-opt for the feature while validate it across
@@ -58,7 +61,8 @@ use_installed_dotnet_cli=${use_installed_dotnet_cli:-true}
5861
dotnetInstallScriptVersion=${dotnetInstallScriptVersion:-'v1'}
5962

6063
# True to use global NuGet cache instead of restoring packages to repository-local directory.
61-
if [[ "$ci" == true ]]; then
64+
# Keep in sync with NuGetPackageroot in Arcade SDK's RepositoryLayout.props.
65+
if [[ "$ci" == true || "$source_build" == true ]]; then
6266
use_global_nuget_cache=${use_global_nuget_cache:-false}
6367
else
6468
use_global_nuget_cache=${use_global_nuget_cache:-true}
@@ -503,7 +507,7 @@ function MSBuild-Core {
503507

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

0 commit comments

Comments
 (0)