Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
15 changes: 9 additions & 6 deletions .vsts-dotnet-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
displayName: cibuild_bootstrapped_msbuild.cmd
inputs:
filename: 'eng/cibuild_bootstrapped_msbuild.cmd'
arguments: -onlyDocChanged $(onlyDocChanged)
arguments: '-onlyDocChanged $(onlyDocChanged) -stage2Properties /mt'
env:
ForceUseXCopyMSBuild: 1
# Task to collect code coverage on Windows. Disabled by default due to being unstable and sometimes it stucks forever
Expand Down Expand Up @@ -210,7 +210,7 @@ jobs:
displayName: cibuild_bootstrapped_msbuild.cmd
inputs:
filename: 'eng/cibuild_bootstrapped_msbuild.cmd'
arguments: '-msbuildEngine dotnet -onlyDocChanged $(onlyDocChanged)'
arguments: '-msbuildEngine dotnet -onlyDocChanged $(onlyDocChanged) -stage2Properties /mt'
env:
MSBUILDUSESERVER: "1"
# Task to collect code coverage on Windows. Disabled by default due to being unstable and sometimes it stucks forever
Expand Down Expand Up @@ -267,6 +267,9 @@ jobs:
continueOnError: true
condition: eq(variables.onlyDocChanged, 0)

# Dedicated /mt validation that turns on the ThreadSafeTaskAnalyzer (BuildAnalyzer=true),
# kept as a separate Linux Core job because the analyzer is more expensive and the regular
# bootstrapped CI jobs (which all run /mt now too) do not need it.
- job: BootstrapMSBuildWithMTMode
displayName: "Linux Core Multithreaded Mode"
pool:
Expand Down Expand Up @@ -324,13 +327,13 @@ jobs:
displayName: cibuild.cmd
inputs:
filename: 'eng/cibuild.cmd'
arguments: '-configuration Release -test'
arguments: '-configuration Release -test /mt'
condition: eq(variables.onlyDocChanged, 0)
- task: BatchScript@1
displayName: cibuild.cmd without test
inputs:
filename: 'eng/cibuild.cmd'
arguments: '-configuration Release'
arguments: '-configuration Release /mt'
Comment thread
JanProvaznik marked this conversation as resolved.
Outdated
condition: eq(variables.onlyDocChanged, 1)
# Task to collect code coverage on Windows. Disabled by default due to being unstable and sometimes it stucks forever
# - task: PowerShell@2
Expand Down Expand Up @@ -406,7 +409,7 @@ jobs:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- bash: sudo apt-get update
- bash: sudo apt-get install -y libxml2
- bash: . 'eng/cibuild_bootstrapped_msbuild.sh' --onlyDocChanged $(onlyDocChanged)
- bash: . 'eng/cibuild_bootstrapped_msbuild.sh' --onlyDocChanged $(onlyDocChanged) --stage2Properties '/mt'
displayName: CI Build
env:
MSBUILDUSESERVER: "1"
Expand Down Expand Up @@ -494,7 +497,7 @@ jobs:
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- bash: . 'eng/cibuild_bootstrapped_msbuild.sh' --onlyDocChanged $(onlyDocChanged)
- bash: . 'eng/cibuild_bootstrapped_msbuild.sh' --onlyDocChanged $(onlyDocChanged) --stage2Properties '/mt'
displayName: CI Build
env:
MSBUILDUSESERVER: "1"
Expand Down
4 changes: 4 additions & 0 deletions azure-pipelines/.vsts-dotnet-build-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ parameters:
- name: enableOptProf
type: boolean
default: false
- name: additionalBuildArgs
type: string
default: ''

jobs:
- job: Windows_NT
Expand Down Expand Up @@ -147,6 +150,7 @@ jobs:
/p:GenerateSbom=true
/p:SuppressFinalPackageVersion=${{ parameters.isExperimental }}
/p:IsExperimental=${{ parameters.isExperimental }}
${{ parameters.additionalBuildArgs }}

displayName: Build
condition: succeeded()
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines/.vsts-dotnet-exp-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ extends:
enableComponentGovernance: false
signTypeParameter: ${{ parameters.signTypeParameter }}
enableOptProf: ${{ parameters.enableOptProf }}
additionalBuildArgs: '/mt'
Comment thread
JanProvaznik marked this conversation as resolved.
Outdated

- template: /eng/common/templates-official/post-build/post-build.yml@self
parameters:
Expand Down
21 changes: 19 additions & 2 deletions eng/cibuild_bootstrapped_msbuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Param(
[switch] $prepareMachine,
[bool] $buildStage1 = $True,
[bool] $onlyDocChanged = 0,
[switch] $skipTests,
[string] $stage2Properties = "",
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
)

Expand Down Expand Up @@ -117,14 +119,29 @@ try {
# Opt into performance logging. https://github.com/dotnet/msbuild/issues/5900
$env:DOTNET_PERFLOG_DIR=$PerfLogDir

# Mirrors cibuild_bootstrapped_msbuild.sh. Some MSBuild scenarios (notably /mt routing tasks
# to a sidecar TaskHost) require this so the apphost-based child can locate the runtime.
# The SDK CLI (`dotnet msbuild`) sets it automatically; `dotnet exec MSBuild.dll` does not.
$env:DOTNET_HOST_PATH=$dotnetExePath
Comment thread
JanProvaznik marked this conversation as resolved.
Outdated

# When using bootstrapped MSBuild:
# - Turn off node reuse (so that bootstrapped MSBuild processes don't stay running and lock files)
# - Create bootstrap environment as it's required when also running tests
# - $stage2Properties are appended to the stage 2 build only (matching cibuild_bootstrapped_msbuild.sh).
# Use this for switches like /mt that should not be passed to the SDK MSBuild used in stage 1.
Comment thread
JanProvaznik marked this conversation as resolved.
Outdated
# Branches mirror cibuild_bootstrapped_msbuild.sh exactly:
# onlyDocChanged=1 → bootstrap not created (artifacts not needed downstream)
Comment thread
JanProvaznik marked this conversation as resolved.
# skipTests → bootstrap IS created (downstream MAY consume it), tests omitted
# default → bootstrap created, tests run
$stage2Args = if ($stage2Properties) { $stage2Properties -split '\s+' | Where-Object { $_ } } else { @() }
if ($onlyDocChanged) {
& $PSScriptRoot\Common\Build.ps1 -restore -build -ci /p:CreateBootstrap=false /nr:false @properties
& $PSScriptRoot\Common\Build.ps1 -restore -build -ci /p:CreateBootstrap=false /nr:false @properties @stage2Args
}
elseif ($skipTests) {
& $PSScriptRoot\Common\Build.ps1 -restore -build -ci /nr:false @properties @stage2Args
}
else {
& $PSScriptRoot\Common\Build.ps1 -restore -build -test -ci /nr:false @properties
& $PSScriptRoot\Common\Build.ps1 -restore -build -test -ci /nr:false @properties @stage2Args
}

exit $lastExitCode
Expand Down