diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 90e48b4363..fba408e7d4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -256,13 +256,16 @@ stages: displayName: Preserve cache diagnostics and clean failed seed outputs condition: and(always(), ne(variables['MSBuildCacheBuildSucceeded'], 'true')) + # Keep the cache support packages out of the multithreaded fallback. Their unannotated + # ResolveFileAccesses task currently fails in MSBuild's sidecar task host under -mt. - script: eng\common\CIBuild.cmd -configuration $(_BuildConfig) + -msbuildMultiThreaded 1 -prepareMachine /p:Publish=false /p:Test=false /p:FastAcceptanceTest=true - /p:MSBuildCachePackageEnabled=true + /p:MSBuildCachePackageEnabled=false /p:MSBuildCacheEnabled=false name: Build displayName: Build @@ -705,13 +708,16 @@ stages: # Fallback build. Skipped when the MSBuildCache steps above already produced, signed and packed the # outputs; also skipped when they failed with build errors, because this step would only reproduce them. + # Keep the cache support packages out of this multithreaded build because their unannotated + # ResolveFileAccesses task currently fails in MSBuild's sidecar task host under -mt. - script: eng\common\CIBuild.cmd -configuration $(_BuildConfig) + -msbuildMultiThreaded 1 -prepareMachine /p:Publish=false /p:Test=false /p:FastAcceptanceTest=true - /p:MSBuildCachePackageEnabled=true + /p:MSBuildCachePackageEnabled=false /p:MSBuildCacheEnabled=false name: Build displayName: Build @@ -850,6 +856,7 @@ stages: steps: - script: eng/common/cibuild.sh -configuration $(_BuildConfig) + -msbuildMultiThreaded true -prepareMachine /p:Test=false /p:Publish=false @@ -889,6 +896,7 @@ stages: steps: - script: eng/common/cibuild.sh -configuration $(_BuildConfig) + -msbuildMultiThreaded true -prepareMachine /p:Test=false /p:Publish=false diff --git a/eng/build.ps1 b/eng/build.ps1 index 8b80f374df..51251795b6 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -7,6 +7,7 @@ Param( [string] $msbuildEngine = $null, [bool] $warnAsError = $true, [bool] $nodeReuse = $true, + [bool][Alias('mt')]$msbuildMultiThreaded = $false, [switch][Alias('r')]$restore, [switch] $deployDeps, [switch][Alias('b')]$build, @@ -82,4 +83,8 @@ if ($installWindowsSdk) { $null = $PSBoundParameters.Remove("vs") $null = $PSBoundParameters.Remove("installWindowsSdk") +if (-not $PSBoundParameters.ContainsKey("msbuildMultiThreaded")) { + $PSBoundParameters["msbuildMultiThreaded"] = -not $ci +} + & $PSScriptRoot\common\Build.ps1 @PSBoundParameters