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

Already on GitHub? Sign in to your account

cabal-dev can't distinguish .hi files #34

Closed
thsutton opened this Issue Aug 25, 2011 · 6 comments

Comments

Projects
None yet
6 participants

My install of cabal-dev on OS X (0.8 of hackage and d876a99) doesn't seem to include the module-specific path component when it's deciding where to place .hi files within ./cabal-dev/

Thus I get lots problems when installing multiple modules which have modules with the same name. For instance:

Something is amiss; requested module  MonadCatchIO-mtl-0.3.0.4:Control.Monad.CatchIO differs from name found in the 
interface file MonadCatchIO-transformers-0.2.2.2:Control.Monad.CatchIO

with a reference to .../cabal-dev//lib/Control/Monad/CatchIO.hi.

I've finally tracked this problem down to bad (IMHO) defaults in admin/cabal-config.in. Comparing the standard ~/.cabal/config with ./cabal-dev/cabal.config the stand-out difference is the lack of $pkgid and other variables in any of the path settings.

I no longer have the problem described here after I updated my admin/cabal-config.in to look like:

install-dirs user
  prefix: ./
  -- bindir: $prefix/bin
  -- libdir: $prefix/lib
  libsubdir: $pkgid/$compiler
  libexecdir: $prefix/libexec
  -- datadir: $prefix/share
  -- datasubdir: $pkgid
  docdir: $datadir/doc/$pkgid
  -- htmldir: $docdir/html
  -- haddockdir: $htmldir

install-dirs global
  prefix: ./
  -- bindir: $prefix/bin
  -- libdir: $prefix/lib
  libsubdir: $pkgid/$compiler
  libexecdir: $prefix/libexec
  -- datadir: $prefix/share
  -- datasubdir: $pkgid
  docdir: $datadir/doc/$pkgid
  -- htmldir: $docdir/html
  -- haddockdir: $htmldir

@thsutton thsutton closed this Sep 19, 2011

@j3h j3h reopened this Sep 20, 2011

Collaborator

j3h commented Sep 20, 2011

I don't think that the cabal-config.in is overriding any of those fields. I wonder if this is a difference between the default cabal-install configuration and the one that gets put in ~/.cabal/? I'll take a deeper look.

Installing OS X 10.6, the Haskell Platform package, and cabal-dev from Hackage results in a non-working configuration for me; but Debian, the Haskell Platform (from apt), and cabal-dev from Hackage works. Maybe it's a problem with the OS X platform build?

I note that ~/.cabal/config on OS X has $compiler and $pkgid in the $prefix for the install-dirs sections, where as the install on Debian uses $pkgid and $compiler in the (commented out, I assume this means "default") $libsubdir...

nkpart commented Oct 11, 2011

I'm also having this problem. It's just as @thsutton describes. With the latest version of the haskell platform on OS X (the 64-bit variant, if it matters), the ~/.cabal/config file has this section:

install-dirs user
  prefix: /Users/nkpart/Library/Haskell/$compiler/lib/$pkgid
  libsubdir:  
  datasubdir: 
  docdir: $prefix/doc

install-dirs global
  prefix: /Library/Haskell/$compiler/lib/$pkgid
  libsubdir:  
  datasubdir: 
  docdir: $prefix/doc

So the ./cabal-dev/cabal.config gets spat out like this:

install-dirs user
  prefix: /Users/nkpart/railscamp/leave-forms/cabal-dev/
  libsubdir: 
  datasubdir: 
  docdir: $prefix/doc
install-dirs global
  prefix: /Users/nkpart/railscamp/leave-forms/cabal-dev/
  libsubdir: 
  datasubdir: 
  docdir: $prefix/doc

Could the prefix be made to include $compiler and $pkgid? Without some change here cabal-dev isn't going to work reliably on vanilla platform installs on OS X.

I've just spent a whole day independently tracking down this issue. My installation was working fine with $pkgid prefixing until I upgraded globally to ghc-7.4 and then all hell broke loose. The per-package directory structure got replaced with a single directory containing all modules.

I am on OS X Lion (64-bit) as described before. The solutions seems to be manually changing cabal-config.in to add the $pkgid back in there.

dmac commented Jan 14, 2013

I had the same issue with OS X Mountain Lion 64-bit, and the above work-around (which worked for me) is also documented in this blog post: http://passingcuriosity.com/2011/cabal-dev-configuration-tweaks

Is there a specific challenge to resolving this in cabal-dev proper?

@isturdy isturdy referenced this issue Apr 8, 2013

Closed

Prefix lib files #77

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