Skip to content
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

MuxLogger drops evaluation events #4044

Closed
KirillOsenkov opened this issue Jan 4, 2019 · 6 comments · Fixed by #4048
Closed

MuxLogger drops evaluation events #4044

KirillOsenkov opened this issue Jan 4, 2019 · 6 comments · Fixed by #4048
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. triaged

Comments

@KirillOsenkov
Copy link
Member

New log events have been added in the recent time that the ConfigurableForwardingLogger doesn't know about:

ProjectImported
TargetSkipped

Without these events the binary logs produced by the Project System Tools extension don't have the imported files and some other details.

@KirillOsenkov
Copy link
Member Author

FYI @panopticoncentral I think this is one of the reasons why design-time and evaluation binlogs are missing information.

@KirillOsenkov KirillOsenkov added the Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. label Jan 4, 2019
@KirillOsenkov
Copy link
Member Author

Same for MuxLogger

@KirillOsenkov
Copy link
Member Author

Hmm, they both inherit from BuildMessage, not sure this is a bug... I will need to investigate a bit more.

@KirillOsenkov
Copy link
Member Author

MuxLogger drops all evaluation events because their Submission ID is -1.

See related:
dotnet/project-system-tools#59

@KirillOsenkov KirillOsenkov changed the title ConfigurableForwardingLogger needs support for ProjectImported and TargetSkipped events MuxLogger drops evaluation events Jan 4, 2019
@KirillOsenkov
Copy link
Member Author

I have a feeling that this line should be:
https://github.com/Microsoft/msbuild/blob/9781d968839ded744e18152f991d21eb6ce83862/src/Build/BackEnd/Components/RequestBuilder/RequestBuilder.cs#L1177

_requestEntry.Request.SubmissionId

because the _requestEntry.Request.BuildEventContext.SubmissionId is initialized to InvalidSubmissionId (-1) here:

https://github.com/Microsoft/msbuild/blob/9781d968839ded744e18152f991d21eb6ce83862/src/Build/BackEnd/BuildManager/BuildManager.cs#L1044

As a result, all evaluation events in MuxLogger are filtered out here:
https://github.com/Microsoft/msbuild/blob/9781d968839ded744e18152f991d21eb6ce83862/src/Utilities/MuxLogger.cs#L619
because their SubmissionId == -1 (InvalidSubmissionId).

@KirillOsenkov
Copy link
Member Author

Aha, @panopticoncentral I'm noticing you're creating the BuildEventContext here:
2567cc4#diff-bdf00235edf97c9c3348192ae267b0bdR1172

as part of this PR: #2748.

I think we need to be taking the SubmissionID directly from the _requestEntry.Request.

What do you think? I think this would explain the evaluation events missing from the design-time build logs.

KirillOsenkov added a commit to KirillOsenkov/msbuild that referenced this issue Jan 6, 2019
Fix dotnet#4044. The symptom of the issue is that design-time build logs (such as those obtained from Project System Tools) do not have evaluation messages or imported projects/targets. This is because the MuxLogger used by Microsoft.VisualStudio.ProjectServices.dll drops all build messages where the submission ID is not equal to the current submission ID of the logger. All evaluation messages had the submission ID set to -1 and they were all dropped.

To fix this we need to propagate the submission Id from the build request so that all log events (including evaluation messages) have a proper submission Id set. The way it is right now the BuildEventContext is Invalid, so the Submission ID is set to -1.

With this change the Submission ID is set correctly and I've verified that the evaluation messages are not being discarded by the MuxLogger.
rainersigwald pushed a commit that referenced this issue Jan 14, 2019
Fix #4044. The symptom of the issue is that design-time build logs (such as those obtained from Project System Tools) do not have evaluation messages or imported projects/targets. This is because the MuxLogger used by Microsoft.VisualStudio.ProjectServices.dll drops all build messages where the submission ID is not equal to the current submission ID of the logger. All evaluation messages had the submission ID set to -1 and they were all dropped.

To fix this we need to propagate the submission Id from the build request so that all log events (including evaluation messages) have a proper submission Id set. The way it is right now the BuildEventContext is Invalid, so the Submission ID is set to -1.

With this change the Submission ID is set correctly and I've verified that the evaluation messages are not being discarded by the MuxLogger.
@AR-May AR-May added the triaged label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants