Enable parallel builds across repos of VMR (#18824)

This commit is contained in:
Matt Thalman 2024-03-08 15:59:46 -06:00 committed by GitHub
parent a246c1d7fc
commit 3de6912d73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 2 deletions

View file

@ -146,7 +146,6 @@
<EnableDefaultItems Condition="'$(MSBuildProjectExtension)' == '.proj'">false</EnableDefaultItems>
<LogVerbosity Condition="'$(LogVerbosity)'==''">minimal</LogVerbosity>
<BuildInParallel Condition="'$(BuildInParallel)'==''">false</BuildInParallel>
<ShellExtension Condition="'$(BuildOS)' == 'windows'">.cmd</ShellExtension>
<ShellExtension Condition="'$(BuildOS)' != 'windows'">.sh</ShellExtension>

View file

@ -5,6 +5,12 @@
<PropertyGroup>
<RepositoryName>$(MSBuildProjectName)</RepositoryName>
<GitInfoRepoPropsFile>$(GitInfoDir)$(RepositoryName).props</GitInfoRepoPropsFile>
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
<RunEachTargetSeparately>false</RunEachTargetSeparately>
<!-- If this is a dev build with parallelism enabled, ensure that RunEachTargetSeparately is true so that StopOnFirstFailure will be honored.
This improves the dev experience because it will fail the build as soon as an error occurs rather than waiting for all parallel projects
to finish. This isn't enabled in CI builds because it has a slight perf impact. -->
<RunEachTargetSeparately Condition="'$(BuildInParallel)' == 'true' and '$(ContinuousIntegrationBuild)' != 'true'">true</RunEachTargetSeparately>
</PropertyGroup>
<Import Project="$(GitInfoRepoPropsFile)" Condition="Exists('$(GitInfoRepoPropsFile)')" />

View file

@ -297,7 +297,8 @@
<MSBuild Projects="@(_DependentProject)"
Targets="Build"
BuildInParallel="$(BuildInParallel)"
StopOnFirstFailure="true" />
StopOnFirstFailure="true"
RunEachTargetSeparately="$(RunEachTargetSeparately)" />
</Target>
<Target Name="SetSourceBuiltSdkOverrides"
@ -460,9 +461,13 @@
<_InnerPackageCacheFiles Include="$(ProjectDirectory)artifacts/sb/package-cache/**/*" />
</ItemGroup>
<!-- Retries can be necessary due to file locking when parallel builds are enabled and multiple repos
are trying to write their restored packages to this location.
See https://github.com/dotnet/installer/pull/18824#issuecomment-1986371287 -->
<Copy SourceFiles="@(_InnerPackageCacheFiles)"
DestinationFiles="$(NuGetPackageRoot)%(RecursiveDir)%(Filename)%(Extension)"
SkipUnchangedFiles="true"
Retries="5"
Condition="'@(_InnerPackageCacheFiles)' != ''" />
</Target>