Using Fay in a cabal sandbox

瘦欲@ 提交于 2019-12-14 01:26:53

问题


I've just started using both cabal sandboxes and Fay. However, Fay seems unable to find the packages automatically, presumably as they are not in the 'global' cabal package database. I tried unsuccessfully to follow the advice on this wiki page, which to me looked like:

./cabal-sandbox/bin/fay.exe --base-path .cabal-sandbox/i386-windows-ghc-7.6.3/fay-base-0.19/src/ Frontend.hs

But Fay still complains it cannot find package fay-base. Is there something I can do about this, or must I install Fay outside the sandbox?


回答1:


You don't need to supply the base path, but you need to point it to the correct package config by passing --package-conf or setting the HASKELL_PACKAGE_SANDBOX environment variable.

For instance:

./.cabal-sandbox/bin/fay --package-conf=.cabal-sandbox/x86_64-osx-ghc-7.6.3-packages.conf.d examples/alert.hs

or

HASKELL_PACKAGE_SANDBOX=./.cabal-sandbox/x86_64-osx-ghc-7.6.3-packages.conf.d ./.cabal-sandbox/bin/fay examples/alert.hs

More information is available at https://github.com/faylang/fay/wiki/Installing-and-running#wiki-sandboxes (I just edited it to make it a bit clearer, and I'll add a link from the other wiki page)



来源:https://stackoverflow.com/questions/22070308/using-fay-in-a-cabal-sandbox

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!