Skip to content

Commit 0dfda3e

Browse files
On relative base path root Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.26272.4 -> To Version 11.0.0-beta.26279.5 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
1 parent 3d77251 commit 0dfda3e

8 files changed

Lines changed: 261 additions & 7 deletions

File tree

‎eng/Version.Details.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<ProductDependencies>
44
</ProductDependencies>
55
<ToolsetDependencies>
6-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="11.0.0-beta.26272.4">
6+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="11.0.0-beta.26279.5">
77
<Uri>https://github.com/dotnet/arcade</Uri>
8-
<Sha>106da9762cd30768ee7cc944510daf476570a619</Sha>
8+
<Sha>2bc908b1bdb34e2c42982eb511679bb458ddac2c</Sha>
99
</Dependency>
1010
</ToolsetDependencies>
1111
</Dependencies>

‎eng/common/build.ps1‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Param(
2424
[switch][Alias('pb')]$productBuild,
2525
[switch]$fromVMR,
2626
[switch][Alias('bl')]$binaryLog,
27+
[string][Alias('bln')]$binaryLogName = '',
2728
[switch][Alias('nobl')]$excludeCIBinarylog,
2829
[switch] $ci,
2930
[switch] $prepareMachine,
@@ -46,6 +47,7 @@ function Print-Usage() {
4647
Write-Host " -platform <value> Platform configuration: 'x86', 'x64' or any valid Platform value to pass to msbuild"
4748
Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
4849
Write-Host " -binaryLog Output binary log (short: -bl)"
50+
Write-Host " -binaryLogName <value> Binary log file name or path; implies -binaryLog (short: -bln)"
4951
Write-Host " -help Print help and exit"
5052
Write-Host ""
5153

@@ -102,7 +104,19 @@ function Build {
102104
$toolsetBuildProj = InitializeToolset
103105
InitializeCustomToolset
104106

105-
$bl = if ($binaryLog) { '/bl:' + (Join-Path $LogDir 'Build.binlog') } else { '' }
107+
$bl = ''
108+
if ($binaryLog) {
109+
$binaryLogPath = if ([string]::IsNullOrEmpty($binaryLogName)) {
110+
Join-Path $LogDir 'Build.binlog'
111+
} elseif ([System.IO.Path]::IsPathRooted($binaryLogName)) {
112+
$binaryLogName
113+
} else {
114+
Join-Path $LogDir $binaryLogName
115+
}
116+
117+
Create-Directory (Split-Path -Parent $binaryLogPath)
118+
$bl = '/bl:' + $binaryLogPath
119+
}
106120
$platformArg = if ($platform) { "/p:Platform=$platform" } else { '' }
107121
$check = if ($buildCheck) { '/check' } else { '' }
108122

@@ -162,6 +176,10 @@ try {
162176
$nodeReuse = $false
163177
}
164178

179+
if (-not [string]::IsNullOrEmpty($binaryLogName)) {
180+
$binaryLog = $true
181+
}
182+
165183
if ($nativeToolsOnMachine) {
166184
$env:NativeToolsOnMachine = $true
167185
}

‎eng/common/build.sh‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ usage()
1313
echo " --configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
1414
echo " --verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
1515
echo " --binaryLog Create MSBuild binary log (short: -bl)"
16+
echo " --binaryLogName <value> Binary log file name or path; implies --binaryLog (short: -bln)"
1617
echo " --help Print help and exit (short: -h)"
1718
echo ""
1819

@@ -83,6 +84,7 @@ warn_not_as_error=''
8384
node_reuse=true
8485
build_check=false
8586
binary_log=false
87+
binary_log_name=''
8688
exclude_ci_binary_log=false
8789

8890
projects=''
@@ -114,6 +116,11 @@ while [[ $# -gt 0 ]]; do
114116
-binarylog|-bl)
115117
binary_log=true
116118
;;
119+
-binarylogname|-bln)
120+
binary_log=true
121+
binary_log_name=$2
122+
shift
123+
;;
117124
-excludecibinarylog|-nobl)
118125
exclude_ci_binary_log=true
119126
;;
@@ -232,7 +239,17 @@ function Build {
232239

233240
local bl=""
234241
if [[ "$binary_log" == true ]]; then
235-
bl="/bl:\"$log_dir/Build.binlog\""
242+
local binary_log_path=""
243+
if [[ -z "$binary_log_name" ]]; then
244+
binary_log_path="$log_dir/Build.binlog"
245+
elif [[ "$binary_log_name" = /* ]]; then
246+
binary_log_path="$binary_log_name"
247+
else
248+
binary_log_path="$log_dir/$binary_log_name"
249+
fi
250+
251+
mkdir -p "$(dirname "$binary_log_path")"
252+
bl="/bl:\"$binary_log_path\""
236253
fi
237254

238255
local check=""
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
parameters:
2+
# Maximum run time of the monitor job in minutes. Also used for --max-wait-minutes.
3+
- name: timeoutInMinutes
4+
type: number
5+
default: 360
6+
7+
# Owner segment of the source repository (e.g. 'dotnet' for 'dotnet/runtime') passed via --organization.
8+
# Defaults to the owner segment of BUILD_REPOSITORY_NAME when empty.
9+
- name: organization
10+
type: string
11+
default: ''
12+
13+
# Name of the source repository (e.g. 'runtime' for 'dotnet/runtime') passed via --repository.
14+
# Defaults to the repo segment of BUILD_REPOSITORY_NAME when empty.
15+
- name: repository
16+
type: string
17+
default: ''
18+
19+
# Optional dependency list for the generated job.
20+
- name: dependsOn
21+
type: object
22+
default: []
23+
24+
# Optional condition for the generated job.
25+
- name: condition
26+
type: string
27+
default: ''
28+
29+
# NuGet package id of the Helix job monitor tool.
30+
- name: toolPackageId
31+
type: string
32+
default: Microsoft.DotNet.Helix.JobMonitor
33+
34+
# Console command exposed by the installed tool package.
35+
- name: toolCommand
36+
type: string
37+
default: dotnet-helix-job-monitor
38+
39+
# Optional explicit tool version. Only honored when 'toolNupkgArtifactName' is set; in the
40+
# default code path the version is taken from the consuming repo's .config/dotnet-tools.json.
41+
- name: toolVersion
42+
type: string
43+
default: ''
44+
45+
# Base URI for the Helix service (--helix-base-uri).
46+
- name: helixBaseUri
47+
type: string
48+
default: https://helix.dot.net/
49+
50+
# Helix API access token forwarded to the tool via the HELIX_ACCESSTOKEN environment variable.
51+
- name: helixAccessToken
52+
type: string
53+
default: ''
54+
55+
# Polling interval in seconds (--polling-interval-seconds).
56+
- name: pollingIntervalSeconds
57+
type: number
58+
default: 30
59+
60+
# Advanced: optional pipeline artifact (produced earlier in this run) that contains the tool
61+
# nupkg. When set, the artifact is downloaded and the tool is installed from the nupkg into
62+
# a local tool-path; this bypasses the repo's .config/dotnet-tools.json manifest and is
63+
# primarily intended for the Arcade repository itself, where the Helix job monitor tool is
64+
# built in the same pipeline that runs this template.
65+
#
66+
# When this parameter is empty (the default), the consuming repository must declare the tool
67+
# in its .config/dotnet-tools.json manifest (alongside other local .NET tools); the template
68+
# will check out the repo and run 'dotnet tool restore' to install the version pinned there.
69+
- name: toolNupkgArtifactName
70+
type: string
71+
default: ''
72+
73+
# Advanced: sub-path within the downloaded artifact where the tool nupkg is located. Defaults
74+
# to the standard Arcade non-shipping packages location for a Release build (relative to the
75+
# pipeline artifact root, which is itself the build's 'artifacts' directory).
76+
- name: toolNupkgArtifactSubPath
77+
type: string
78+
default: 'packages/Release/NonShipping'
79+
80+
jobs:
81+
- job: HelixJobMonitor
82+
displayName: Monitor Helix Jobs
83+
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
84+
${{ if ne(length(parameters.dependsOn), 0) }}:
85+
dependsOn: ${{ parameters.dependsOn }}
86+
${{ if ne(parameters.condition, '') }}:
87+
condition: ${{ parameters.condition }}
88+
pool:
89+
${{ if eq(variables['System.TeamProject'], 'public') }}:
90+
name: $(DncEngPublicBuildPool)
91+
demands: ImageOverride -equals build.azurelinux.3.amd64.open
92+
${{ else }}:
93+
name: $(DncEngInternalBuildPool)
94+
demands: ImageOverride -equals build.azurelinux.3.amd64
95+
steps:
96+
- checkout: self
97+
fetchDepth: 1
98+
99+
- ${{ if ne(parameters.toolNupkgArtifactName, '') }}:
100+
- task: DownloadPipelineArtifact@2
101+
displayName: Download Helix Job Monitor artifact
102+
inputs:
103+
buildType: current
104+
artifactName: ${{ parameters.toolNupkgArtifactName }}
105+
itemPattern: '${{ parameters.toolNupkgArtifactSubPath }}/${{ parameters.toolPackageId }}.*.nupkg'
106+
targetPath: $(Agent.TempDirectory)/helix-job-monitor-nupkg
107+
108+
- bash: |
109+
set -euo pipefail
110+
111+
toolPath="$AGENT_TEMPDIRECTORY/helix-job-monitor-tool"
112+
mkdir -p "$toolPath"
113+
114+
packageId='${{ parameters.toolPackageId }}'
115+
toolVersion='${{ parameters.toolVersion }}'
116+
nupkgArtifactSubPath='${{ parameters.toolNupkgArtifactSubPath }}'
117+
nupkgDir="$AGENT_TEMPDIRECTORY/helix-job-monitor-nupkg/$nupkgArtifactSubPath"
118+
119+
if [ ! -d "$nupkgDir" ]; then
120+
echo "Expected nupkg directory '$nupkgDir' was not produced by the artifact download." >&2
121+
exit 1
122+
fi
123+
124+
nupkg=$(find "$nupkgDir" -maxdepth 1 -type f -name "$packageId.*.nupkg" | head -n 1)
125+
if [ -z "$nupkg" ]; then
126+
echo "No '$packageId.*.nupkg' found in '$nupkgDir'." >&2
127+
exit 1
128+
fi
129+
130+
# Derive the version from the nupkg filename so the local package is selected
131+
# deterministically instead of resolving against any other configured feed.
132+
nupkgBase=$(basename "$nupkg" .nupkg)
133+
derivedVersion="${nupkgBase#${packageId}.}"
134+
if [ -z "$toolVersion" ]; then
135+
toolVersion="$derivedVersion"
136+
fi
137+
138+
echo "Using locally built '$packageId' version '$toolVersion' from '$nupkgDir'."
139+
140+
# Create a minimal NuGet.config that only references the local nupkg directory.
141+
# This avoids conflicts with the repo's package source mapping which blocks --add-source.
142+
toolNugetConfig="$AGENT_TEMPDIRECTORY/helix-job-monitor-nuget.config"
143+
printf '<?xml version="1.0" encoding="utf-8"?>\n<configuration>\n <packageSources>\n <clear />\n <add key="local-tool" value="%s" />\n </packageSources>\n</configuration>\n' "$nupkgDir" > "$toolNugetConfig"
144+
145+
pushd "$(Build.SourcesDirectory)" > /dev/null
146+
./eng/common/dotnet.sh tool install \
147+
--tool-path "$toolPath" "$packageId" \
148+
--version "$toolVersion" \
149+
--configfile "$toolNugetConfig"
150+
151+
# Locate the tool DLL so the run step can invoke it via ./eng/common/dotnet.sh exec.
152+
toolDll=$(find "$toolPath/.store" -path '*/tools/*/any/*.deps.json' -type f | head -n 1)
153+
toolDll="${toolDll%.deps.json}.dll"
154+
if [ ! -f "$toolDll" ]; then
155+
echo "Could not find tool DLL in '$toolPath/.store'." >&2
156+
exit 1
157+
fi
158+
159+
echo "Tool DLL: $toolDll"
160+
echo "##vso[task.setvariable variable=HelixJobMonitorDll]$toolDll"
161+
displayName: Install Helix Job Monitor
162+
163+
- ${{ else }}:
164+
- bash: ./eng/common/dotnet.sh tool restore
165+
displayName: Restore Helix Job Monitor
166+
167+
- bash: |
168+
set -euo pipefail
169+
170+
toolArgs=(
171+
--helix-base-uri '${{ parameters.helixBaseUri }}'
172+
--polling-interval-seconds '${{ parameters.pollingIntervalSeconds }}'
173+
--max-wait-minutes "$((${{ parameters.timeoutInMinutes }} - 2))" # Set the tool's timeout slightly lower than the Azure DevOps job timeout to allow it to exit gracefully.
174+
--stage-name '$(System.StageName)'
175+
)
176+
177+
organization='${{ parameters.organization }}'
178+
repository='${{ parameters.repository }}'
179+
180+
# Fall back to Azure DevOps-provided environment variables when the caller did not
181+
# supply organization / repository explicitly. BUILD_REPOSITORY_NAME is typically
182+
# 'owner/repo' for GitHub-backed builds.
183+
if [ -z "$organization" ] || [ -z "$repository" ]; then
184+
buildRepoName="${BUILD_REPOSITORY_NAME:-}"
185+
if [ -n "$buildRepoName" ] && [[ "$buildRepoName" == */* ]]; then
186+
repoOwner="${buildRepoName%%/*}"
187+
repoName="${buildRepoName#*/}"
188+
if [ -z "$organization" ]; then organization="$repoOwner"; fi
189+
if [ -z "$repository" ]; then repository="$repoName"; fi
190+
fi
191+
fi
192+
193+
if [ -n "$organization" ]; then toolArgs+=( --organization "$organization" ); fi
194+
if [ -n "$repository" ]; then toolArgs+=( --repository "$repository" ); fi
195+
196+
# Build.Reason and Build.SourceBranch are required to derive the Helix source filter
197+
# the same way the Helix SDK submitter does (PR -> 'pr', internal -> 'official',
198+
# otherwise -> 'ci'). Without these, manually-queued / scheduled / CI builds would
199+
# be looked up under the wrong source prefix and find zero jobs.
200+
toolArgs+=( --build-reason "$(Build.Reason)" )
201+
toolArgs+=( --source-branch "$(Build.SourceBranch)" )
202+
203+
if [ -n '${{ parameters.toolNupkgArtifactName }}' ]; then
204+
# Tool was installed from a local nupkg; run the DLL via the repo-local dotnet.
205+
export DOTNET_ROOT="$(Build.SourcesDirectory)/.dotnet"
206+
./eng/common/dotnet.sh exec "$(HelixJobMonitorDll)" "${toolArgs[@]}"
207+
else
208+
# Tool was restored from the local .config/dotnet-tools.json manifest; invoke it
209+
# through the manifest from the repo root.
210+
pushd "$BUILD_SOURCESDIRECTORY" > /dev/null
211+
trap 'popd > /dev/null' EXIT
212+
./eng/common/dotnet.sh tool run '${{ parameters.toolCommand }}' -- "${toolArgs[@]}"
213+
fi
214+
displayName: Monitor Helix Jobs
215+
env:
216+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
217+
HELIX_ACCESSTOKEN: ${{ parameters.helixAccessToken }}

‎eng/common/core-templates/steps/publish-logs.yml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ steps:
3333
'$(publishing-dnceng-devdiv-code-r-build-re)'
3434
'$(dn-bot-all-orgs-artifact-feeds-rw)'
3535
'$(akams-client-id)'
36-
'$(dnceng-symbol-server-pat)'
37-
'$(dn-bot-all-orgs-build-rw-code-rw)'
3836
'$(System.AccessToken)'
3937
${{parameters.CustomSensitiveDataList}}
4038
continueOnError: true

‎eng/common/tools.ps1‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@ function Stop-Processes() {
748748
#
749749
function MSBuild() {
750750
if ($ci) {
751+
InitializeToolset | Out-Null
752+
751753
$env:NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS = 20
752754
$env:NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS = 20
753755
Write-PipelineSetVariable -Name 'NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS' -Value '20'

‎eng/common/tools.sh‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,8 @@ function MSBuild {
505505
local args=( "$@" )
506506

507507
if [[ "$ci" == true ]]; then
508+
InitializeToolset
509+
508510
export NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS=20
509511
export NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS=20
510512
Write-PipelineSetVariable -name "NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS" -value "20"

‎global.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"dotnet": "11.0.100-preview.5.26227.104"
99
},
1010
"msbuild-sdks": {
11-
"Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.26272.4",
11+
"Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.26279.5",
1212
"Microsoft.Build.NoTargets": "3.7.0",
1313
"Microsoft.Build.Traversal": "3.4.0"
1414
}

0 commit comments

Comments
 (0)