Skip to content

Cabal Dir Environment variable added #1126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

kwrooijen
Copy link

I adjusted the defaultCabalDir function so that if you have CABAL_DIR environment variable it will default to that location instead of $HOME/.cabal

@tibbe
Copy link
Member

tibbe commented Nov 21, 2012

If I'm allowed to bikeshed a bit I think these kind of variables are usually called <binary>_HOME, as in JAVA_HOME, SCALA_HOME, PYTHONHOME.

@dcoutts
Copy link
Contributor

dcoutts commented Nov 22, 2012

Can someone comment on why this is needed? It seems to duplicate the existing env var to specify which ~/.cabal/config file to read.

Perhaps what we need is the ability to have dirs in the ~/.cabal/config file that are relative to its location, so you can use the same file and relocate it without changing anything.

@sajith
Copy link

sajith commented Jan 31, 2013

Here is one use cases I can think of:

At the university we have everyone's home directories mounted on NFS. And the machines are a mix of i686 and x86-64. (If this was 1995 there would be Alphas and SGIs and SPARCs...) I'm not sure this is a thing, but it would be ideal if Cabal is aware of architectures and could let people install packages for different architectures side-by-side. (GHC seems to have some notion of machine type-compiler version, so why not Cabal?)

(I'm fairly clueless and I'm not sure there's an existing elegant way to solve this. I found this thread when looking for a way to run Xmonad on the above-stated i686 machines.)

@23Skidoo
Copy link
Member

@sajith I think your problem was fixed by recent cross-compiling-related changes (packages are now installed under $arch-$os-$compiler/$pkgid instead of $pkgid/$compiler).

@23Skidoo
Copy link
Member

@dcoutts

Perhaps what we need is the ability to have dirs in the ~/.cabal/config file that are relative to its location, so you can use the same file and relocate it without changing anything.

What if instead of adding $CABAL_HOME we did something like this:

defaultCabalDir :: IO FilePath
defaultCabalDir = do
  mEnv <- lookupEnv "CABAL_CONFIG"
  maybe (getAppUserDataDirectory "cabal") (fmap takeDirectory . canonicalizePath) mEnv

?

@dcoutts
Copy link
Contributor

dcoutts commented Mar 15, 2013

Or perhaps we just need a general "where cabal puts its misc other files" entry in the config. And we'd use that for the things that don't have another specific entry in the ~/.cabal/config.

Indeed we could remove some of the other config entries like world-file and just make them relative to this "general cabal files" setting.

@23Skidoo
Copy link
Member

Closing in favor of #1242.

@23Skidoo 23Skidoo closed this Mar 16, 2013
@mietek
Copy link
Contributor

mietek commented May 25, 2014

This enhancement would have been appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants