-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[wip] TaskHost IBuildEngine Callback Support spec for discussion #12868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
rainersigwald
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks pretty good.
Should we add any ETW events as part of this? What about telemetry?
| ## 1. Problem Statement | ||
|
|
||
| The MSBuild TaskHost (`OutOfProcTaskHostNode`) implements `IBuildEngine10` but lacks support for several callbacks. TaskHost is used when: | ||
| 1. **`MSBUILDFORCEALLTASKSOUTOFPROC=1`** with `-mt` mode - forces non-thread-safe tasks out-of-proc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't these separate cases?
| 1. **`MSBUILDFORCEALLTASKSOUTOFPROC=1`** with `-mt` mode - forces non-thread-safe tasks out-of-proc | |
| 1. **`MSBUILDFORCEALLTASKSOUTOFPROC=1`** | |
| 2. `-mt` mode - forces non-thread-safe tasks out-of-proc |
| - A) Forward to parent and actually yield (allows scheduler to run other work) | ||
| - B) Keep as no-op (current behavior, safest) | ||
|
|
||
| **Recommendation:** (B) initially - Yield/Reacquire are rarely used by tasks, and current no-op behavior has shipped. Revisit if real-world need arises. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, though I think the most expensive tasks do tend to yield. Definitely something that can wait.
|
|
||
| | Phase | Scope | Risk | Effort | | ||
| |-------|-------|------|--------| | ||
| | 1 | `IsRunningMultipleNodes` | Low | 2 days | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still unsure if this is worth forwarding the request along vs hardcoding "yeah if you're in this mode assume parallelism".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is -mt /m:1 (or just /mt for msbuild.exe) the only way to hit this condition? What is the practical impact on the Tasks we have that use IsRunningMultipleNodes? Do we know if any 1P Tasks care about this condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's /m:1 + a taskhost for any reason (mt + unenlightened task, env var that forces everything to a task host, explicit taskhost request in usingtask).
I can't imagine that it's widely used. I see one use in our repo in the task version of the MSBuild task that changes how StopOnFirstFailure works, which is itself a silly thing to do . . .
| | 1 | `IsRunningMultipleNodes` | Low | 2 days | | ||
| | 2 | `RequestCores`/`ReleaseCores` | Medium | 3 days | | ||
| | 3 | `Yield`/`Reacquire` | Medium | 3 days | | ||
| | 4 | `BuildProjectFile*` | High | 5-7 days | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BuildProjectFile is the most critical one, for XAML, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SimaTian is that the one you hit in roslyn?
#12863
Changes Made
spec only