From 98fbe53bcb43952d0875c35e26c713e83b4e83a8 Mon Sep 17 00:00:00 2001 From: Jared Parsons Date: Wed, 6 Mar 2024 07:51:18 -0800 Subject: [PATCH] Fix log contention issue This fixes another log contention issue we were seeing in CI. This was not caught in #72263 because the syntax generation only ran conditionally hence masked this problem. --- azure-pipelines.yml | 1 - eng/validate-rules-missing-documentation.ps1 | 16 ++++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2878fa4a84802..d375f17bce720 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -409,7 +409,6 @@ stages: - pwsh: | ./eng/generate-compiler-code.ps1 -test -configuration Release displayName: Generate Syntax Files - condition: or(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['compilerChange'], 'true')) - pwsh: | ./eng/validate-code-formatting.ps1 -ci -rootDirectory $(Build.SourcesDirectory)\src -includeDirectories Compilers\CSharp\Portable\Generated\, Compilers\VisualBasic\Portable\Generated\, ExpressionEvaluator\VisualBasic\Source\ResultProvider\Generated\ diff --git a/eng/validate-rules-missing-documentation.ps1 b/eng/validate-rules-missing-documentation.ps1 index 99775839c7efe..b38dfb2cedeee 100644 --- a/eng/validate-rules-missing-documentation.ps1 +++ b/eng/validate-rules-missing-documentation.ps1 @@ -1,30 +1,26 @@ [CmdletBinding(PositionalBinding=$false)] param ( - [switch]$ci + [switch]$ci = $false ) Set-StrictMode -version 2.0 $ErrorActionPreference="Stop" - Write-Host "Building Microsoft.CodeAnalysis.Features" try { . (Join-Path $PSScriptRoot "build-utils.ps1") Push-Location $RepoRoot + $prepareMachine = $ci $projectFilePath = Join-Path $RepoRoot "src\Features\Core\Portable\Microsoft.CodeAnalysis.Features.csproj" Exec-DotNet "build $projectFilePath -t:GenerateRulesMissingDocumentation -p:RoslynEnforceCodeStyle=false -p:RunAnalyzersDuringBuild=false -p:ContinuousIntegrationBuild=$ci -c Release" - - if ($LASTEXITCODE -ne 0) { - Write-Host "Failed with exit code $LASTEXITCODE." - exit $LASTEXITCODE - } } catch { - Write-Host "Error verifying rules missing documentation!" Write-Host $_ Write-Host $_.Exception Write-Host $_.ScriptStackTrace - $host.SetShouldExit(1) - exit 1 + ExitWithExitCode 1 +} +finally { + Pop-Location }