You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CallTarget is listed in the migration epic (#11834) under "No Modifications Required (added attribute only)" but remains unchecked. It invokes other targets within the same project file by delegating to MSBuild.ExecuteTargets and MSBuild.CreateTargetLists.
The task has zero cwd-dependent operations:
No file system access of any kind
No Environment.CurrentDirectory, Path.GetFullPath, or environment variable usage
No ProcessStartInfo usage
All work is delegated to the MSBuild engine via BuildEngine3
Instance state is a single List<ITaskItem> for collecting target outputs
Already decorated with [RunInMTA], indicating awareness of threading concerns
This is the simplest possible migration — attribute-only with no code changes.
Approach
Apply the PR #13045 (attribute-only) pattern: add [MSBuildMultiThreadableTask] to the class declaration. No IMultiThreadableTask implementation is needed.
Decorate CallTarget with [MSBuildMultiThreadableTask].
No other code changes required.
ChangeWave consideration
No behavioral change. The attribute declares the task safe for multithreaded scheduling. Observable behavior is byte-identical. No ChangeWave needed.
Test coverage assessment
Existing unit tests
CallTarget is tested via integration tests that exercise target invocation, RunEachTargetSeparately, and output collection.
Gaps to fill in this PR
G1 — Concurrency test. Two CallTarget instances targeting different targets execute concurrently, asserting each collects correct, independent TargetOutputs. Verifies no shared mutable state interference.
G2 — Baseline parity. Verify all existing tests continue to pass. [Output] TargetOutputs items are identical before and after.
Acceptance criteria
CallTarget decorated with [MSBuildMultiThreadableTask].
No IMultiThreadableTask implementation (not needed).
All existing tests pass on net472 and net10.0.
[Output] TargetOutputs items have byte-identical ItemSpec and metadata.
Concurrency test (G1) added and passes.
No new compiler warnings (warnings-as-errors in official build).
multithreaded-task-migration SKILL sign-off checklist walked and passes.
Implementation order
Apply [MSBuildMultiThreadableTask] to CallTarget.
Add G1 (concurrency) test.
Run Tasks.UnitTests; verify clean.
Run repo build with -v quiet to ensure no new warnings.
Risks / open questions
CallTarget delegates to MSBuild.ExecuteTargets, which itself should be enlightened separately (tracked in Migrate Tasks in the MSbuild repo to the new Task type #11834 under "Tasks with simple transition"). The CallTarget migration is independent — it only declares that CallTarget itself has no thread-unsafe operations. The engine handles scheduling of the called targets.
The [RunInMTA] attribute is already present and compatible with [MSBuildMultiThreadableTask].
Enlighten CallTarget task for multithreaded mode
Parent: #11834
Context
CallTargetis listed in the migration epic (#11834) under "No Modifications Required (added attribute only)" but remains unchecked. It invokes other targets within the same project file by delegating toMSBuild.ExecuteTargetsandMSBuild.CreateTargetLists.The task has zero cwd-dependent operations:
Environment.CurrentDirectory,Path.GetFullPath, or environment variable usageProcessStartInfousageBuildEngine3List<ITaskItem>for collecting target outputs[RunInMTA], indicating awareness of threading concernsThis is the simplest possible migration — attribute-only with no code changes.
Approach
Apply the PR #13045 (attribute-only) pattern: add
[MSBuildMultiThreadableTask]to the class declaration. NoIMultiThreadableTaskimplementation is needed.CallTargetwith[MSBuildMultiThreadableTask].ChangeWave consideration
No behavioral change. The attribute declares the task safe for multithreaded scheduling. Observable behavior is byte-identical. No ChangeWave needed.
Test coverage assessment
Existing unit tests
CallTargetis tested via integration tests that exercise target invocation,RunEachTargetSeparately, and output collection.Gaps to fill in this PR
CallTargetinstances targeting different targets execute concurrently, asserting each collects correct, independentTargetOutputs. Verifies no shared mutable state interference.[Output] TargetOutputsitems are identical before and after.Acceptance criteria
CallTargetdecorated with[MSBuildMultiThreadableTask].IMultiThreadableTaskimplementation (not needed).net472andnet10.0.[Output] TargetOutputsitems have byte-identicalItemSpecand metadata.multithreaded-task-migrationSKILL sign-off checklist walked and passes.Implementation order
[MSBuildMultiThreadableTask]toCallTarget.Tasks.UnitTests; verify clean.-v quietto ensure no new warnings.Risks / open questions
CallTargetdelegates toMSBuild.ExecuteTargets, which itself should be enlightened separately (tracked in Migrate Tasks in the MSbuild repo to the new Task type #11834 under "Tasks with simple transition"). TheCallTargetmigration is independent — it only declares thatCallTargetitself has no thread-unsafe operations. The engine handles scheduling of the called targets.[RunInMTA]attribute is already present and compatible with[MSBuildMultiThreadableTask].References
.github/skills/multithreaded-task-migration/SKILL.md