Skip to content

Commit c63f4fd

Browse files
[release/10.0.1xx] Source code updates from dotnet/templating (#5077)
[release/10.0.1xx] Source code updates from dotnet/templating
1 parent 7cf63a7 commit c63f4fd

12 files changed

Lines changed: 81 additions & 45 deletions

File tree

src/source-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@
115115
"commitSha": "1536a1ca256a4e9f804b2073464ca8e4f4794702"
116116
},
117117
{
118-
"barId": 303106,
118+
"barId": 304823,
119119
"path": "templating",
120120
"remoteUri": "https://github.com/dotnet/templating",
121-
"commitSha": "b8604f8fecffff62bfcc1854bf8a71fa1f4ab4bf"
121+
"commitSha": "036e5537d7008a6b32c0798256f06f95cec85bfb"
122122
},
123123
{
124124
"barId": 303333,

src/templating/NuGet.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<clear />
55
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
66
<!-- Begin: Package sources from dotnet-dotnet -->
7-
<add key="darc-pub-dotnet-dotnet-c062731" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-dotnet-c062731b/nuget/v3/index.json" />
7+
<add key="darc-pub-dotnet-dotnet-ad9d20e" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-dotnet-ad9d20e2/nuget/v3/index.json" />
88
<!-- End: Package sources from dotnet-dotnet -->
99
<!-- Begin: Package sources from dotnet-runtime -->
1010
<!-- End: Package sources from dotnet-runtime -->

src/templating/eng/Version.Details.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This file should be imported by eng/Versions.props
66
<Project>
77
<PropertyGroup>
88
<!-- dotnet/dotnet dependencies -->
9-
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.26123.105</MicrosoftDotNetArcadeSdkPackageVersion>
10-
<SystemCommandLinePackageVersion>2.0.5</SystemCommandLinePackageVersion>
9+
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.26154.121</MicrosoftDotNetArcadeSdkPackageVersion>
10+
<SystemCommandLinePackageVersion>2.0.6</SystemCommandLinePackageVersion>
1111
<!-- _git/dotnet-runtime dependencies -->
1212
<MicrosoftBclAsyncInterfacesPackageVersion>10.0.1</MicrosoftBclAsyncInterfacesPackageVersion>
1313
<MicrosoftExtensionsLoggingPackageVersion>10.0.1</MicrosoftExtensionsLoggingPackageVersion>

src/templating/eng/Version.Details.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Dependencies>
3-
<Source Uri="https://github.com/dotnet/dotnet" Mapping="templating" Sha="c062731b2949ba96a396c221b3978fcb0a1decd0" BarId="303025" />
3+
<Source Uri="https://github.com/dotnet/dotnet" Mapping="templating" Sha="ad9d20e277eeb15c64dabb9a0a433af684f21dd1" BarId="304701" />
44
<ProductDependencies>
5-
<Dependency Name="System.CommandLine" Version="2.0.5">
5+
<Dependency Name="System.CommandLine" Version="2.0.6">
66
<Uri>https://github.com/dotnet/dotnet</Uri>
7-
<Sha>c062731b2949ba96a396c221b3978fcb0a1decd0</Sha>
7+
<Sha>ad9d20e277eeb15c64dabb9a0a433af684f21dd1</Sha>
88
</Dependency>
99
</ProductDependencies>
1010
<ToolsetDependencies>
11-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.26123.105">
11+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.26154.121">
1212
<Uri>https://github.com/dotnet/dotnet</Uri>
13-
<Sha>c062731b2949ba96a396c221b3978fcb0a1decd0</Sha>
13+
<Sha>ad9d20e277eeb15c64dabb9a0a433af684f21dd1</Sha>
1414
</Dependency>
1515
<!-- Dependencies required for source build. We'll still update manually -->
1616
<Dependency Name="System.Formats.Asn1" Version="10.0.1">

src/templating/eng/common/core-templates/steps/publish-logs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ steps:
3131
-runtimeSourceFeed https://ci.dot.net/internal
3232
-runtimeSourceFeedKey '$(dotnetbuilds-internal-container-read-token-base64)'
3333
'$(publishing-dnceng-devdiv-code-r-build-re)'
34-
'$(MaestroAccessToken)'
3534
'$(dn-bot-all-orgs-artifact-feeds-rw)'
3635
'$(akams-client-id)'
3736
'$(microsoft-symbol-server-pat)'

src/templating/eng/common/templates/steps/vmr-sync.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,6 @@ steps:
3838
displayName: Label PR commit
3939
workingDirectory: $(Agent.BuildDirectory)/repo
4040

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-
6241
- script: |
6342
git config --global user.name "dotnet-maestro[bot]"
6443
git config --global user.email "dotnet-maestro[bot]@users.noreply.github.com"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ resources:
3434
type: github
3535
name: dotnet/dotnet
3636
endpoint: dotnet
37+
ref: refs/heads/main # Set to whatever VMR branch the PR build should insert into
3738

3839
stages:
3940
- template: /eng/pipelines/templates/stages/vmr-build.yml@vmr

src/templating/eng/common/tools.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,11 @@ function MSBuild-Core() {
824824

825825
$cmdArgs = "$($buildTool.Command) /m /nologo /clp:Summary /v:$verbosity /nr:$nodeReuse /p:ContinuousIntegrationBuild=$ci"
826826

827+
# Add -mt flag for MSBuild multithreaded mode if enabled via environment variable
828+
if ($env:MSBUILD_MT_ENABLED -eq "1") {
829+
$cmdArgs += ' -mt'
830+
}
831+
827832
if ($warnAsError) {
828833
$cmdArgs += ' /warnaserror /p:TreatWarningsAsErrors=true'
829834
}

src/templating/eng/common/tools.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,13 @@ function MSBuild-Core {
526526
}
527527
}
528528

529-
RunBuildTool "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci "$@"
529+
# Add -mt flag for MSBuild multithreaded mode if enabled via environment variable
530+
local mt_switch=""
531+
if [[ "${MSBUILD_MT_ENABLED:-}" == "1" ]]; then
532+
mt_switch="-mt"
533+
fi
534+
535+
RunBuildTool "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch $mt_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci "$@"
530536
}
531537

532538
function GetDarc {

src/templating/eng/common/vmr-sync.ps1

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,20 @@ Set-StrictMode -Version Latest
103103
Highlight 'Installing .NET, preparing the tooling..'
104104
. .\eng\common\tools.ps1
105105
$dotnetRoot = InitializeDotNetCli -install:$true
106+
$env:DOTNET_ROOT = $dotnetRoot
106107
$darc = Get-Darc
107-
$dotnet = "$dotnetRoot\dotnet.exe"
108108

109109
Highlight "Starting the synchronization of VMR.."
110110

111111
# Synchronize the VMR
112+
$versionDetailsPath = Resolve-Path (Join-Path $PSScriptRoot '..\Version.Details.xml') | Select-Object -ExpandProperty Path
113+
[xml]$versionDetails = Get-Content -Path $versionDetailsPath
114+
$repoName = $versionDetails.SelectSingleNode('//Source').Mapping
115+
if (-not $repoName) {
116+
Fail "Failed to resolve repo mapping from $versionDetailsPath"
117+
exit 1
118+
}
119+
112120
$darcArgs = (
113121
"vmr", "forwardflow",
114122
"--tmp", $tmpDir,
@@ -130,9 +138,27 @@ if ($LASTEXITCODE -eq 0) {
130138
Highlight "Synchronization succeeded"
131139
}
132140
else {
133-
Fail "Synchronization of repo to VMR failed!"
134-
Fail "'$vmrDir' is left in its last state (re-run of this script will reset it)."
135-
Fail "Please inspect the logs which contain path to the failing patch file (use -debugOutput to get all the details)."
136-
Fail "Once you make changes to the conflicting VMR patch, commit it locally and re-run this script."
137-
exit 1
141+
Highlight "Failed to flow code into the local VMR. Falling back to resetting the VMR to match repo contents..."
142+
git -C $vmrDir reset --hard
143+
144+
$resetArgs = (
145+
"vmr", "reset",
146+
"${repoName}:HEAD",
147+
"--vmr", $vmrDir,
148+
"--tmp", $tmpDir,
149+
"--additional-remotes", "${repoName}:${repoRoot}"
150+
)
151+
152+
& "$darc" $resetArgs
153+
154+
if ($LASTEXITCODE -eq 0) {
155+
Highlight "Successfully reset the VMR using 'darc vmr reset'"
156+
}
157+
else {
158+
Fail "Synchronization of repo to VMR failed!"
159+
Fail "'$vmrDir' is left in its last state (re-run of this script will reset it)."
160+
Fail "Please inspect the logs which contain path to the failing patch file (use -debugOutput to get all the details)."
161+
Fail "Once you make changes to the conflicting VMR patch, commit it locally and re-run this script."
162+
exit 1
163+
}
138164
}

0 commit comments

Comments
 (0)