Skip to content

Add parsing and flag for -bl for MSbuild-related commands#43322

Closed
baronfel wants to merge 2 commits intodotnet:release/9.0.1xxfrom
baronfel:binlog-flag
Closed

Add parsing and flag for -bl for MSbuild-related commands#43322
baronfel wants to merge 2 commits intodotnet:release/9.0.1xxfrom
baronfel:binlog-flag

Conversation

@baronfel
Copy link
Copy Markdown
Member

Fix #43310 by explicitly modeling the flag (including argument parsing as described/implemented by MSBuild).

cc @rainersigwald for more MSBuild arg bindings

@baronfel baronfel requested a review from a team as a code owner September 10, 2024 17:54
@ghost ghost added Area-CLI untriaged Request triage from a team member labels Sep 10, 2024
}

static void InvokeRunArgumentsTarget(ProjectInstance project, string[] restoreArgs, VerbosityOptions? verbosity)
static void InvokeRunArgumentsTarget(ProjectInstance project, string[] restoreArgs, BinlogArgs? binlogArgs, VerbosityOptions? verbosity)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@mariam-abdulla here's how I used the bl option to correctly forward along binlog information. Add the option to your parser, get the value from the parser, and then use the data structure to create the BinaryLogger you need (if any).

@baronfel baronfel requested a review from a team September 10, 2024 18:03
Comment thread src/Cli/dotnet/CommonOptions.cs Outdated
@baronfel
Copy link
Copy Markdown
Member Author

This is what I was afraid of - we can't define -bl in a safe way it seems with System.CommandLine.

-bl can be supplied as a flag and as an option that has some configuration: a binlog filename to create and/or a directive how to manage the files that are imported into the binlog. We can't enforce the MSbuild syntax requirement here of -bl:<stuff> because System.CommandLine also allows -bl <stuff>. We can't use the OnlyTake mechanism inside the option for some implementation reason. So we're stuck here and what we'll have to do for run and test is fall back to manual scraping of the string[] of unbound args.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-CLI untriaged Request triage from a team member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants