Skip to content

Commit

Permalink
Fix the log contention in correctness legs (#72263)
Browse files Browse the repository at this point in the history
* Fix the log contention in correctness legs

The PS1 scripts are not using `ExitWithExitCode` thus they are not
properly killing the compiler server and msbuild hence the logs are
unreadable.

* more

* more

* more

* more

* more
  • Loading branch information
jaredpar authored Feb 26, 2024
1 parent 3059a07 commit 28580f7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
7 changes: 5 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -383,19 +383,22 @@ stages:
- task: PowerShell@2
displayName: Restore
inputs:
pwsh: true
filePath: eng/build.ps1
arguments: -configuration Release -prepareMachine -ci -restore -binaryLogName Restore.binlog

- task: PowerShell@2
displayName: Build
inputs:
pwsh: true
filePath: eng/build.ps1
arguments: -configuration Release -prepareMachine -ci -build -pack -publish -sign -binaryLogName Build.binlog

- script: $(Build.SourcesDirectory)\artifacts\bin\BuildBoss\Release\net472\BuildBoss.exe -r "$(Build.SourcesDirectory)/" -c Release -p Roslyn.sln
displayName: Validate Build Artifacts

- script: eng/validate-rules-missing-documentation.cmd -ci
- pwsh: |
./eng/validate-rules-missing-documentation.ps1 -ci
displayName: Validate rules missing documentation
- pwsh: |
Expand All @@ -404,7 +407,7 @@ stages:
condition: or(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['compilerChange'], 'true'))
- pwsh: |
./eng/validate-code-formatting.ps1 -rootDirectory $(Build.SourcesDirectory)\src -includeDirectories Compilers\CSharp\Portable\Generated\, Compilers\VisualBasic\Portable\Generated\, ExpressionEvaluator\VisualBasic\Source\ResultProvider\Generated\
./eng/validate-code-formatting.ps1 -ci -rootDirectory $(Build.SourcesDirectory)\src -includeDirectories Compilers\CSharp\Portable\Generated\, Compilers\VisualBasic\Portable\Generated\, ExpressionEvaluator\VisualBasic\Source\ResultProvider\Generated\
displayName: Validate Generated Syntax Files
condition: or(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['compilerChange'], 'true'))
Expand Down
8 changes: 5 additions & 3 deletions eng/generate-compiler-code.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# the generator source files.
[CmdletBinding(PositionalBinding=$false)]
param ([string]$configuration = "Debug",
[switch]$test = $false)
[switch]$test = $false,
[switch]$ci = $false)

Set-StrictMode -version 2.0
$ErrorActionPreference="Stop"
Expand Down Expand Up @@ -115,6 +116,7 @@ function Get-ToolPath($projectRelativePath) {
try {
. (Join-Path $PSScriptRoot "build-utils.ps1")
Push-Location $RepoRoot
$prepareMachine = $ci

$dotnet = Ensure-DotnetSdk
$boundTreeGenProject = Get-ToolPath 'BoundTreeGenerator\CompilersBoundTreeGenerator.csproj'
Expand All @@ -136,11 +138,11 @@ try {
Run-IOperation $coreDir $operationsProject
Run-GetText

exit 0
ExitWithExitCode 0
}
catch {
Write-Host $_
exit 1
ExitWithExitCode 1
}
finally {
Pop-Location
Expand Down
6 changes: 4 additions & 2 deletions eng/pipelines/build-bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ parameters:
steps:
- template: checkout-windows-task.yml

- script: eng\make-bootstrap.cmd -ci -toolset ${{parameters.toolset}} -name "ci-bootstrap"
- pwsh: |
./eng/make-bootstrap.cmd -ci -toolset ${{parameters.toolset}} -name "ci-bootstrap"
displayName: Build Bootstrap Compiler
- script: eng/test-build-correctness.cmd -configuration Release -enableDumps -bootstrapDir $(Build.SourcesDirectory)/artifacts/bootstrap/ci-bootstrap
- pwsh: |
./eng/test-build-correctness.ps1 -ci -configuration Release -enableDumps -bootstrapDir $(Build.SourcesDirectory)/artifacts/bootstrap/ci-bootstrap
displayName: Build - Validate correctness
- template: publish-logs.yml
Expand Down
5 changes: 3 additions & 2 deletions eng/test-build-correctness.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ try {

. (Join-Path $PSScriptRoot "build-utils.ps1")
Push-Location $RepoRoot
$prepareMachine = $ci

if ($enableDumps) {
$key = "HKLM:\\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps"
Expand Down Expand Up @@ -65,14 +66,14 @@ try {
Exec-DotNet "tool run dotnet-format whitespace . --folder --include-generated --include src/Compilers/CSharp/Portable/Generated/ src/Compilers/VisualBasic/Portable/Generated/ src/ExpressionEvaluator/VisualBasic/Source/ResultProvider/Generated/ --verify-no-changes"
Write-Host ""

exit 0
ExitWithExitCode 0
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-Host "##vso[task.logissue type=error]How to investigate bootstrap failures: https://github.com/dotnet/roslyn/blob/main/docs/compilers/Bootstrap%20Builds.md#Investigating"
exit 1
ExitWithExitCode 1
}
finally {
if ($enableDumps) {
Expand Down
8 changes: 5 additions & 3 deletions eng/validate-code-formatting.ps1
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
param (
[string]$rootDirectory,
[string[]]$includeDirectories
[string[]]$includeDirectories,
[switch]$ci = $false
)
Set-StrictMode -version 2.0
$ErrorActionPreference="Stop"

try {
. (Join-Path $PSScriptRoot "build-utils.ps1")
Push-Location $RepoRoot
$prepareMachine = $ci

Exec-DotNet "tool run dotnet-format -v detailed whitespace $rootDirectory --folder --include-generated --include $includeDirectories --verify-no-changes"

exit 0
ExitWithExitCode 0
}
catch {
Write-Host $_
exit 1
ExitWithExitCode 1
}
finally {
Pop-Location
Expand Down

0 comments on commit 28580f7

Please sign in to comment.