-
Notifications
You must be signed in to change notification settings - Fork 1.1k
dotnet tool update does not throw but install when it is not installed #10205
Conversation
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.
I remember we have a bug asking for this. Could you find it and link it here?
https://github.com/dotnet/cli/issues/9850 They are related issue. I talked to Kathleen, we hope this change + local tools could be enough to give scripting with tools a smooth experience. This is considered a breaking change(throw to no throw), and we hope to do minimal. |
@dotnet-bot test Linux x64 Release Build |
Did this ship? I'm not seeing this behaviour. I think that #9850 is correct. For scripting purposes, it is ideal to have a one-liner that can try to install a tool and
All success cases with a zero exit code.
The idea that TL;DR: idempotence is good here. |
@AnthonySteele this will be in 3.0.1xx, still in preview. I tired to be "idempotence" in the beginning, and also hope it can solve the concurrency and roll back issue(in the end we still use traditional three-phase commit). But it is odd in this situation. By idempotence, if I run the same install command twice, it should give me the same result. However, what if there is 1 year in between and the package is updated, should it install the updated version? Since the feed keeps changing, the command is not the only input. So I chose "clear action". If it is an install command, there must be an install to happen. I do agree it made the scripting hard. This PR should achieve the one-liner to install a tool requirement by dotnet tool update. |
My first thought was that this would require a separate command for the new behaviour, e.g. |
To summarize this change:
The effect will be:
The operation will return zero in all of these cases. The operation will fail and return 1 if:
Note 1: We made this choice because a) the download is generally the slow part and must be done for us to correctly check the version and b) there are several scenarios where this will be helpful (install issues) and c) we think tools should be designed so repeated installs are not problematic. |
sorry to post on an old thread, but why couldn't this be "idempotent when a version is specified" (either on the command line or in a manifest)? |
No description provided.