-
Notifications
You must be signed in to change notification settings - Fork 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
Report better warnings and errors if build hosts exit abnormally #71909
Report better warnings and errors if build hosts exit abnormally #71909
Conversation
This avoids having to flip to trace mode just to find the cause of the failure.
I'm not sure why this test is directly tesing MSBuildProjectLoder when we instead could have used the API that literally every other test uses.
This connects our various error reporting systems so failures of the build hosts can get passed along back to the existing reporting mechanism for MSBuildWorkspace failures.
56b4868
to
19751d7
Compare
_solutionServices = workspace.Services.SolutionServices; | ||
_diagnosticReporter = new DiagnosticReporter(workspace); | ||
_loggerFactory = DiagnosticReporterLoggerProvider.CreateLoggerFactoryForDiagnosticReporter(_diagnosticReporter); | ||
_pathResolver = new PathResolver(_diagnosticReporter); | ||
_projectFileExtensionRegistry = new ProjectFileExtensionRegistry(_solutionServices, _diagnosticReporter); |
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.
Trying to keep both constructors working was a getting a bit convoluted -- the nullable parameters to the other constructor existed only to make it possible to even write this as a :this() chain, and adding more nullable parameters to keep it going was just getting sillier too. So I'm just splitting into two, which ensures that the mainline use of the internal constructor is never getting a null from the other parts of the system.
This reports warnings or errors through the ILogger passed to the BuildHostProcessManager if a process exits abnormally, and includes the stderr of the process. Without this you'd be able to manually turn on tracing in VS Code, but that required extra steps to diagnose. This also allows us to pass warnings and errors through to MSBuildWorkspace, which otherwise didn't pass along this information.
Commit-at-a-time might be helpful, since an unrelated test got cleaned up during this change since it was written differently than the rest of all the tests.