-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Make file-based caching opt out work for the basic up-to-date check too #50927
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
Make file-based caching opt out work for the basic up-to-date check too #50927
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
This PR modifies the file-based caching opt-out mechanism to apply to both the basic up-to-date check and CSC argument caching, rather than just the latter. The change ensures that when FileBasedProgramCanSkipMSBuild=false is set, the system will always perform a full build instead of using any cached optimization.
- Moves the opt-out check to apply to all caching decisions, not just CSC argument caching
- Updates test cases to verify the opt-out behavior works for all optimization levels
- Updates documentation to clarify the scope of the opt-out property
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs | Moves the FileBasedProgramCanSkipMSBuild check to encompass all caching operations |
| test/dotnet.Tests/CommandTests/Run/RunFileTests.cs | Enhances existing tests to verify opt-out behavior across different build scenarios |
| documentation/general/dotnet-run-file.md | Updates documentation to clarify the broader scope of the opt-out property |
|
@RikkiGibson @333fred @MiYanni for reviews, thanks |
|
|
||
| Build(testInstance, optOut ? BuildLevel.All : BuildLevel.Csc, expectedOutput: optOut ? "[MyString, UpdatedValue]" : "Resource not found"); | ||
|
|
||
| Build(testInstance, BuildLevel.All, ["--no-cache"], expectedOutput: "[MyString, UpdatedValue]"); |
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.
Is the resource found if we build at BuildLevel.Csc after this?
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.
Yes, it should be, I will extend the test, thanks.
| } | ||
|
|
||
| void TryCacheCscArguments(CacheInfo cache, BuildResult result, ProjectInstance projectInstance) | ||
| void TryCacheCscArguments(CacheInfo cache, BuildResult result) |
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.
Consider renaming this method: the Try prefix normally implies that there's a bool result for success.
Part of #50912.