diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4564073db4add..d7f483d48c41d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -222,13 +222,13 @@ stages: displayName: Restore inputs: filePath: eng/build.ps1 - arguments: -configuration Release -prepareMachine -ci -restore -binaryLog + arguments: -configuration Release -prepareMachine -ci -restore -binaryLogName Restore.binlog - task: PowerShell@2 displayName: Build inputs: filePath: eng/build.ps1 - arguments: -configuration Release -prepareMachine -ci -build -pack -publish -sign -binaryLog + 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 @@ -326,7 +326,7 @@ stages: displayName: Restore inputs: filePath: eng/build.ps1 - arguments: -configuration Debug -prepareMachine -ci -restore -binaryLog + arguments: -configuration Debug -prepareMachine -ci -restore -binaryLogName Restore.binlog - powershell: .\eng\test-rebuild.ps1 -ci -configuration Release displayName: Run BuildValidator diff --git a/eng/build.ps1 b/eng/build.ps1 index b0d00f0bbf084..0890d377b0de6 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -34,6 +34,7 @@ param ( [switch]$bootstrap, [string]$bootstrapConfiguration = "Release", [switch][Alias('bl')]$binaryLog, + [string]$binaryLogName = "", [switch]$buildServerLog, [switch]$ci, [switch]$collectDumps, @@ -79,6 +80,7 @@ function Print-Usage() { Write-Host " -verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]" Write-Host " -deployExtensions Deploy built vsixes (short: -d)" Write-Host " -binaryLog Create MSBuild binary log (short: -bl)" + Write-Host " -binaryLogName Name of the binary log (default Build.binlog)" Write-Host " -buildServerLog Create Roslyn build server log" Write-Host "" Write-Host "Actions:" @@ -166,6 +168,10 @@ function Process-Arguments() { $script:applyOptimizationData = $false } + if ($binaryLogName -ne "") { + $script:binaryLog = $true + } + if ($ci) { $script:binaryLog = $true if ($bootstrap) { @@ -173,6 +179,10 @@ function Process-Arguments() { } } + if ($binaryLog -and ($binaryLogName -eq "")) { + $script:binaryLogName = "Build.binlog" + } + $anyUnit = $testDesktop -or $testCoreClr if ($anyUnit -and $testVsi) { Write-Host "Cannot combine unit and VSI testing" @@ -213,7 +223,14 @@ function BuildSolution() { Write-Host "$($solution):" - $bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "Build.binlog") } else { "" } + $bl = "" + if ($binaryLog) { + $binaryLogPath = Join-Path $LogDir $binaryLogName + $bl = "/bl:" + $binaryLogPath + if ($ci -and (Test-Path $binaryLogPath)) { + Write-LogIssue -Type "warning" -Message "Overwriting binary log file $($binaryLogPath)" + } + } if ($buildServerLog) { ${env:ROSLYNCOMMANDLINELOGFILE} = Join-Path $LogDir "Build.Server.log" @@ -240,6 +257,11 @@ function BuildSolution() { $generateDocumentationFile = if ($skipDocumentation) { "/p:GenerateDocumentationFile=false" } else { "" } $roslynUseHardLinks = if ($ci) { "/p:ROSLYNUSEHARDLINKS=true" } else { "" } + # Temporarily disable RestoreUseStaticGraphEvaluation to work around this NuGet issue + # in our CI builds + # https://github.com/NuGet/Home/issues/12373 + $restoreUseStaticGraphEvaluation = if ($ci) { $false } else { $true } + try { MSBuild $toolsetBuildProj ` $bl ` @@ -259,7 +281,7 @@ function BuildSolution() { /p:TreatWarningsAsErrors=$warnAsError ` /p:EnableNgenOptimization=$applyOptimizationData ` /p:IbcOptimizationDataDir=$ibcDir ` - /p:RestoreUseStaticGraphEvaluation=true ` + /p:RestoreUseStaticGraphEvaluation=$restoreUseStaticGraphEvaluation ` /p:VisualStudioIbcDrop=$ibcDropName ` /p:VisualStudioDropAccessToken=$officialVisualStudioDropAccessToken ` $suppressExtensionDeployment ` @@ -734,7 +756,7 @@ try { catch { if ($ci) { - echo "##vso[task.logissue type=error](NETCORE_ENGINEERING_TELEMETRY=Build) Build failed" + Write-LogIssue -Type "error" -Message "(NETCORE_ENGINEERING_TELEMETRY=Build) Build failed" } throw $_ } @@ -752,7 +774,7 @@ try { catch { if ($ci) { - echo "##vso[task.logissue type=error](NETCORE_ENGINEERING_TELEMETRY=Test) Tests failed" + Write-LogIssue -Type "error" -Message "(NETCORE_ENGINEERING_TELEMETRY=Test) Tests failed" } throw $_ }