From 754f1b02295bdfcb8161665229a3530e6d3ba04b Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 3 Jan 2024 13:40:02 -0800 Subject: [PATCH] Standardize use of prepareMachine for ci cleanup (#71265) 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. --- azure-pipelines-compliance.yml | 1 + azure-pipelines-official.yml | 1 + azure-pipelines-pr-validation.yml | 1 + eng/build.ps1 | 4 ---- eng/cibuild.sh | 2 +- eng/test-rebuild.ps1 | 3 ++- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/azure-pipelines-compliance.yml b/azure-pipelines-compliance.yml index ed7c3800be5d1..ade0fedc1db29 100644 --- a/azure-pipelines-compliance.yml +++ b/azure-pipelines-compliance.yml @@ -38,6 +38,7 @@ steps: inputs: filePath: eng/build.ps1 arguments: -ci + -prepareMachine -restore -build -configuration $(BuildConfiguration) diff --git a/azure-pipelines-official.yml b/azure-pipelines-official.yml index 5a69351394ca4..edc5740e27f6c 100644 --- a/azure-pipelines-official.yml +++ b/azure-pipelines-official.yml @@ -180,6 +180,7 @@ stages: inputs: filePath: eng/build.ps1 arguments: -ci + -prepareMachine -restore -build -pack diff --git a/azure-pipelines-pr-validation.yml b/azure-pipelines-pr-validation.yml index 0cc8b8917d512..e75cd6c07de39 100644 --- a/azure-pipelines-pr-validation.yml +++ b/azure-pipelines-pr-validation.yml @@ -122,6 +122,7 @@ stages: inputs: filePath: eng/build.ps1 arguments: -ci + -prepareMachine -restore -build -pack diff --git a/eng/build.ps1 b/eng/build.ps1 index 3c9aec5558ee9..45be81591188f 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -799,10 +799,6 @@ catch { ExitWithExitCode 1 } finally { - if ($ci) { - Stop-Processes - } - if (Test-Path Function:\Unsubst-TempDir) { Unsubst-TempDir } diff --git a/eng/cibuild.sh b/eng/cibuild.sh index 456b83194b07c..9082c71f71cff 100755 --- a/eng/cibuild.sh +++ b/eng/cibuild.sh @@ -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 "$@" \ No newline at end of file +. "$scriptroot/build.sh" --ci --prepareMachine --restore --build --bootstrap --pack --publish --binaryLog "$@" \ No newline at end of file diff --git a/eng/test-rebuild.ps1 b/eng/test-rebuild.ps1 index e5c5cfe17f813..dc0922e854008 100644 --- a/eng/test-rebuild.ps1 +++ b/eng/test-rebuild.ps1 @@ -6,6 +6,7 @@ param( [string]$configuration = "Debug", [switch]$ci = $false, + [switch]$prepareMachine = $false, [switch]$useGlobalNuGetCache = $true, [switch]$noBuild = $false, [switch]$help) @@ -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