-
Notifications
You must be signed in to change notification settings - Fork 139
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
Only upgrade .NET tools when an update is available instead of reinstalling everytime #575
base: main
Are you sure you want to change the base?
Only upgrade .NET tools when an update is available instead of reinstalling everytime #575
Conversation
98082d3
to
7de90be
Compare
So even if an update is not available, |
I just tried it on my host, and it seems that $ dotnet tool list --global
Package Id Version Commands
--------------------------------------------
dotnet-dump 7.0.447801 dotnet-dump
$ stat ~/.dotnet/tools/dotnet-dump
File: /home/steve/.dotnet/tools/dotnet-dump
Size: 97448 Blocks: 192 IO Block: 4096 regular file
Device: 0,41 Inode: 2044812 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 1000/ steve) Gid: ( 1000/ steve)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2023-10-14 19:41:35.939916631 +0800
Modify: 2023-10-14 19:41:35.938916648 +0800
Change: 2023-10-14 19:41:35.946916515 +0800
Birth: 2023-10-14 19:41:35.938916648 +0800
$ dotnet tool update dotnet-dump --global
Tool 'dotnet-dump' was reinstalled with the latest stable version (version '7.0.447801').
$ stat ~/.dotnet/tools/dotnet-dump
File: /home/steve/.dotnet/tools/dotnet-dump
Size: 97448 Blocks: 192 IO Block: 4096 regular file
Device: 0,41 Inode: 2044937 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 1000/ steve) Gid: ( 1000/ steve)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2023-10-14 19:42:36.953904808 +0800
Modify: 2023-10-14 19:42:36.953904808 +0800
Change: 2023-10-14 19:42:36.960904692 +0800
Birth: 2023-10-14 19:42:36.952904825 +0800 |
// One thing to note is that .NET SDK respect locale, which means this | ||
// header can be printed in languages other than English, do NOT use it | ||
// to do any check. | ||
.skip(2) |
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.
It seems that dotnet search <PKG>
won't output this header if <PKG>
is not found:
$ dotnet tool search rust
Could not find any results.
Will this happen if the package has already been installed?
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.
If an installed package listed by dotnet tool list --global
is guaranteed to be found with dotnet tool search <PKG>
, then we can use the --take 1
option to find the exact match:
$ dotnet tool search dotnet-dump
Package ID Latest Version Authors Downloads Verified
------------------------------------------------------------------------------------------------
dotnet-dump 7.0.447801 Microsoft 21089065
dotnet-gcdump 7.0.447801 Microsoft 9036932
dumpdiag 0.10.0 DumpDiag 2427
netspark.tools.dumpconfig 1.0.0 Gennadii Kostrov 286
$ dotnet tool search dotnet-dump --take 1
Package ID Latest Version Authors Downloads Verified
---------------------------------------------------------------------------
dotnet-dump 7.0.447801 Microsoft 21089065
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.
It seems like dotnet
tool doesn't take into account whether the tool version supports the installed toolchain or not.
For example for package dotnet-ef
, a few days ago version 8.0.0
released, dropping support for pre-dotnet-8.0, but the cli still tried installing the update, and it's still showing as latest available using dotnet tool search
. Even tho I only had 6.0 and 7.0 installed.
Standards checklist:
CONTRIBUTING.md
cargo build
)cargo fmt
)cargo clippy
)cargo test
)For new steps
--dry-run
option works with this step--yes
option works with this step if it is supported bythe underlying command
If you developed a feature or a bug fix for someone else and you do not have the
means to test it, please tag this person here.