Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

YuliiaKovalova
Copy link
Member

Add documentation about caching in MSBuild

@Copilot Copilot AI review requested due to automatic review settings May 22, 2025 09:59
Copy link
Contributor

@Copilot Copilot AI left a 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 alongside Scheduler, BuildResult, and BuildRequest.


* **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.
Copy link
Member

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?

Copy link
Member Author

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

if ((buildRequestDataFlags & FlagsAffectingBuildResults) != (buildResultDataFlags & FlagsAffectingBuildResults))
{
// Mismatch in flags that can affect build results -> not compatible.
return false;
}

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, done

@YuliiaKovalova YuliiaKovalova requested a review from surayya-MS May 26, 2025 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants