Migrate GetAssembliesMetadata to multithreaded execution - #13637
Merged
jankratochvilcz merged 2 commits intoAug 3, 2026
Conversation
68 tasks
Adds [MSBuildMultiThreadableTask] and IMultiThreadableTask, routing assembly file access through TaskEnvironment.GetAbsolutePath so the task can run on a thread node without depending on process CWD. Closes #13570. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jankratochvilcz
force-pushed
the
jankratochvilcz/multithreaded/get-assemblies-metadata
branch
from
July 7, 2026 14:42
15c2243 to
c6a1b8f
Compare
jankratochvilcz
marked this pull request as ready for review
July 7, 2026 16:19
Copilot stopped reviewing on behalf of
jankratochvilcz due to an error
July 7, 2026 16:21
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates GetAssembliesMetadata to be MSBuild multi-threadable and improves path handling to avoid exceptions while preserving output item behavior.
Changes:
- Marked the task as multi-threadable and added
TaskEnvironmentsupport. - Added guarding for null/empty assembly path entries before path resolution.
- Resolved assembly paths to absolute paths for file existence checks and metadata reading while attempting to preserve original output ItemSpec behavior.
…ments Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
AlesProkop
approved these changes
Jul 31, 2026
AlesProkop
left a comment
Member
There was a problem hiding this comment.
Consider adding a decoy test to expand test coverage.
jankratochvilcz
enabled auto-merge (squash)
July 31, 2026 12:54
auto-merge was automatically disabled
July 31, 2026 12:56
Pull request was closed
OvesN
approved these changes
Jul 31, 2026
jankratochvilcz
deleted the
jankratochvilcz/multithreaded/get-assemblies-metadata
branch
August 3, 2026 09:47
jankratochvilcz
added a commit
that referenced
this pull request
Aug 3, 2026
The migration (#13637) is now in main. This adds the regression test that proves a relative AssemblyPaths entry resolves against the TaskEnvironment project directory rather than the process current directory, and that the resulting ItemSpec keeps the caller-supplied relative path. The test mutates the process-wide current directory, so it lives in its own parallelization-disabled collection instead of serializing the whole GetAssembliesMetadata_Tests class. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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
GetAssembliesMetadatato support MSBuild's multithreaded execution model.Changes
[MSBuildMultiThreadableTask]applied; class implementsIMultiThreadableTaskwithTaskEnvironment = TaskEnvironment.Fallbackdefault.TaskEnvironment.GetAbsolutePathbeforeMetadataReader-based access (AssemblyInformationopens the file viaFile.OpenRead/OpenScope/ native metadata reads, all of which need an absolute path on a thread node).Compatibility audit
Ran the 6-deadly-sins playbook (see
.github/skills/multithreaded-task-migration/SKILL.md):AssembliesMetadata[i].ItemSpecis sourced fromAssemblyAttributes.AssemblyFullPath, whichAssemblyInformationinitializes from the path passed into its constructor. To avoid leaking the absolutized path into the output items (which would change the user-observableItemSpec), we overwriteattributes.AssemblyFullPathwithabsoluteAssemblyPath.OriginalValuebefore constructing theTaskItem.Execute.FileSystems.Default.FileExistsdoes not require canonical form.FileSystems.Default.FileExistswhich silently returnedfalseand skipped them;GetAbsolutePath("")would now throwArgumentExceptionand abort the entire batch. Guarded withstring.IsNullOrEmpty(assemblyPath) -> continueto preserve original skip-silently semantics.Validation
Microsoft.Build.Tasks.csprojbuilds clean (0 warnings, 0 errors).GetAssembliesMetadata-filtered tests pass (2/2 on net472 — the test class is#if NETFRAMEWORK-gated, so net10.0 has no tests for this task).Part of #11834. Closes #13570.