You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.NET SDK & NuGet.Commandline.Xplat integration should be compile time and not runtime #13089
When commands like dotnet nuget push or dotnet nuget config, dotnet list package today are invoked, the .NET SDK's dotnet.exe process has it's own parsing, which later gets forwarded to a completely new runnable, NuGet.Commandline.Xplat, which pretty much duplicates all the arguments.
This leads to an unnecessary 2nd process, difficulty debugging, + lots of duplicate work.
The proposal here is to change this integration to a compile time one, where the SDK just calls methods of NuGet.Commandline.Xplat instead of shelling out to a completely new process.
changed the title [-].NET SDK & NuGet.Commandline.Xplat integration should be compile/not runtime[/-][+].NET SDK & NuGet.Commandline.Xplat integration should be compile time and not runtime[/+]on Dec 14, 2023
Love it :) The Template Engine used to have an integration like this before that integration moved completely into the SDK repo. The way it used to work is that the engine would ship a System.CommandLine.CliCommand-factory function and the SDK CLI would gather the dependencies for that factory, inject them, and then mount the CliCommand in its own grammar. This worked fairly well, but we had to keep on top of a few pain points:
common options/standards in CLI UX - things like option names and aliases
versions of System.CommandLine - since it is still in beta and making breaking changes, any updates to the S.CL library in one component could require orchestration across the other components. we still have that problem today (in fact Yanni just got done with the latest multi-repo sync).
but from an actual usability perspective it went pretty well! Alternatively, if NuGet wanted to move more of the CLI implementation of your commands into the SDK repo, we would likely also be happy to do that - with NuGet remaining primary owners of that particular 'slice' of the SDK.
Normally I'd say fewer repos we have to maintain the better, so my thought was the implementation stays here, since we have a lot of test helper code that I wouldn't want to copy on the SDK side. I hadn't considered the CLI command factory, that's actually probably the best long term thing, especially S.CL goes stable.
My original thinking was currently the SDK implementation does parsing and just flat out forwarding. Instead of that, the SDK could call a runner on our side with a type defined by NuGet.
That'd still be more manual, but it allows us to ignore the S.CL concerns.
My primary motivation was to get rid of the 2 process thing!
Activity
nkolev92 commentedon Dec 14, 2023
cc @zivkan, @dsplaisted @baronfel
[-].NET SDK & NuGet.Commandline.Xplat integration should be compile/not runtime[/-][+].NET SDK & NuGet.Commandline.Xplat integration should be compile time and not runtime[/+]baronfel commentedon Dec 14, 2023
Love it :) The Template Engine used to have an integration like this before that integration moved completely into the SDK repo. The way it used to work is that the engine would ship a System.CommandLine.CliCommand-factory function and the SDK CLI would gather the dependencies for that factory, inject them, and then mount the CliCommand in its own grammar. This worked fairly well, but we had to keep on top of a few pain points:
but from an actual usability perspective it went pretty well! Alternatively, if NuGet wanted to move more of the CLI implementation of your commands into the SDK repo, we would likely also be happy to do that - with NuGet remaining primary owners of that particular 'slice' of the SDK.
nkolev92 commentedon Dec 14, 2023
Normally I'd say fewer repos we have to maintain the better, so my thought was the implementation stays here, since we have a lot of test helper code that I wouldn't want to copy on the SDK side. I hadn't considered the CLI command factory, that's actually probably the best long term thing, especially S.CL goes stable.
My original thinking was currently the SDK implementation does parsing and just flat out forwarding. Instead of that, the SDK could call a runner on our side with a type defined by NuGet.
That'd still be more manual, but it allows us to ignore the S.CL concerns.
My primary motivation was to get rid of the 2 process thing!