-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
TargetBuiltReason should have a field for InitialTargets #9467
Comments
@maridematte pls check if this is caused by same problem or unrelated: KirillOsenkov/MSBuildStructuredLog#762 |
Investigation results: We currently assign the
During this process we define if they're being pushed because of another target and assign either BeforeTargets , DependsOn or AfterTargets . However at that step we only have access to a list of targets to be built, but not which ones are the initial targets or the entry points for the build.The list of targets to build passed is a mix of initial targets, and the rest of the targets all joined together
To make the change requested here we would have to partially rewrite how targets are ordered to build, or do some pretty hacky stuff on the code and change all the tests to match, and we do not have the capacity for such a big change at the moment. Moving this to backlog for now. |
yes this is definitely very low priority. I understand why it would be hard to implement given the current implementation. Perhaps instead we should just log which targets are initial at the beginning. |
Or could we reconstruct the initial targets from the That should not require any contract change. |
Btw. is the I'm wondering whether the KirillOsenkov/MSBuildStructuredLog#762 is an MSBuild issue or Viewer issue. |
It looks like we populate it
but I wouldn't guarantee it is correct on the MSBuild side. |
I took a look and MSBuild is not setting the ParentTarget for AfterTargets for that particular case: |
Would be interesting to get to the bottom of this. We can use this bug or file a new one. |
Currently we liberally use
TargetBuiltReason.None
https://source.dot.net/#Microsoft.Build.Framework/TargetBuiltReason.cs,e71ba02076cc1555,references
Specifically we use None for InitialTargets, so it's hard to tell why a target was built:
Need to be careful about this check though:
msbuild/src/Build/BackEnd/Components/RequestBuilder/TargetBuilder.cs
Line 710 in f7f0b19
The text was updated successfully, but these errors were encountered: