From fa87d2e292ec1e10923adf58afc1162f997176cf Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 24 Sep 2026 13:10:15 +0200 Subject: [PATCH 1/3] Use MSBuild MT for bootstrap, ILVerify and determinism Keep bootstrap MT enabled by default without changing product build defaults, and honor explicit MT opt-outs. Preserve the compiler determinism comparisons. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/Build.ps1 | 3 ++- eng/build-utils.ps1 | 5 ++++- eng/build.sh | 4 ++++ eng/test-determinism.ps1 | 1 + tests/EndToEndBuildTests/MultithreadedTasks/README.md | 3 ++- tests/ILVerify/ilverify.ps1 | 8 ++------ 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/eng/Build.ps1 b/eng/Build.ps1 index e140b1ea327..343b2ce0df6 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -83,6 +83,7 @@ $ErrorActionPreference = "Stop" $BuildCategory = "" $BuildMessage = "" +$bootstrapMultiThreaded = !$PSBoundParameters.ContainsKey('msbuildMultiThreaded') -or $msbuildMultiThreaded $desktopTargetFramework = "net472" # Read product TFM from centralized source of truth via MSBuild @@ -581,7 +582,7 @@ try { if ($bootstrap) { $script:BuildMessage = "Failure building bootstrap compiler" - $bootstrapDir = Make-BootstrapBuild + $bootstrapDir = Make-BootstrapBuild -msbuildMultiThreaded $bootstrapMultiThreaded } $script:BuildMessage = "Failure building product" diff --git a/eng/build-utils.ps1 b/eng/build-utils.ps1 index 644171f1eb4..42c4a879247 100644 --- a/eng/build-utils.ps1 +++ b/eng/build-utils.ps1 @@ -232,7 +232,7 @@ function Run-MSBuild([string]$projectFilePath, [string]$buildArgs = "", [string] # # Important to not set $script:bootstrapDir here yet as we're actually in the process of # building the bootstrap. -function Make-BootstrapBuild() { +function Make-BootstrapBuild([bool]$msbuildMultiThreaded = $true) { Write-Host "Building bootstrap '$bootstrapTfm' compiler with '$fsharpNetCoreProductTfm' .NET Core product TFM" $dir = Join-Path $ArtifactsDir "Bootstrap" @@ -248,6 +248,9 @@ function Make-BootstrapBuild() { # prepare compiler $projectpath = "$RepoRoot" + "proto.proj" $args = "publish `"$projectpath`" -c $bootstrapConfiguration" + if ($msbuildMultiThreaded) { + $args += " -mt" + } if ($binaryLog) { $logFilePath = Join-Path $LogDir "bootstrap.binlog" $args += " /bl:`"$logFilePath`"" diff --git a/eng/build.sh b/eng/build.sh index bb8035cf411..4a5fa1204b6 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -220,6 +220,7 @@ while [[ $# > 0 ]]; do done # Import Arcade functions +bootstrap_multi_threaded=${msbuild_multi_threaded:-true} . "$scriptroot/common/tools.sh" function Test() { @@ -334,6 +335,9 @@ function BuildSolution { BuildMessage="Error building tools" local args=("publish" "$repo_root/proto.proj" "$blrestore" "$bltools" "/p:Configuration=Proto" "/p:DotNetBuild=$product_build" "/p:DotNetBuildSourceOnly=$source_build" "/p:DotNetBuildFromVMR=$from_vmr" ${properties[@]+"${properties[@]}"}) + if [[ "$(NormalizeBoolArg "$bootstrap_multi_threaded")" == true ]]; then + args+=("-mt") + fi echo $args "$DOTNET_INSTALL_DIR/dotnet" "${args[@]}" || exit $? fi diff --git a/eng/test-determinism.ps1 b/eng/test-determinism.ps1 index 1984acc01a7..2450adeae61 100644 --- a/eng/test-determinism.ps1 +++ b/eng/test-determinism.ps1 @@ -406,6 +406,7 @@ function TryDownloadDotnetFrameworkSdk() { } try { + $msbuildMultiThreaded = $true . (Join-Path $PSScriptRoot "build-utils.ps1") # Create all of the logging directories diff --git a/tests/EndToEndBuildTests/MultithreadedTasks/README.md b/tests/EndToEndBuildTests/MultithreadedTasks/README.md index e8340336c8a..3f6a070e53a 100644 --- a/tests/EndToEndBuildTests/MultithreadedTasks/README.md +++ b/tests/EndToEndBuildTests/MultithreadedTasks/README.md @@ -34,7 +34,8 @@ Both reuse their built products and publish the SDK evidence. There are no separ The existing Linux and macOS build jobs use Arcade's `--mt true` option. The three `Plain_Build_*` SDK jobs pass `-mt` directly to MSBuild. Those plain builds use SDK-shipped tasks; the redirected product builds and this harness exercise the migrated tasks. -VS/MSBuild.exe jobs and Arcade-managed source-build configuration are unchanged. +Bootstrap publishing uses MT by default on Windows and Unix; explicit `-mt 0` / `--mt false` build options disable it. ILVerify and both compiler determinism modes explicitly opt into MSBuild MT. The determinism modes still compare the same F# compiler flags or sequential versus parallel compilation, independently of MSBuild scheduling. +Other VS/MSBuild.exe product builds and Arcade-managed source-build configuration are unchanged. No repository-wide environment override or replacement for Arcade's MT controls is added. Use `--repetitions 10` for local stress runs. diff --git a/tests/ILVerify/ilverify.ps1 b/tests/ILVerify/ilverify.ps1 index 70e331b06c3..8be69f41b2e 100644 --- a/tests/ILVerify/ilverify.ps1 +++ b/tests/ILVerify/ilverify.ps1 @@ -39,7 +39,7 @@ Write-Host "Checking whether running on Windows: $IsWindows" Write-Host "Repository path: $repo_path" [string] $script = if ($IsWindows) { Join-Path $repo_path "build.cmd" } else { Join-Path $repo_path "build.sh" } -[string] $additional_arguments = if ($IsWindows) { "-noVisualStudio -ci -bootstrap" } else { "" } +[string[]] $additional_arguments = if ($IsWindows) { "-noVisualStudio", "-ci", "-bootstrap", "-mt", "1" } else { "--mt", "true" } # Set environment variable to disable UpdateXlf target (not needed for IL verification) $env:UpdateXlfOnBuild = "false" @@ -76,11 +76,7 @@ if ($LASTEXITCODE -ne 0) { # Run build script for each configuration (NOTE: We don't build Proto) foreach ($configuration in $configurations) { Write-Host "Building $configuration configuration..." - if ($additional_arguments) { - & $script -c $configuration $additional_arguments - } else { - & $script -c $configuration - } + & $script -c $configuration @additional_arguments if ($LASTEXITCODE -ne 0 -And $LASTEXITCODE -ne '') { Write-Host "Build failed for $configuration configuration (last exit code: $LASTEXITCODE)." exit 1 From d76a3380fedc31736e85cfe7a7b85ff708d79381 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 16 Oct 2026 16:18:00 +0200 Subject: [PATCH 2/3] Retry CI after transient IcedTasks file lock Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> From f4ef858a2251f6559015b30e3b5e49d72c9376b7 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 16 Oct 2026 18:29:01 +0200 Subject: [PATCH 3/3] Retry CI after macOS test process timeout Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>