-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Microsoft.MSBuildCache This change adds a new pipeline which enables caching in the build. This is added as a separate pipeline for now with the eventual goal of enabling for PR and/or CI builds. Documentation for Microsoft.MSBuildCache can be found in the GitHub repo: https://github.com/microsoft/MSBuildCache Preliminary numbers below. * [Baseline](https://dev.azure.com/ms/terminal/_build/results?buildId=579399&view=results): 12 min * [0% Cache hits](https://dev.azure.com/ms/terminal/_build/results?buildId=579419&view=results): 16 mins * [100% cache hits](https://dev.azure.com/ms/terminal/_build/results?buildId=579427&view=results): 3 mins
- Loading branch information
Showing
7 changed files
with
139 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -283,3 +283,6 @@ MSG*.bin | |
profiles.json | ||
*.metaproj | ||
*.swp | ||
|
||
# MSBuildCache | ||
/MSBuildCacheLogs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<Project> | ||
<!-- | ||
NOTE! This file gets written-over entirely by the release builds. | ||
Any build logic in this file must be optional and only apply to non-release builds. | ||
--> | ||
|
||
<!-- MsBuildCache --> | ||
<PropertyGroup> | ||
<!-- Off by default --> | ||
<MsBuildCacheEnabled Condition="'$(MsBuildCacheEnabled)' == ''">false</MsBuildCacheEnabled> | ||
|
||
<!-- Always off during package restore --> | ||
<MsBuildCacheEnabled Condition=" '$(ExcludeRestorePackageImports)' == 'true' ">false</MsBuildCacheEnabled> | ||
|
||
<!-- In Azure pipelines, use Pipeline Caching as the cache storage backend. Otherwise, use the local cache. --> | ||
<MSBuildCachePackageName Condition="'$(TF_BUILD)' != ''">Microsoft.MSBuildCache.AzurePipelines</MSBuildCachePackageName> | ||
<MSBuildCachePackageName Condition="'$(MSBuildCachePackageName)' == ''">Microsoft.MSBuildCache.Local</MSBuildCachePackageName> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(MSBuildCacheEnabled)' == 'true'"> | ||
<!-- Change this to bust the cache --> | ||
<MSBuildCacheCacheUniverse Condition="'$(MSBuildCacheCacheUniverse)' == ''">202310210737</MSBuildCacheCacheUniverse> | ||
|
||
<!-- | ||
Visual Studio telemetry reads various ApplicationInsights.config files and other files after the project is finished, likely in a detached process. | ||
This is acceptable and should not impact cache correctness. | ||
--> | ||
<MSBuildCacheAllowFileAccessAfterProjectFinishFilePatterns> | ||
$(MSBuildCacheAllowFileAccessAfterProjectFinishFilePatterns); | ||
\**\ApplicationInsights.config; | ||
$(LocalAppData)\Microsoft\VSApplicationInsights\**; | ||
$(LocalAppData)\Microsoft\Windows\INetCache\**; | ||
A:\; | ||
E:\; | ||
$(windir)\**; | ||
</MSBuildCacheAllowFileAccessAfterProjectFinishFilePatterns> | ||
|
||
<!-- | ||
This repo uses a common output directory with many projects writing duplicate outputs. Allow everything, but note this costs some performance in the form of requiring | ||
the cache to use copies instead of hardlinks when pulling from cache. | ||
--> | ||
<MSBuildCacheIdenticalDuplicateOutputPatterns>$(MSBuildCacheIdenticalDuplicateOutputPatterns);bin\**</MSBuildCacheIdenticalDuplicateOutputPatterns> | ||
|
||
<!-- version of MSBuildCache is not part of the cache key --> | ||
<PackagesConfigFile>$(MSBuildThisFileDirectory)\dep\nuget\packages.config</PackagesConfigFile> | ||
<MSBuildCacheIgnoredInputPatterns>$(MSBuildCacheIgnoredInputPatterns);$(PackagesConfigFile)</MSBuildCacheIgnoredInputPatterns> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(MSBuildCacheEnabled)' == 'true' and '$(MSBuildCachePackageRoot)' == ''"> | ||
<PackagesConfigContents>$([System.IO.File]::ReadAllText("$(PackagesConfigFile)"))</PackagesConfigContents> | ||
<MSBuildCachePackageVersion>$([System.Text.RegularExpressions.Regex]::Match($(PackagesConfigContents), 'Microsoft.MSBuildCache.*?version="(.*?)"').Groups[1].Value)</MSBuildCachePackageVersion> | ||
<MSBuildCachePackageRoot>$(MSBuildThisFileDirectory)packages\$(MSBuildCachePackageName).$(MSBuildCachePackageVersion)</MSBuildCachePackageRoot> | ||
<MSBuildCacheSharedCompilationPackageRoot>$(MSBuildThisFileDirectory)packages\Microsoft.MSBuildCache.SharedCompilation.$(MSBuildCachePackageVersion)</MSBuildCacheSharedCompilationPackageRoot> | ||
</PropertyGroup> | ||
|
||
<ImportGroup Condition="'$(MSBuildCacheEnabled)' == 'true'"> | ||
<Import Project="$(MSBuildCachePackageRoot)\build\$(MSBuildCachePackageName).props" /> | ||
<Import Project="$(MSBuildCacheSharedCompilationPackageRoot)\build\Microsoft.MSBuildCache.SharedCompilation.props" /> | ||
</ImportGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Project> | ||
<!-- | ||
NOTE! This file gets written-over entirely by the release builds. | ||
Any build logic in this file must be optional and only apply to non-release builds. | ||
--> | ||
|
||
<ImportGroup Condition="'$(MSBuildCacheEnabled)' == 'true'"> | ||
<Import Project="$(MSBuildCachePackageRoot)\build\$(MSBuildCachePackageName).targets" /> | ||
<Import Project="$(MSBuildCacheSharedCompilationPackageRoot)\build\Microsoft.MSBuildCache.SharedCompilation.targets" /> | ||
</ImportGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters