Skip to content

[watch] Fix /bl option parsing, use it for build logging #50002

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

Merged
merged 2 commits into from
Aug 5, 2025

Conversation

tmat
Copy link
Member

@tmat tmat commented Jul 30, 2025

The option is now forwarded to the command dotnet-watch is executing (dotnet run, dotnet test, etc.) and also used for logging dotnet-watch invoked build operations: dotnet build and design-time build.

@tmat tmat changed the title Fix /bl option parsing, use it for build logging watch: Fix /bl option parsing, use it for build logging Jul 30, 2025
@tmat tmat changed the title watch: Fix /bl option parsing, use it for build logging [watch] Fix /bl option parsing, use it for build logging Jul 30, 2025
@tmat tmat marked this pull request as ready for review July 30, 2025 20:11
@Copilot Copilot AI review requested due to automatic review settings July 30, 2025 20:11
@tmat tmat requested a review from a team as a code owner July 30, 2025 20:11
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the parsing of the /bl (binary logger) option in dotnet-watch and enables proper build logging functionality. The changes address issues with how binary logger arguments were handled and ensure consistent logging across different build operations.

Key changes:

  • Fixed binary logger option parsing to handle various /bl formats correctly
  • Updated all BuildReporter instantiations to accept GlobalOptions parameter for binary logging configuration
  • Added proper binary log file filtering to prevent watch loops on generated log files

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
CommandLineOptions.cs Added binary logger option parsing and forwarding logic with proper MSBuild argument formatting
GlobalOptions.cs Added BinaryLogPath property to store binary logger configuration
EnvironmentOptions.cs Modified GetBinLogPath method to use GlobalOptions instead of test-specific logic
BuildReporter.cs Updated constructor to accept GlobalOptions parameter for binary logging
Multiple test files Updated BuildReporter instantiations to include new GlobalOptions parameter
HotReloadDotNetWatcher.cs Added binary log file filtering and removed hardcoded test binary log arguments
WatchableApp.cs Updated default watch arguments to use simpler -bl format
Comments suppressed due to low confidence (2)

test/dotnet-watch.Tests/CommandLine/EnvironmentOptionsTests.cs:6

  • The class name 'BuildReporterTests' doesn't match the file name 'EnvironmentOptionsTests.cs'. Either rename the class to 'EnvironmentOptionsTests' or move it to a file named 'BuildReporterTests.cs'.
public class BuildReporterTests

src/BuiltInTools/dotnet-watch/CommandLine/CommandLineOptions.cs:264

  • There's an extra closing brace here that doesn't match the opening structure, creating unbalanced braces in the control flow.
                }

@tmat
Copy link
Member Author

tmat commented Aug 1, 2025

@baronfel ptal

@tmat tmat merged commit 5a41589 into dotnet:main Aug 5, 2025
27 checks passed
@tmat tmat deleted the binlogs branch August 5, 2025 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants