0

I am building a small project, and when cabal attempts to install MissingH 1.3.0, it runs into a compiler error (name clash):

src/System/IO/HVFS.hs:287:23:
    Ambiguous occurrence ‘isSymbolicLink’
    It could refer to either ‘System.IO.PlafCompat.isSymbolicLink’,
                             imported from ‘System.IO.PlafCompat’ at src/System/IO/HVFS.hs:60:1-27
                             (and originally defined in ‘unix-2.7.2.0:System.Posix.Files.Common’)
                          or ‘System.Directory.isSymbolicLink’,
                             imported from ‘System.Directory’ at src/System/IO/HVFS.hs:63:1-23
cabal: Error: some packages failed to install:
MissingH-1.3.0.1 failed during the building phase.

The thing that puzzles me is that I'd have thought the versions in the .cabal file either produce a working build, or a contradiction involving the versions required, but not a build error. I've verified I can build MissingH on its own, but some other packages I depend on seem to cause this problem (here's the other packages I'm naming the .cabal file, in case that helps reproduce the problem).

  build-depends:   base >=4.7 && <4.8
                 , groom==0.1.2
                 , containers>=0.5.7
                 , sexp==0.7
                 , bytestring==0.10.6.0
                 , hashmap==1.3.0.1
                 , MissingH==1.3.0.1

Any pointers?

orm
  • 2,835
  • 2
  • 22
  • 35
  • 1
    as it's a problem inside the package (the error is rather clear - here is the [source](https://hackage.haskell.org/package/MissingH-1.3.0.1/docs/src/System-IO-HVFS.html) in case you are interesed) you can mail the maintainer and ask for a fix - or you can grab the source and fix it locally for you (it's easy in this case just *hide* one of the imported `isSymbolicLink`s - probably the internal one from `PlafCompat`) – Random Dev Apr 27 '16 at 08:27
  • maybe the problem was introduced into newer `directory` versions - a quick look: [version 1.2.5.1](https://hackage.haskell.org/package/directory-1.2.5.1/docs/System-Directory.html) did not use it and `MissingH` does not constraint this (this is usually the problem ...) - so you can probably just constraint `directory` to `1.2.5.1` and resolve the issue (add `directory <= 1.2.5.1` to the `build-depends`) or using `cabal install yourGoal --constraint=directory<=1.2.5.1` – Random Dev Apr 27 '16 at 08:31
  • I can see how it can be fixed in the package, however, it seems like this kind of problem appears due to an understandable lack of forward compatibility (ie, one cannot predict which names will be added to imported packages, which will cause conflicts later on). Isn't this part what the upper bound in the cabal files dependency list is meant to help enforce though? though that may not really fix the problem, just give you a different error message at the cabal layer. – orm Apr 27 '16 at 14:29
  • @orm This is in general an unsolved problem: if you put in an upper bound then you risk breaking a build that would work perfectly well, but if you don't put in an upper bound then this kind of thing happens. "stack" (http://www.haskellstack.org/) offers a combination of packages that are known to build together, which is better than nothing. – Paul Johnson Apr 27 '16 at 17:18

0 Answers0