How to change path of cabal config file?

…衆ロ難τιáo~ 提交于 2019-12-19 06:13:18

问题


I am using HaskellPlatform-2012.4.0.0 on Win7. It's installed as portable. Paths are managed through .bat file so ghci and ghc works.
But cabal installs it self at C:\Users\name\AppData\Roaming\cabal\
To circumvent that I did:

cabal update
edit config file
delete all files except config

Changed paths:

remote-repo-cache: d:\h1\cabal\packages 
world-file: d:\h1\cabal\world
build-summary: d:\h1\cabal\logs\build.log

It works, but it's far from truly portable.

Cabal config is bigger problem. It seems that it must be left in C:\Users\name\AppData\Roaming\cabal which is not portable at all.
First run of cabal update says Config file path source is default config file.

Questions:
1. where is that default config file?
2. can remote-repo-cache, world-file and other paths be relative?
3. is there a way of setting default cabal path so it never goes to C:\Users\name\AppData\Roaming\cabal


回答1:


Run cabal with:

cabal --config-file="path/to/config"


来源:https://stackoverflow.com/questions/14368401/how-to-change-path-of-cabal-config-file

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