Skip to content

Commit 3714d22

Browse files
committed
Re-enable MSBuildCache
1 parent 7ab5978 commit 3714d22

File tree

7 files changed

+39
-9
lines changed

7 files changed

+39
-9
lines changed

.github/actions/spelling/expect/expect.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ BKCOLOR
115115
BKGND
116116
BKMK
117117
Bksp
118+
blds
118119
Blt
119120
blu
120121
BLUESCROLL
@@ -180,6 +181,7 @@ CLIPCHILDREN
180181
CLIPSIBLINGS
181182
closetest
182183
cloudconsole
184+
CLOUDT
183185
cloudvault
184186
CLSCTX
185187
clsids

Directory.Build.props

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@
3333
A:\;
3434
E:\;
3535
$(windir)\**;
36+
$(MSBuildBinPath)\**;
37+
$(MSBuildToolsPath32)\**;
38+
</MSBuildCacheAllowFileAccessAfterProjectFinishFilePatterns>
39+
40+
<!--
41+
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
42+
isn't accounted for in these globs. So we're building up to TEMP using $(LOCALAPPDATA) instead.
43+
-->
44+
<MSBuildCacheAllowFileAccessAfterProjectFinishFilePatterns>
45+
$(MSBuildCacheAllowFileAccessAfterProjectFinishFilePatterns);
46+
$(LOCALAPPDATA)\Temp\**;
3647
</MSBuildCacheAllowFileAccessAfterProjectFinishFilePatterns>
3748

3849
<!--

build/pipelines/ci-caching.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ stages:
8484
buildEverything: true
8585
keepAllExpensiveBuildOutputs: false
8686
${{ if eq(variables['System.PullRequest.IsFork'], 'False') }}:
87-
enableCaching: true
87+
enableMsBuildCaching: true
8888

8989
- ${{ if eq(parameters.runTests, true) }}:
9090
- stage: Test_${{ platform }}

build/pipelines/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ pr:
2525
variables:
2626
- name: runCodesignValidationInjectionBG
2727
value: false
28+
- name: EnablePipelineCache
29+
value: true
2830

2931
# 0.0.yyMM.dd##
3032
# 0.0.1904.0900
@@ -45,6 +47,10 @@ parameters:
4547
- x64
4648
- x86
4749
- arm64
50+
- name: enableMsBuildCaching
51+
type: boolean
52+
displayName: "Enable MSBuild Caching"
53+
default: true
4854

4955
stages:
5056
- ${{ if eq(parameters.auditMode, true) }}:
@@ -87,6 +93,8 @@ stages:
8793
buildConfigurations: [Release]
8894
buildEverything: true
8995
keepAllExpensiveBuildOutputs: false
96+
${{ if eq(variables['System.PullRequest.IsFork'], 'False') }}:
97+
enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }}
9098

9199
- ${{ if eq(parameters.runTests, true) }}:
92100
- stage: Test_${{ platform }}

build/pipelines/templates-v2/job-build-project.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ parameters:
6868
- name: signingIdentity
6969
type: object
7070
default: {}
71-
- name: enableCaching
71+
- name: enableMsBuildCaching
7272
type: boolean
7373
default: false
7474

@@ -144,7 +144,7 @@ jobs:
144144
}
145145
displayName: Prepare Build and Sign Targets
146146
147-
- ${{ if eq(parameters.enableCaching, true) }}:
147+
- ${{ if eq(parameters.enableMsBuildCaching, true) }}:
148148
- pwsh: |-
149149
$MSBuildCacheParameters = ""
150150
$MSBuildCacheParameters += " -graph"
@@ -183,7 +183,7 @@ jobs:
183183
configuration: $(BuildConfiguration)
184184
msbuildArchitecture: x64
185185
maximumCpuCount: true
186-
${{ if eq(parameters.enableCaching, true) }}:
186+
${{ if eq(parameters.enableMsBuildCaching, true) }}:
187187
env:
188188
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
189189

@@ -192,7 +192,7 @@ jobs:
192192
artifact: logs-$(BuildPlatform)-$(BuildConfiguration)${{ parameters.artifactStem }}
193193
condition: always()
194194
displayName: Publish Build Log
195-
- ${{ if eq(parameters.enableCaching, true) }}:
195+
- ${{ if eq(parameters.enableMsBuildCaching, true) }}:
196196
- publish: $(Build.SourcesDirectory)\MSBuildCacheLogs
197197
artifact: logs-msbuildcache-$(BuildPlatform)-$(BuildConfiguration)${{ parameters.artifactStem }}
198198
condition: always()
@@ -203,7 +203,7 @@ jobs:
203203
inputs:
204204
contents: $(Build.SourcesDirectory)/msbuild.binlog
205205
TargetFolder: $(Terminal.BinDir)
206-
- ${{ if eq(parameters.enableCaching, true) }}:
206+
- ${{ if eq(parameters.enableMsBuildCaching, true) }}:
207207
- task: CopyFiles@2
208208
displayName: Copy MSBuildCache Logs
209209
inputs:

dep/nuget/packages.config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<package id="Selenium.WebDriver" version="3.5.0" targetFramework="net45" />
2121

2222
<!-- MSBuildCache -->
23-
<package id="Microsoft.MSBuildCache.AzurePipelines" version="0.1.283-preview" />
24-
<package id="Microsoft.MSBuildCache.Local" version="0.1.283-preview" />
25-
<package id="Microsoft.MSBuildCache.SharedCompilation" version="0.1.283-preview" />
23+
<package id="Microsoft.MSBuildCache.AzurePipelines" version="0.1.318-preview" />
24+
<package id="Microsoft.MSBuildCache.Local" version="0.1.318-preview" />
25+
<package id="Microsoft.MSBuildCache.SharedCompilation" version="0.1.318-preview" />
2626
</packages>

src/common.build.pre.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,15 @@
292292
<VcpkgRoot Condition="'$(VcpkgRoot)'==''">$(VsInstallRoot)\VC\vcpkg</VcpkgRoot>
293293
<VcpkgRoot Condition="'$(VcpkgRoot)'=='' or !Exists('$(VcpkgRoot)\vcpkg.exe')">$(SolutionDir)\dep\vcpkg</VcpkgRoot>
294294

295+
<!--
296+
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.
297+
Note: We cannot use $(VcpkgInstalledDir) directly since it differs between projects, so use a pattern which encompasses both.
298+
-->
299+
<MSBuildCacheIgnoredOutputPatterns>
300+
$(MSBuildCacheIgnoredOutputPatterns);
301+
$(SolutionDir)\obj\*\vcpkg*\vcpkg\blds\**;
302+
</MSBuildCacheIgnoredOutputPatterns>
303+
295304
<CAExcludePath>$(CAExcludePath);$(VcpkgInstalledDir)</CAExcludePath>
296305

297306
<!-- For now, don't allow global-per-user installs of vcpkg -->

0 commit comments

Comments
 (0)