-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Global vs. project tools (why two package formats?) #9640
Comments
The project based DotNetCliToolReference has issues that aren't solvable. A big one is that you can have conflicting dependencies between a tool and a package in your project. It also generally isn't clear why you have to build to restore your tools. We looked at these issues and npm in deciding on a new tool strategy. Our goal is the simplicity of the npm install experience. We decided to begin with the global tool scenario. Global tools (and CLI Repo tools when they appear) are based on "self contained packages" that are NuGet packages that carry all of their dependencies to guarantee an independent experience. This is inherently different from the project based DotNetCliToolReference, and thus we can't use the same packages. Our plan is that repo tools will use a manifest, allowing It to be checked in to the project. This is closer to the npm manifest. We're still designing repo tools so the is tentative. We are currently planning to have the packages installed (for repo tools) in the package cache and the manifest state the important thing for the project - the version that is required. This seems the best of the NuGet and npm experiences. We are still working on the plan for the manifest and whether another standalone file is needed :-( or we can combine this with other data about your project tooling - like We are not currently planning to support your middle option without manifest.
Can you describe a scenario where you would need this instead of global or repo-installed tools? When all of this is in place, meaning we have fully covered the current project-based DotNetCLIToolReference scenario, we will encourage use of the new approach, supporting the old for compatibility. If we can't meet that bar (and we expect to) we would either plug the gap or find an answer with the new style (self contained package, etc) of tool. Yes, our current implementation is awkward because it is in transition. |
This tells a much better story than what's evident in the available docs and issues. Thank you very much for summarizing the entire plan, I feel much better about the direction now. The transition will be a bit awkward, but it looks like we'll end up in a good place.
No - I had written this mainly to support the repo-installed scenario, which it sounds like will be covered using a manifest which is fine. And I'm happy to eliminate that first scenario (project-based build/restore) when a CLI command is available that "restores" your repo-installed tools. |
Going to close this issue given @KathleenDollard's answer above. |
I've seen some mentions of the differences between global tools (or really, "CLI tools" since global/local is a switch) and project tools (those that use
DotNetCliToolReference
) but I can't find much information on why we have to have two different kinds of tool packages.There's this comment:
But it doesn't expand on the "serious performance implications". I'd like to know more about the decision to bifurcate the NuGet tool distribution ecosystem.
Without additional context (which I'm hoping someone can provide here), this seems unnecessarily complex. I can think of three main ways in which someone might want to install a tool:
DotNetCliToolReference
, "repo tools"?).dotnet tool install ...
).dotnet tool install -g ...
).It make sense there needs to be both a MSBuild task and CLI support for tools delivered as packages to cover each of these scenarios. What doesn't make sense to me is why the packaging and production side of things needs to be different depending on the intended scenario (or why the tool author should even care about the consumer scenario at all in the first place). If I write a tool, why should it matter to me whether it's going to get installed as part of a restore or as a CLI global tool?
I have a few practical concerns with the current design:
-g
for the consumer to change behavior. The current .NET implementation of tools look very silly by comparison.The text was updated successfully, but these errors were encountered: