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
Tool installation swallows NuGet warnings. #9028
Comments
I think the proper fix for this is to allow the nuget output to pass through from the internal restore operation like we do for other commands. I have a fix for this that adds a |
I don't like the idea to let nuget output pass through. I prefer to hide NuGet is underneath as possible and "translate" it to global tools specific on consumer side. Say, "restore failed on due to no such package" should translate to "install tool failed, no such tool named blah on nuget.org and myget.dotnet-core". Because we force user to understand nuget, how CLI use nuget to implement global tool and the notion of temp project (which is not the most ideal implementation). It is bad we swallow warnings, but I don't think let it pass through is the best solution at least not the default experience. |
I don't like the idea of translating specific NuGet warnings and errors into friendlier messages to hide the fact NuGet is being invoked behind the scenes. Not only would it be quite fragile, it makes it harder to diagnose problems that perhaps diagnostic-level output from NuGet could solve (i.e. |
I agree. I am not uncomfortable that folks are aware that NuGet is behind the implementation of how we acquire packages. They will have to push their packages to a NuGet feed for things to work anyways. Plus, if the NuGet messages are not good, then this should be an issue for NuGet to solve and not for us to work around it. |
If we assume the user need to understand the nuget is behind, there will be expectations come along with it. The versioning will be similar to nuget (different versions for different project), tools should share libraries, clean nuget cache should also clean tools, people can reference a tool package in csproj. It can help us on some topic, but when the experience diverge, it is more confusing. |
https://github.com/dotnet/cli/issues/8418#issuecomment-360302804 A relate issue, how to deal with error like the following?
|
It is a pretty ugly wall of text. Same thing actually on other verbs like pack though. I'm thinking of the warning on pack using a preview and you don't call your tool a preview. I especially dislike that the wall of text makes it hard to see our "Install failed" message in the command session. (there is more text before) and we don't have colors. We might need to talk about this tomorrow. My first instinct is that we need both, with the default being at least a bit abbreviated and a verbose version with info like the above. Does NuGet have any verbosity options? |
(pack error message will go away when we do final release/non preview. Make tool a preview will force the user type dotnet install tool -g mytool --version preview-123 , since nuget will not install preview version by default) |
With my proposed changes (see dotnet/cli#8486), the wall of text becomes something like:
With the verbosity set to
Failures related to an invalid tool settings file would end with:
The PR also corrects the behavior of showing command line help when we fail to install the tool (despite nothing being wrong with the command line syntax). |
Is it normal for verbosity on the CLI to be something other than "normal" by default? |
Sorry, I missed that this was visibility. Why aren't we using verbosity for this? |
We currently do the same default level for |
Erm, that was a commit message error of mine; it is |
Back to the question about the big wall of text being "normal" not "verbose" |
This is just the standard verbosity option used by the other commands which corresponds to (and is simply forwarded as) MSBuild's verbosity option. The default verbosity used in this case is |
Steps to reproduce
Install a tool that causes NuGet to output warnings, but no errors:
Expected behavior
The
install tool
command displays the warnings emitted by NuGet during tool installation.Actual behavior
No warnings are displayed.
Environment data
The text was updated successfully, but these errors were encountered: