treeform / pg

Very simple PostgreSQL async api for nim.
MIT License
37 stars 9 forks source link

Error: cannot open file: print #7

Open fox0430 opened 2 years ago

fox0430 commented 2 years ago

Cannot use pg v0.1.0. I think you may need to release a new version because HEAD is no problem.

Code

import pkg/pg

discard newAsyncPool("localhost", "user", "password", "dbname", 10)

Log

nimble install pg
nim c test.nim

Hint: used config file '/home/fox/.choosenim/toolchains/nim-1.6.6/config/nim.cfg' [Conf]
Hint: used config file '/home/fox/.choosenim/toolchains/nim-1.6.6/config/config.nims' [Conf]
.................................................................................................................
/home/fox/.nimble/pkgs/pg-0.1.0/pg.nim(5, 8) Error: cannot open file: print

Environment

OS: Arch Linux Nim: v1.6.6

PhilippMDoerner commented 1 year ago

Just had a user taht reported the same issue on Windows.

It's solved by installing the print package (nimble install print) but I'm completely lost as to why. The pg.nim file does make use of it, so why is it an issue?

nbfritch commented 1 year ago

Commit 7348850631e40c487539eca1b715b0d3bf7b5568 added the dependency on print to pg.nim. The author of this package is also the author of print so they likely didn't notice print wasn't a package dependency.

The line was removed in e97857992f0ab4f3251665a834d61563fcda7726 but no new version has been published.

The solution is for @treeform or someone else to publish version 0.1.1 with the most recent changes. For now you can work around it by adding print as a dependency to your project, or by removing line 5 from $HOME/.nimble/pkgs/pg.nim