简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM