-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Update System.CommandLine version #84229
Update System.CommandLine version #84229
Conversation
Tagging subscribers to this area: @hoyosjs Issue DetailsAdopting to the (ongoing) breaking changes..
|
@adamsitnik, fyi, I was expecting a small win in crossgen2 size, which is published as NaitveAOT app, but it has 203520 bytes size regression on osx-arm64-release after this update (HEAD vs. HEAD~1). 🙁 $ ./build.sh pack -c Release
$ stat -f%z artifacts/bin/coreclr/osx.arm64.Release/crossgen2/osx-arm64/publish/crossgen2
28680536 |
e8997f1
to
5cfc399
Compare
0da30e3
to
99c6f80
Compare
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.
@am11 WOW, thanks a lot for updating all the tools to the most recent System.CommandLine version!
The code looks great, I am going to hit the approve button, but I need to mark it as "NO MERGE" because we need to update few other repos that depend on S.CL and merge all the updates at once.
BTW @am11 do you have any feedback regarding the recent changes?
How did you like the switch from having multiple Option
ctors to one and using properties to initialize Description, custom parser and default value factory?
How do you feel about the removal of InvocationContext
and ParseResult
being the only input for SetAction
?
Was removing context.ExitCode
and returning an int from action intuitive?
CliOption<FileInfo> binOption = new("--bin") { Description = "Binary data to attach to the image" }; | ||
CliOption<FileInfo> imageOption = new("--image") { Description = "PE image to add the binary resource into" }; | ||
CliOption<string> nameOption = new("--name") { Description = "Resource name" }; | ||
var rootCommand = new CliRootCommand("Inject native resources into a Portable Executable image"); |
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.
nit: style consistency with other symbols ctor usage
var rootCommand = new CliRootCommand("Inject native resources into a Portable Executable image"); | |
CliRootCommand rootCommand = new("Inject native resources into a Portable Executable image"); |
That is very strange. The only thing that could cause size growth are new localizations moved from the SDK to S.CL in dotnet/command-line-api#2041 but I would definitely not expect them to take 20 MB! |
@jkotas stripped localization resources from runtime tools in #72478, does moving localization from SDK to S.CL have any effect on how
It's +200 KB difference, not 20 MB. 😉 Not a huge deal, but it was bit of a surprise. I was hoping / expecting that it will go the other way (a few hundred KBs would be shaved off with all the great refactoring, simplification, removal of dependencies / wrappers / indirections)
Overall, APIs name, shape and classification have improved. 👍 Some feedback:
It's good that we don't need to allocate an array for aliases
Love it! We don't have any usage beyond |
object val = res.CommandResult.GetValue(option); | ||
if (val is not null && !(descriptor.HasDefaultValue && descriptor.GetDefaultValue().Equals(val))) | ||
if (val is not null) |
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.
@adamsitnik, this was the functionality compromise. I couldn't find a way to obtain the default value of CliOption
.
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.
@am11 thank you for your feedback! I've opened dotnet/command-line-api#2218 to address that.
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.
Do we need a new release with that change? From latest build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=303826&view=results
I spoke to @adamsitnik offline and he tells me that this is still wanted, but it will be a month or so before we're ready to review for real. |
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.
@am11 could you please update to the provided version? We are very close to merging dotnet/sdk#29131 and I would love to merge this PR as soon as the SDK gets updated.
If you don't have the time please let me know, I can take it from here.
Thanks!
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.
@am11 could you please update to the provided version? We are very close to merging dotnet/sdk#29131 and I would love to merge this PR as soon as the SDK gets updated.
If you don't have the time please let me know, I can take it from here.
Thanks!
99c6f80
to
70426dd
Compare
Updated to |
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.
@am11 big thanks for working on this! I've found two things that we should address before merging. PTAL at my comments and let me know if you have the time to fix them.
object val = res.CommandResult.GetValue(option); | ||
if (val is not null && !(descriptor.HasDefaultValue && descriptor.GetDefaultValue().Equals(val))) | ||
if (val is not null) |
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.
@am11 thank you for your feedback! I've opened dotnet/command-line-api#2218 to address that.
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Build" Version="$(MicrosoftBuildVersion)" /> |
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.
thank you for replacing the hardcoded version 👍
The failure is unrelated: #87414 Please don't merge yet as we need to figure out the right order in dotnet/sdk#33157 |
…and-line-api-usage # Conflicts: # eng/Versions.props # src/coreclr/tools/aot/ILCompiler/ILCompilerRootCommand.cs # src/coreclr/tools/aot/crossgen2/Crossgen2RootCommand.cs
52a67e4
to
0b05310
Compare
The failure is unrelated (#42518 |
Adapting to the (ongoing) breaking changes..