nim-lang / nimble

Package manager for the Nim programming language.
https://nim-lang.github.io/nimble/index.html
Other
1.26k stars 191 forks source link

Cannot use, install or uninstall `db_connector` package #1082

Closed thisago closed 1 year ago

thisago commented 1 year ago

In devel, the command nimble install db_connector gives:

Downloading https://github.com/nim-lang/db_connector using git
   Warning: The package has no tagged releases, downloading HEAD instead.
  Verifying dependencies for db_connector@0.1.0
 Installing db_connector@0.1.0
  Warning:  A package "db_connector@0.1.0" with checksum "05c335ec678614b973d8a80651971e0719045d14" already exists the the cache.

and nimble remove db_connector

    Looking for db_connector (any version)
   Checking reverse dependencies
  Warning:  Cannot uninstall db_connector (0.1.0) because
        ... lowdb-0.2.0-dad3744a194c9087e41e599923b639d9f19b3b3d
        ... depends on it
       Tip: 1 messages have been suppressed, use --verbose to show them.
nimble.nim(1204)         uninstall

    Error:  Failed uninstall - no packages to delete

And I cannot import any DB lib:

import std/db_sqlite

error:

/path/to/main.nim(1, 11) Error: cannot open file: std/db_sqlite

I tried to rebuild the latest devel with choosenim update devel --latest but no success


Now I tried to clone db_connector into ~/.nimble/pkgs/, renamed to db_connector-0.1.0 and moved src files to lib root dir, but no success...

For the others packages, the installation, removal and import works normally...

ringabout commented 1 year ago

When switching from stable to devel, you need to remove /pkgs directory since it might conflict with /pkgs2 which is used by the latest nimble.

thisago commented 1 year ago

I removed and now it installed db_connector but it cannot use the std/db_sqlite, just pkg/db_connector/db_sqlite

Not works:

$ echo "import std/db_sqlite" > /tmp/test.nim && nim r /tmp/test.nim
/tmp/test.nim(1, 11) Error: cannot open file: std/db_sqlite

Works:

$ echo "import pkg/db_connector/db_sqlite" > /tmp/test.nim && nim r /tmp/test.nim
foxoman commented 1 year ago

in devel:

  • Several Standard libraries are moved to nimble packages, use nimble to install them:
    • std/db_sqlite => db_connector/db_sqlite

https://forum.nim-lang.org/t/10051#66420