libeako
libeako

Reputation: 2384

cabal - local dependency missing

I am learning cabal. Fighting with a "dependencies are missing" error.

I have 2 cabal packages : "base-ext-fana", "xml-fana". Both are sandboxed. base-ext-fana builds cleanly. xml-fana should depend on it. So i did cabal add-source ../base-ext-fana. I list base-ext-fana in xml-fana.cabal in the "build-depends" section. Still i get :

cabal: At least the following dependencies are missing:
base-ext-fana -any

on cabal configure.

Investigating myself

I suspected that i might make a mistake in base-ext-fana, so i replaced it with another package ["idris"] that i know must be correct and still got the same error.

I know i did not misspelled the package path of base-ext-fana in cabal add-source, because i let bash complete it and cabal add-source did found base-ext-fana.cabal in it. The given path got added to file .cabal-sandbox/add-source-timestamps. I know i did not misspelled the package name base-ext-fana in xml-fana.cabal, becuase i copy-pasted it from base-ext-fana.cabal's name section.

What else may cause the error?

Upvotes: 0

Views: 332

Answers (1)

libeako
libeako

Reputation: 2384

cabal --require-sandbox install base-ext-fana solved my problem.

What i missed was that it is not enough to tell cabal where it finds the dependency package [with cabal sandbox add-source], but i also have to install it.

This solution was suggested by Thomas M. DuBuisson in a comment.

Upvotes: 0

Related Questions