Skip to content

Commit 4391213

Browse files
authored
Prevent restore from deleting mibc cache file (#91220)
Restore should not remove the mibc cache file that is used to enable incrementalism when merging mibc files. This fixes an issue with the logic introduced in 454057d, which was tested on incremental builds without restore.
1 parent d5026a1 commit 4391213

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

eng/restore/optimizationData.targets

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project>
1+
<Project>
22
<ItemGroup>
33
<!-- Mibc data to use when exact architecture match is available -->
44
<MIBCPackageDef Include="optimization.windows_nt-x86.mibc.runtime" Version="$(optimizationwindows_ntx86MIBCRuntimeVersion)" MibcArchitecture="windows/x86"/>
@@ -25,14 +25,17 @@
2525
<Target Name="GetMIBCData"
2626
AfterTargets="Restore">
2727

28+
<PropertyGroup>
29+
<_MergeMibcFilesCacheFile>$(MibcOptimizationDataDir)/$(TargetOS)/$(TargetArchitecture)/merge_mibc_files.cache</_MergeMibcFilesCacheFile>
30+
</PropertyGroup>
2831
<ItemGroup>
2932
<MIBCPackage>
3033
<PackagePath>$(NuGetPackageRoot)%(MIBCPackage.Identity)/%(MIBCPackage.Version)</PackagePath>
3134
</MIBCPackage>
3235
<_optimizationMibcFile Include="%(MIBCPackage.PackagePath)/**/*.mibc" SubdirectoryName="$(TargetOS)/$(TargetArchitecture)" />
3336
<_optimizationMibcDestinationFile Include="@(_optimizationMibcFile->'$(MibcOptimizationDataDir)%(SubdirectoryName)/%(RecursiveDir)%(Filename)%(Extension)')" />
3437
<ExcessFilesCurrentlyPresent Include="$(MibcOptimizationDataDir)/**"
35-
Exclude="@(_optimizationMibcDestinationFile)"/>
38+
Exclude="@(_optimizationMibcDestinationFile);$(_MergeMibcFilesCacheFile)"/>
3639
</ItemGroup>
3740

3841
<Error Condition="'@(_optimizationMibcFile)' == ''" Text="Failed to restore Mibc optimization data" />

0 commit comments

Comments
 (0)