There's no way to move `setup-exe-cache` to another directory #1234

nagisa opened this Issue Mar 11, 2013 · 10 comments


None yet
5 participants

nagisa commented Mar 11, 2013

According to the #958 (comment) setup-exe-cache is hardcoded to ~/.cabal/setup-exe-cache and there's no way to change it. Looking at the code, path building didn't change and it is still hardcoded.

Making setup-exe-cache movable is a prerequisite for #680


23Skidoo commented Mar 11, 2013

I'm inclined to close this. Setup exe cache directory is defined relative to defaultCabalDir, and there is nothing specific to setup exe cache about this, defaultInstallDirs etc are also defined similarly. There is already a ticket about adding a $CABAL_HOME environment variable ( #1126 ).

@23Skidoo 23Skidoo closed this Mar 11, 2013

nagisa commented Mar 12, 2013

@23Skidoo You can set $CABAL_CONFIG environment variable to put config file anywhere you want. Through the config file you can then set locations of various cabal directories and files, including ones used for installations, making cabal-install related pathes completely configurable.

However I could not find a way to set a directory for setup exe cache, which is the only directory for which ~/.cabal gets recreated every time.

$ ls ~/.cabal/

I'd like this issue reopened.


23Skidoo commented Mar 12, 2013

@simukis Instead of adding an explicit setup-exe-cache entry to ~/.cabal/config, I'd prefer to solve this via an explicit $CABAL_HOME environment variable or the solution I've outlined in this comment (since @dcoutts objects to adding $CABAL_HOME). Setup exe cache is an implementation detail, after all.


dcoutts commented Mar 15, 2013

See my suggestion in #1126, so we can avoid an explicit setup-exe-cache entry.


23Skidoo commented Mar 16, 2013

See #1242.


mietek commented Nov 27, 2014

Since #1126 was not merged, and there is no progress on #1242, I would like this issue reopened.

I propose adding a CABAL_SETUP_EXE_CACHE environment variable. Thoughts?

Is there any progress on this? I'm bumping into this right now and don't know how to work around it...

Also, seconding @mietek , I'd like to see this issue reopened. The issue is with the following lines:

    cabalDir <- defaultCabalDir
    let setupCacheDir       = cabalDir </> "setup-exe-cache"

from Distribution.Client.SetupWrapper in cabal-install. The implementation of defaultCabalDir is:

--TODO: misleading, there's no way to override this default
--      either make it possible or rename to simply getCabalDir.
defaultCabalDir :: IO FilePath
defaultCabalDir = getAppUserDataDirectory "cabal"

It seems like this just needs fixing, as per the TODO. I propose doing so by adding a cabal-dir configuration variable, and then you can bass --config-file=config that has a custom cabal-dir.


mietek commented Dec 25, 2014

There has been no progress on this inside cabal-install.

In order to work around valderman/haste-compiler#257, I created an empty Cabal package, populate-setup-exe-cache, which I use in Halcyon.

@mietek Trying to address this via #2303

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment