-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add documentation about caching in MSBuild #11880
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
base: main
Are you sure you want to change the base?
Add documentation about caching in MSBuild #11880
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a detailed documentation page explaining the new MSBuild ResultsCache
feature, how it stores and retrieves build outcomes, interacts with request flags, and integrates with other MSBuild components.
- Introduces
Results-Cache.md
with an overview, core responsibilities, flag behaviors, and component interactions. - Includes a flow diagram placeholder and deep dives into build flags and cache compatibility.
- Describes how
ResultsCache
works alongsideScheduler
,BuildResult
, andBuildRequest
.
documentation/wiki/Results-Cache.md
Outdated
|
||
* **Flags Affecting Build Behavior:** | ||
* `IgnoreMissingEmptyAndInvalidImports`: This flag changes how MSBuild handles project imports. If a cached outcome was generated with a different setting for this flag than the current request, the cache might consider it a mismatch because the project evaluation could have been different. | ||
* `FailOnUnresolvedSdk`: Similar to the imports flag, this affects SDK resolution. A cached outcome from a build with a different SDK resolution strategy might not be reusable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under what circumstances will it be reusable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cached build had FailOnUnresolvedSdk
flag set and the current build request had it set too
msbuild/src/Build/BackEnd/Components/Caching/ResultsCache.cs
Lines 363 to 367 in f88eb76
if ((buildRequestDataFlags & FlagsAffectingBuildResults) != (buildResultDataFlags & FlagsAffectingBuildResults)) | |
{ | |
// Mismatch in flags that can affect build results -> not compatible. | |
return false; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we state that explicitly then please? The sentence is somewhat weird. I'm not sure about "might" in the context of the documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, done
Add documentation about caching in MSBuild