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

Report better warnings and errors if build hosts exit abnormally #71909

Merged

Conversation

jasonmalinowski
Copy link
Member

@jasonmalinowski jasonmalinowski commented Feb 1, 2024

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.

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.
@jasonmalinowski jasonmalinowski removed the untriaged Issues and PRs which have not yet been triaged by a lead label Feb 1, 2024
Comment on lines +62 to +66
_solutionServices = workspace.Services.SolutionServices;
_diagnosticReporter = new DiagnosticReporter(workspace);
_loggerFactory = DiagnosticReporterLoggerProvider.CreateLoggerFactoryForDiagnosticReporter(_diagnosticReporter);
_pathResolver = new PathResolver(_diagnosticReporter);
_projectFileExtensionRegistry = new ProjectFileExtensionRegistry(_solutionServices, _diagnosticReporter);
Copy link
Member Author

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.

@jasonmalinowski jasonmalinowski marked this pull request as ready for review February 2, 2024 05:20
@jasonmalinowski jasonmalinowski requested a review from a team as a code owner February 2, 2024 05:20
@jasonmalinowski jasonmalinowski merged commit f536ae1 into dotnet:main Feb 5, 2024
25 of 28 checks passed
@jasonmalinowski jasonmalinowski deleted the log-buildhost-process-exits branch February 5, 2024 21:15
@ghost ghost added this to the Next milestone Feb 5, 2024
@jjonescz jjonescz modified the milestones: Next, 17.10 P2 Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants