Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix oversharing of build results in ResultsCache - #9987

#9987
Merged
ladipro merged 14 commits into
dotnet:maindotnet/msbuild:mainfrom
ladipro:9458-build-cacheladipro/msbuild:9458-build-cacheCopy head branch name to clipboard
Apr 19, 2024
Merged

Fix oversharing of build results in ResultsCache#9987
ladipro merged 14 commits into
dotnet:maindotnet/msbuild:mainfrom
ladipro:9458-build-cacheladipro/msbuild:9458-build-cacheCopy head branch name to clipboard

Conversation

@ladipro

@ladipro ladipro commented Apr 10, 2024

Copy link
Copy Markdown
Member

Fixes #9458

Context

#9565 had to be reverted because the assumption that results with BuildRequestDataFlags.ProvideSubsetOfStateAfterBuild don't have to be cached broke design-time builds in Visual Studio.

Changes Made

Re-did the change, now with full handling of BuildRequestDataFlags.ProvideSubsetOfStateAfterBuild.

Testing

New and existing unit tests, experimental insertion, manual testing with the problematic design-time build scenario.

Notes

Compared to #9565, we now:

  • Copy the flags from the original BuildResult in the BuildResult copy constructor.
  • Have ProjectInstance remember the project state filter it was created from.
  • Implement IsSubsetOf operator on RequestedProjectState.
  • Use the IsSubsetOf to determine if a request with ProvideSubsetOfStateAfterBuild can be satisfied by the cache.
  • Don't consider SkipNonexistentTargets to be a flag affecting build results.

@ladipro
ladipro marked this pull request as ready for review April 11, 2024 12:42
Comment thread src/Build/BackEnd/Components/Caching/ResultsCache.cs Outdated
@ladipro

ladipro commented Apr 18, 2024

Copy link
Copy Markdown
Member Author

I have removed SkipNonexistentTargets from the flags that have to match. This is a cache of target results so if the target is there, it has to exist. Re-tested everything and will merge tomorrow if there are no objections.

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.

[Bug]: ResultsCache ignores some of the BuildRequest data, may return incorrect results

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.