nimble icon indicating copy to clipboard operation
nimble copied to clipboard

Uninstall dependents doesn't work

Open Benjamin-Lee opened this issue 5 years ago • 4 comments

Today I tried installing nim-chronicles only to find that it didn't fit my need. I went to uninstall it and all of its dependents but found that it didn't worK

~/D/P/R/viroid-search ❯❯❯ nimble list -i                                                                                       (viroid-search)
argparse  [0.10.1]
docopt  [0.6.7]
librtd  [0.0.2.1, 0.0.2.2]
nimpy  [0.1.1, 0.1.0]
progress  [1.1.1]
viroid_search  [#head]
~/D/P/R/viroid-search ❯❯❯ nimble install chronicles                                                                            (viroid-search)
Downloading https://github.com/status-im/nim-chronicles using git
  Verifying dependencies for [email protected]
 Installing testutils@any version
Downloading https://github.com/status-im/nim-testutils using git
  Verifying dependencies for [email protected]
 Installing [email protected]
   Building testutils/ntu using c backend
/private/var/folders/gw/sk03t1cn3wlgclyc55yst44w0000gn/T/nimble_73660/githubcom_statusimnimtestutils/testutils/fuzzing_engines.nim(1, 19) Warning: import os.nim instead; ospaths is deprecated [Deprecated]
/private/var/folders/gw/sk03t1cn3wlgclyc55yst44w0000gn/T/nimble_73660/githubcom_statusimnimtestutils/ntu.nim(64, 15) template/generic instantiation of `styledEcho` from here
/usr/local/Cellar/nim/1.4.0/nim/lib/pure/terminal.nim(744, 9) template/generic instantiation of `styledWriteLine` from here
/private/var/folders/gw/sk03t1cn3wlgclyc55yst44w0000gn/T/nimble_73660/githubcom_statusimnimtestutils/ntu.nim(65, 33) Warning: binary is deprecated [Deprecated]
/private/var/folders/gw/sk03t1cn3wlgclyc55yst44w0000gn/T/nimble_73660/githubcom_statusimnimtestutils/ntu.nim(136, 14) Warning: use fileExists; existsFile is deprecated [Deprecated]
/private/var/folders/gw/sk03t1cn3wlgclyc55yst44w0000gn/T/nimble_73660/githubcom_statusimnimtestutils/ntu.nim(167, 12) Warning: use fileExists; existsFile is deprecated [Deprecated]
/private/var/folders/gw/sk03t1cn3wlgclyc55yst44w0000gn/T/nimble_73660/githubcom_statusimnimtestutils/ntu.nim(240, 16) Warning: binary is deprecated [Deprecated]
/private/var/folders/gw/sk03t1cn3wlgclyc55yst44w0000gn/T/nimble_73660/githubcom_statusimnimtestutils/testutils/config.nim(125, 18) Warning: Potential object case transition, instantiate new object instead [CaseTransition]
   Success: testutils installed successfully.
 Installing json_serialization@any version
Downloading https://github.com/status-im/nim-json-serialization using git
  Verifying dependencies for [email protected]
 Installing serialization@any version
Downloading https://github.com/status-im/nim-serialization using git
  Verifying dependencies for [email protected]
 Installing faststreams@any version
Downloading https://github.com/status-im/nim-faststreams using git
  Verifying dependencies for [email protected]
 Installing stew@any version
Downloading https://github.com/status-im/nim-stew using git
  Verifying dependencies for [email protected]
 Installing [email protected]
   Success: stew installed successfully.
      Info: Dependency on testutils@any version already satisfied
  Verifying dependencies for [email protected]
 Installing chronos@any version
Downloading https://github.com/status-im/nim-chronos using git
  Verifying dependencies for [email protected]
      Info: Dependency on stew@any version already satisfied
  Verifying dependencies for [email protected]
 Installing bearssl@any version
Downloading https://github.com/status-im/nim-bearssl using git
  Verifying dependencies for [email protected]
 Installing [email protected]
   Success: bearssl installed successfully.
 Installing [email protected]
   Success: chronos installed successfully.
 Installing [email protected]
   Success: faststreams installed successfully.
      Info: Dependency on stew@any version already satisfied
  Verifying dependencies for [email protected]
 Installing [email protected]
   Success: serialization installed successfully.
      Info: Dependency on stew@any version already satisfied
  Verifying dependencies for [email protected]
 Installing [email protected]
   Success: json_serialization installed successfully.
 Installing [email protected]
   Success: chronicles installed successfully.
~/D/P/R/viroid-search ❯❯❯ nimble uninstall -i chronicles                                                                       (viroid-search)
    Looking for chronicles (any version)
   Checking reverse dependencies
    Prompt: The following packages will be removed:
  chronicles (0.10.0)
Do you wish to continue? [y/N]
    Answer: y
    Removed chronicles (0.10.0)
~/D/P/R/viroid-search ❯❯❯ nimble list -i                                                                                       (viroid-search)
argparse  [0.10.1]
bearssl  [0.1.5]
chronos  [2.5.2]
docopt  [0.6.7]
faststreams  [0.2.0]
json_serialization  [0.1.0]
librtd  [0.0.2.1, 0.0.2.2]
nimpy  [0.1.1, 0.1.0]
progress  [1.1.1]
serialization  [0.1.0]
stew  [0.1.0]
testutils  [0.3.0]
viroid_search  [#head]

Nimble info:

nimble v0.12.0 compiled at 2020-10-17 06:31:40
git hash: 8f7af860c5ce9634af880a7081c6435e1f2a5148

Benjamin-Lee avatar Nov 25 '20 02:11 Benjamin-Lee

The -i | --inclDeps flag is to uninstall packages that depend on chronicles in this use case, not the packages that chronicles depends on. Without the -i flag, you couldn't uninstall, say serialization since chronicles depends on it. So in that use case, nimble uninstall -i serialization would uninstall it and chronicles.

genotrance avatar Nov 25 '20 16:11 genotrance

That's somewhat counterintuitive but makes sense now when I reread the docs. Is there a straightforward way to uninstall a package and all the packages upon which it depends (unless one of those is depended on by another package)?

Maybe a clearers message in the docs could be:

 [-i, --inclDeps]   Uninstalls package and all package(s) which depend on it.

Then a potential recursive option (what I thought it did) could be:

[-r, --recursive] Uninstalls package and all packages which it depends on unless those are otherwise required.

Benjamin-Lee avatar Nov 27 '20 02:11 Benjamin-Lee

Today I stumbled on this, and I also find --inclDeps counterintuitive.

Here is my example:

$ nimble install nimibook
...


$ nimble list -i
jsony  [(version: 1.1.5, checksum: 6aeb83e7481ca8686396a568096054bc668294df)]
markdown  [(version: 0.8.7, checksum: 2fc60a4d5b3532018cb44982684af330e291dc5e)]
mustache  [(version: 0.4.3, checksum: 9c7e49440ae9bb6494bd202eea6ef7405811c6bb)]
nimib  [(version: 0.3.9, checksum: aef1ca56d3e8ab84e7c34f5122d3e9f9bc39a8bf)]
nimibook  [(version: 0.3.1, checksum: 06712caa40fe85d8b150e04e4eb9c7d9955f4bbe)]
parsetoml  [(version: 0.7.1, checksum: 586fe63467a674008c4445ed1b8ac882177d7103)]
tempfile  [(version: 0.1.7, checksum: d7c473819bbf0e38cad32e00598bd42366606e08)]


$ nimble uninstall --inclDeps nimibook
    Looking for nimibook (any version)
   Checking reverse dependencies
    Removed nimibook-0.3.1-06712caa40fe85d8b150e04e4eb9c7d9955f4bbe


$ nimble list -i
jsony  [(version: 1.1.5, checksum: 6aeb83e7481ca8686396a568096054bc668294df)]
markdown  [(version: 0.8.7, checksum: 2fc60a4d5b3532018cb44982684af330e291dc5e)]
mustache  [(version: 0.4.3, checksum: 9c7e49440ae9bb6494bd202eea6ef7405811c6bb)]
nimib  [(version: 0.3.9, checksum: aef1ca56d3e8ab84e7c34f5122d3e9f9bc39a8bf)]
parsetoml  [(version: 0.7.1, checksum: 586fe63467a674008c4445ed1b8ac882177d7103)]
tempfile  [(version: 0.1.7, checksum: d7c473819bbf0e38cad32e00598bd42366606e08)]

narimiran avatar Jan 19 '24 08:01 narimiran