Skip to content

Commit

Permalink
Standardize use of prepareMachine for ci cleanup (#71265)
Browse files Browse the repository at this point in the history
Arcade has a concept of prepareMachine which is commonly (though not always) enabled alongside the -ci switch. This causes process cleanup when a build function exits. Roslyn was using this switch in some cases, but not in others, and had implemented a process cleanup with -ci was passed. In the VMR windows build, this causes roslyn to kill the host build process. Change this so that -ci no longer performs this behavior by default, and instead use -prepareMachine to have Arcade do this for us.
  • Loading branch information
mmitche committed Jan 3, 2024
1 parent 03d790a commit 754f1b0
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions azure-pipelines-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ steps:
inputs:
filePath: eng/build.ps1
arguments: -ci
-prepareMachine
-restore
-build
-configuration $(BuildConfiguration)
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ stages:
inputs:
filePath: eng/build.ps1
arguments: -ci
-prepareMachine
-restore
-build
-pack
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines-pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ stages:
inputs:
filePath: eng/build.ps1
arguments: -ci
-prepareMachine
-restore
-build
-pack
Expand Down
4 changes: 0 additions & 4 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -799,10 +799,6 @@ catch {
ExitWithExitCode 1
}
finally {
if ($ci) {
Stop-Processes
}

if (Test-Path Function:\Unsubst-TempDir) {
Unsubst-TempDir
}
Expand Down
2 changes: 1 addition & 1 deletion eng/cibuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd)"
echo "Building this commit:"
git show --no-patch --pretty=raw HEAD

. "$scriptroot/build.sh" --ci --restore --build --bootstrap --pack --publish --binaryLog "$@"
. "$scriptroot/build.sh" --ci --prepareMachine --restore --build --bootstrap --pack --publish --binaryLog "$@"
3 changes: 2 additions & 1 deletion eng/test-rebuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
param(
[string]$configuration = "Debug",
[switch]$ci = $false,
[switch]$prepareMachine = $false,
[switch]$useGlobalNuGetCache = $true,
[switch]$noBuild = $false,
[switch]$help)
Expand Down Expand Up @@ -33,7 +34,7 @@ try {

if (-not $noBuild) {
Write-Host "Building Roslyn"
Exec-Block { & (Join-Path $PSScriptRoot "build.ps1") -restore -build -bootstrap -ci:$ci -useGlobalNuGetCache:$useGlobalNuGetCache -configuration:$configuration -pack -binaryLog }
Exec-Block { & (Join-Path $PSScriptRoot "build.ps1") -restore -build -bootstrap -prepareMachine:$prepareMachine -ci:$ci -useGlobalNuGetCache:$useGlobalNuGetCache -configuration:$configuration -pack -binaryLog }
}

Subst-TempDir
Expand Down

0 comments on commit 754f1b0

Please sign in to comment.