Quantcast
Channel: OCaml - Topics tagged dune
Viewing all articles
Browse latest Browse all 521

Trying to get Cacti example working

$
0
0

I am extremely frustrated and hoping someone can help me. I am trying to get the example code in the Caqti github working working. It’s for a project they call bikereg.

Here are the steps I take:

dune init proj bikereg
cd bikereg

Then I replace bin/dune with the version in the examples directory mentioned above. It contains:

(executable
 (name bikereg)
 (modules bikereg)
 (libraries caqti caqti-dynload caqti-lwt caqti-lwt.unix testlib))

(rule
 (alias runtest)
 (package caqti-lwt)
 (deps (:test bikereg.exe) (alias ../testsuite/drivers) ../testsuite/uris.conf)
 (locks /db/bikereg)
 (action
  (setenv OCAMLPATH ../testsuite
   (run %{test} -U ../testsuite/uris.conf))))

Then I edit dune-project to depend on the libraries mentioned in the dune file. After editing, the package section reads:

(package
 (name bikereg)
 (synopsis "A short synopsis")
 (description "A longer description")
 (depends ocaml dune caqti caqti-dynload caqti-lwt caqti-lwt.unix testlib)
 (tags
  (topics "to describe" your project)))

Finally I run:
dune build

I get the output:

Error: The current scope doesn't define package "caqti-lwt".
The only packages for which you can declare elements to be installed in this
directory are:
- bikereg (because of bikereg.opam)

I’ve tried editing bikereg.opam to fix the problem, but it doesn’t help. Moreover the OCaml Quickstart says “Do not update project_name.opam manually! Let dune do it for you.” and says that we should use dune build to do that.

I have no idea what to do now to move forward. Perhaps the Caqti example is just wrong and shouldn’t be referring to caqti-lwt? But caqti-lwt does appear in the github directory for Caqti, so apparently it does exist. I don’t know why there would be a problem in referring to it.

8 posts - 5 participants

Read full topic


Viewing all articles
Browse latest Browse all 521

Trending Articles