dotnet / dotnet/msbuild

Serialization of Targets when awaiting for a single target

Open
#7,864 7 comments 0 reactions 0 assignees View on GitHub
Area: Engine Area: Performance bug Partner request triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

### Issue Description
An behavior when building a "Fast" and "Slow" target, when a project reference for "Fast" target, the build waits for both "Fast" and "Slow" to finish. This blocks P2P from continuing when "Fast" is done.

![image](https://user-images.githubusercontent.com/19828377/183220710-6bb3e584-f1b2-4ff6-8314-a4f89b1eda8f.png)

With a bad workaround,
![image](https://user-images.githubusercontent.com/19828377/183220771-9119b7e5-bdae-49ff-8c97-0ae2942eb88b.png)

### Steps to Reproduce
Attached binlog with projects. [BuildWorkers.zip](https://github.com/dotnet/msbuild/files/9273865/BuildWorkers.zip)

msbuild.exe /m Solution.proj

### Expected Behavior
I expect "Slow" targets from both worker projects to run in parallel. The "fast" target will stagger because of the project dependency.

### Actual Behavior
I see that Worker1.proj runs "Fast+Slow" targets, then Worker2.proj "Fast+Slow" in serialization.

### Analysis
No Idea.

### Versions & Configurations
Repros in VS2022 and VS2019, probably even earlier.

Contributor guide

No contributing guide indexed for this repository

Research direction

Unpack BuildWorkers.zip and run msbuild.exe /m Solution.proj to reproduce the scheduling behavior across Solution.proj, Worker1.proj, and Worker2.proj. Compare the expected parallel Slow targets and staggered Fast targets with the serialized actual behavior, then use the binlog to trace where target waiting is introduced. Done means the Fast project reference no longer blocks unrelated Slow targets.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.