Skip to content

Commit ea88ba4

Browse files
Merged PR 13221253: don't run msrustup at all within ADO
don't run msrustup at all within ADO ---- #### AI description (iteration 1) #### PR Classification This PR updates the build script to disable the execution of msrustup in ADO environments. #### PR Summary The pull request modifies `/build.ps1` to ensure that msrustup is not run when the build is executed within ADO. It introduces an early exit when the ADO flag is set and simplifies the rust toolchain selection and update logic. - `build.ps1`: Adds a conditional branch that breaks out when `$usingADO` is true, preventing msrustup execution. - `build.ps1`: Removes the fallback assignment of `$rustup` to `echo` and adjusts the update condition for clarity and proper toolchain selection. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2 parents 8a501eb + 4b08d5d commit ea88ba4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

build.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,17 @@ function Find-LinkExe {
155155
}
156156

157157
$channel = 'stable'
158-
if ($null -ne (Get-Command msrustup -CommandType Application -ErrorAction Ignore)) {
158+
$rustup = 'echo'
159+
if ($usingADO) {
160+
return
161+
} elseif ($null -ne (Get-Command msrustup -CommandType Application -ErrorAction Ignore)) {
159162
$rustup = 'msrustup'
160163
$channel = 'ms-stable'
161164
if ($architecture -eq 'current') {
162165
$env:MSRUSTUP_TOOLCHAIN = "$architecture"
163166
}
164167
} elseif ($null -ne (Get-Command rustup -CommandType Application -ErrorAction Ignore)) {
165168
$rustup = 'rustup'
166-
} else {
167-
$rustup = 'echo'
168169
}
169170

170171
if ($null -ne $packageType) {
@@ -185,7 +186,7 @@ if ($null -ne $packageType) {
185186
Remove-Item temp:/rustup-init.exe -ErrorAction Ignore
186187
}
187188
}
188-
elseif (!$usingADO) {
189+
else {
189190
Write-Verbose -Verbose "Rust found, updating..."
190191
& $rustup update
191192
}

0 commit comments

Comments
 (0)