Skip to content

Re-enable MSBuildCache #19084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
2 changes: 2 additions & 0 deletions .github/actions/spelling/expect/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ BKCOLOR
BKGND
BKMK
Bksp
blds
Blt
blu
BLUESCROLL
Expand Down Expand Up @@ -180,6 +181,7 @@ CLIPCHILDREN
CLIPSIBLINGS
closetest
cloudconsole
CLOUDT
cloudvault
CLSCTX
clsids
Expand Down
20 changes: 20 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@
A:\;
E:\;
$(windir)\**;
$(MSBuildBinPath)\**;
$(MSBuildToolsPath32)\**;
</MSBuildCacheAllowFileAccessAfterProjectFinishFilePatterns>

<!--
Unit tests may write to TEMP, but should not be considered outputs. However, $(Temp) is using the DOS path (C:\Users\CLOUDT~1\AppData\Local\Temp), which
isn't accounted for in these globs. So we're building up to TEMP using $(LOCALAPPDATA) instead.
-->
<MSBuildCacheAllowFileAccessAfterProjectFinishFilePatterns>
$(MSBuildCacheAllowFileAccessAfterProjectFinishFilePatterns);
$(LOCALAPPDATA)\Temp\**;
</MSBuildCacheAllowFileAccessAfterProjectFinishFilePatterns>

<!--
Expand All @@ -46,6 +57,15 @@
-->
<MSBuildCacheIdenticalDuplicateOutputPatterns>$(MSBuildCacheIdenticalDuplicateOutputPatterns);obj\*\vcpkg\**</MSBuildCacheIdenticalDuplicateOutputPatterns>

<!--
Ensure the MSBuildCache ignores collecting outputs under vcpkg's build tree, which is a working directory used to build vcpkg packages and not intended to be consumed by anything else in the build.
Note: We cannot use $(VcpkgInstalledDir) directly since it differs between projects, so use a pattern which encompasses all possibilities.
-->
<MSBuildCacheIgnoredOutputPatterns>
$(MSBuildCacheIgnoredOutputPatterns);
$(SolutionDir)\obj\*\vcpkg*\vcpkg\blds\**;
</MSBuildCacheIgnoredOutputPatterns>

<!-- version of MSBuildCache is not part of the cache key -->
<PackagesConfigFile>$(MSBuildThisFileDirectory)\dep\nuget\packages.config</PackagesConfigFile>
<MSBuildCacheIgnoredInputPatterns>$(MSBuildCacheIgnoredInputPatterns);$(PackagesConfigFile)</MSBuildCacheIgnoredInputPatterns>
Expand Down
2 changes: 1 addition & 1 deletion build/pipelines/ci-caching.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ stages:
buildEverything: true
keepAllExpensiveBuildOutputs: false
${{ if eq(variables['System.PullRequest.IsFork'], 'False') }}:
enableCaching: true
enableMsBuildCaching: true

- ${{ if eq(parameters.runTests, true) }}:
- stage: Test_${{ platform }}
Expand Down
8 changes: 8 additions & 0 deletions build/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ pr:
variables:
- name: runCodesignValidationInjectionBG
value: false
- name: EnablePipelineCache
value: true

# 0.0.yyMM.dd##
# 0.0.1904.0900
Expand All @@ -45,6 +47,10 @@ parameters:
- x64
- x86
- arm64
- name: enableMsBuildCaching
type: boolean
displayName: "Enable MSBuild Caching"
default: true

stages:
- ${{ if eq(parameters.auditMode, true) }}:
Expand Down Expand Up @@ -87,6 +93,8 @@ stages:
buildConfigurations: [Release]
buildEverything: true
keepAllExpensiveBuildOutputs: false
${{ if eq(variables['System.PullRequest.IsFork'], 'False') }}:
enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }}

- ${{ if eq(parameters.runTests, true) }}:
- stage: Test_${{ platform }}
Expand Down
10 changes: 5 additions & 5 deletions build/pipelines/templates-v2/job-build-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ parameters:
- name: signingIdentity
type: object
default: {}
- name: enableCaching
- name: enableMsBuildCaching
type: boolean
default: false

Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
}
displayName: Prepare Build and Sign Targets

- ${{ if eq(parameters.enableCaching, true) }}:
- ${{ if eq(parameters.enableMsBuildCaching, true) }}:
- pwsh: |-
$MSBuildCacheParameters = ""
$MSBuildCacheParameters += " -graph"
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:
configuration: $(BuildConfiguration)
msbuildArchitecture: x64
maximumCpuCount: true
${{ if eq(parameters.enableCaching, true) }}:
${{ if eq(parameters.enableMsBuildCaching, true) }}:
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)

Expand All @@ -192,7 +192,7 @@ jobs:
artifact: logs-$(BuildPlatform)-$(BuildConfiguration)${{ parameters.artifactStem }}
condition: always()
displayName: Publish Build Log
- ${{ if eq(parameters.enableCaching, true) }}:
- ${{ if eq(parameters.enableMsBuildCaching, true) }}:
- publish: $(Build.SourcesDirectory)\MSBuildCacheLogs
artifact: logs-msbuildcache-$(BuildPlatform)-$(BuildConfiguration)${{ parameters.artifactStem }}
condition: always()
Expand All @@ -203,7 +203,7 @@ jobs:
inputs:
contents: $(Build.SourcesDirectory)/msbuild.binlog
TargetFolder: $(Terminal.BinDir)
- ${{ if eq(parameters.enableCaching, true) }}:
- ${{ if eq(parameters.enableMsBuildCaching, true) }}:
- task: CopyFiles@2
displayName: Copy MSBuildCache Logs
inputs:
Expand Down
6 changes: 3 additions & 3 deletions dep/nuget/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<package id="Selenium.WebDriver" version="3.5.0" targetFramework="net45" />

<!-- MSBuildCache -->
<package id="Microsoft.MSBuildCache.AzurePipelines" version="0.1.283-preview" />
<package id="Microsoft.MSBuildCache.Local" version="0.1.283-preview" />
<package id="Microsoft.MSBuildCache.SharedCompilation" version="0.1.283-preview" />
<package id="Microsoft.MSBuildCache.AzurePipelines" version="0.1.318-preview" />
<package id="Microsoft.MSBuildCache.Local" version="0.1.318-preview" />
<package id="Microsoft.MSBuildCache.SharedCompilation" version="0.1.318-preview" />
</packages>
Loading