Migrate ResolveCodeAnalysisRuleSet to multithreaded execution#13636
Draft
jankratochvilcz wants to merge 1 commit into
Draft
Migrate ResolveCodeAnalysisRuleSet to multithreaded execution#13636jankratochvilcz wants to merge 1 commit into
jankratochvilcz wants to merge 1 commit into
Conversation
Adds [MSBuildMultiThreadableTask] and IMultiThreadableTask, routing ruleset and include-directory path resolution through TaskEnvironment.GetAbsolutePath so the task no longer depends on process CWD when running under multithreaded mode. Closes #13569. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
69 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates
ResolveCodeAnalysisRuleSetto support MSBuild's multithreaded execution model.Changes
[MSBuildMultiThreadableTask]applied; class implementsIMultiThreadableTaskwithTaskEnvironment = TaskEnvironment.Fallbackdefault.TaskEnvironment.GetAbsolutePath.Compatibility audit
Ran the 6-deadly-sins playbook (see
.github/skills/multithreaded-task-migration/SKILL.md):ResolvedCodeAnalysisRuleSetis assigned the originalCodeAnalysisRuleSetvalue or the unalteredPath.Combine(directory, CodeAnalysisRuleSet)joined string — noAbsolutePathis ever leaked into the output. Absolutization is used solely for theFile.Existsprobes.Compiler.UnableToFindRuleSetwarning continues to be formatted with the originalCodeAnalysisRuleSetuser input.Path.GetFullPath.CodeAnalysisRuleSetis short-circuited at the top before anyGetAbsolutePathcall, preserving the originalreturn nullbehavior. EmptyMSBuildProjectDirectoryis still gated by!string.IsNullOrEmptyso we never callGetAbsolutePathwith a degenerate combined path.Validation
Microsoft.Build.Tasks.csprojbuilds clean (0 warnings, 0 errors).ResolveAnalyzerRuleSet_Testspasses on bothnet10.0andnet472(12 tests × 2 TFMs = 24 passing).Part of #11834. Closes #13569.