Skip to content

Commit 8a501eb

Browse files
Merged PR 13216013: don't update rust if used in ADO
don't update rust if used in ADO ---- #### AI description (iteration 1) #### PR Classification Bug fix to prevent the rust toolchain from updating in an ADO environment. #### PR Summary This pull request updates the build script to ensure that rust is not updated when running in an ADO environment. - In `build.ps1`, the rust update condition is modified to run only if the `$usingADO` flag (set based on the `TF_BUILD` environment variable) is false. - In `build.ps1`, the `$usingADO` variable is moved to a global scope, removing its redundant local assignment in the test block. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2 parents 08bdb02 + 0292085 commit 8a501eb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

build.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ param(
2525

2626
$env:RUSTC_LOG=$null
2727
$env:RUSTFLAGS='-Dwarnings'
28+
$usingADO = ($null -ne $env:TF_BUILD)
2829

2930
trap {
3031
Write-Error "An error occurred: $($_ | Out-String)"
@@ -184,7 +185,7 @@ if ($null -ne $packageType) {
184185
Remove-Item temp:/rustup-init.exe -ErrorAction Ignore
185186
}
186187
}
187-
else {
188+
elseif (!$usingADO) {
188189
Write-Verbose -Verbose "Rust found, updating..."
189190
& $rustup update
190191
}
@@ -500,8 +501,6 @@ if (!$Clippy -and !$SkipBuild) {
500501

501502
if ($Test) {
502503
$failed = $false
503-
504-
$usingADO = ($null -ne $env:TF_BUILD)
505504
$repository = 'PSGallery'
506505

507506
if ($usingADO) {

0 commit comments

Comments
 (0)