Skip to content

migrate PickBestRid#54489

Draft
AlesProkop wants to merge 1 commit into
dotnet:mainfrom
AlesProkop:migrate-pick-best-rid
Draft

migrate PickBestRid#54489
AlesProkop wants to merge 1 commit into
dotnet:mainfrom
AlesProkop:migrate-pick-best-rid

Conversation

@AlesProkop
Copy link
Copy Markdown
Member

Summary

Migrates PickBestRid to MSBuild's multithreaded task execution model by opting into IMultiThreadableTask and routing path resolution through TaskEnvironment.

Changes

PickBestRid.cs

  • Added [MSBuildMultiThreadableTask] and implemented IMultiThreadableTask with TaskEnvironment = TaskEnvironment.Fallback.
  • Resolved RuntimeGraphPath via TaskEnvironment.GetAbsolutePath(...) before File.Exists and RuntimeGraphCache.GetRuntimeGraph.
  • Kept the original RuntimeGraphPath in error messages (no absolutized leak).

GivenAPickBestRidMultiThreading.cs (new) — 4 correctness tests:

Test Guards against
ItResolvesRelativeRuntimeGraphPathAgainstProjectDirectory Path resolution falling back to process CWD.
MatchingRidOutputContainsOnlyRidNoPathPrefix Absolutized path leaking into the MatchingRid output.
MissingFileErrorContainsOriginalRelativePathNotAbsolutized Error-message path inflation.
ItProducesIdenticalOutcomeInFallbackAndIsolatedModes_Success Behavior parity between Fallback and isolated TaskEnvironment.

Validation

  • MSBuild Thread-Safe Task Analyzer: 0 diagnostics on PickBestRid.cs.
  • New tests: 4/4 pass. Existing GivenAPickBestRid tests: 6/6 still pass.

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.

1 participant