2

I am trying to implement the database using both libs HDBC and HDBC-sqlite3, while I am getting error for adding HDBC-Sqlie3 and I have tried the below :

  • HDBC-Sqlite3
  • HDBC-Sqlite3 -any
  • HDBC-Sqlite3 >= 2.3.3.0 && < 2.3.3.1
  • HDBC-Sqlite3 >= 2.3.3.0

and none of the above works and getting the error, when try the - any I got the following error :

In the dependencies for blog-post-0.1.0.0:
HDBC-Sqlite3 must match -any, but the stack configuration has no specified version

edit :

stack.yaml file

cabal file

khaled alomar
  • 673
  • 4
  • 25

1 Answers1

3

Your main error was the uppercase S in HDBC-sqlite3!

This should be the library section of your cabal file

library
  hs-source-dirs:      src
  exposed-modules:     Lib
  build-depends:       base >= 4.7 && < 5
                     , parsec >= 3.1.11 && < 4
                     , servant
                     , servant-client
                     , servant-server
                     , aeson >= 1.1
                     , mtl
                     , HDBC >=2.4 && <3.0
                     , HDBC-sqlite3 >= 2.3.3.0

and this should be the extra-deps section of your stack.yaml file:

# Dependency packages to be pulled from upstream that are not in the resolver
# (e.g., acme-missiles-0.3)
extra-deps:
- HDBC-sqlite3-2.3.3.0

You must add the package HDBC-sqlite3-2.3.3.0 to the extra-deps section of the stack.yaml file because it is missing in the set of packages of Stackage LTS-9.9.

Jogger
  • 1,617
  • 2
  • 12
  • 22
  • Thanks, tried this and got ` Some extra-deps are neither installed nor in the index` and then tried to install it using stack install but same issue – khaled alomar Oct 28 '17 at 13:04
  • 1
    Please commit the new versions of your cabal and stack.yaml files to your Git repo. – Jogger Oct 28 '17 at 13:10
  • Updated. Thank you, just I have updated and put it in [String] in the `stack.yaml` file since it won't be parsed otherwise – khaled alomar Oct 28 '17 at 13:28
  • Strange..., I downloaded you repo, did a ``stack setup`` and a ``stack build`` and it installed packages. I got an error, because I don't have installed the binaries of sqlite3. I'm using version 1.5.1 of stack. – Jogger Oct 28 '17 at 13:32
  • 1
    I update the code to files ( cabal and stack) the version `2.3.3.0` and it works! – khaled alomar Oct 28 '17 at 13:45