Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ if ($ci -and -not $PSBoundParameters.ContainsKey('msbuildMultiThreaded')) {
}
$BuildCategory = ""
$BuildMessage = ""
$bootstrapMultiThreaded = !$PSBoundParameters.ContainsKey('msbuildMultiThreaded') -or $msbuildMultiThreaded

$desktopTargetFramework = "net472"
# Read product TFM from centralized source of truth via MSBuild
Expand Down Expand Up @@ -827,7 +828,7 @@ try {

if ($bootstrap) {
$script:BuildMessage = "Failure building bootstrap compiler"
$bootstrapDir = Make-BootstrapBuild
$bootstrapDir = Make-BootstrapBuild -msbuildMultiThreaded $bootstrapMultiThreaded
}

$script:BuildMessage = "Failure building product"
Expand Down
5 changes: 4 additions & 1 deletion eng/build-utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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`""
Expand Down
4 changes: 4 additions & 0 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ while [[ $# > 0 ]]; do
done

# Import Arcade functions
bootstrap_multi_threaded=${msbuild_multi_threaded:-true}
. "$scriptroot/common/tools.sh"

function Test() {
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions eng/test-determinism.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ function TryDownloadDotnetFrameworkSdk() {
}

try {
$msbuildMultiThreaded = $true
. (Join-Path $PSScriptRoot "build-utils.ps1")

# Create all of the logging directories
Expand Down
3 changes: 2 additions & 1 deletion tests/EndToEndBuildTests/MultithreadedTasks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 2 additions & 6 deletions tests/ILVerify/ilverify.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
Loading