[Haskell-cafe] Re: cabal install HaXml installs wrong version unless I specify the version number

Thomas Hartman tphyahoo at gmail.com
Mon Nov 24 09:16:16 EST 2008

I have run into another issue with cabal packaging, which seems
related to the issues discussed above. (see attached tar file for
complete example of failure scenario)

If I have a cabal package that depends on two other packages
  -- package xml-parsec requires HaXml == 1.19.4 (the latest)
  -- package HAppS-Server requires HaXml == 1.13.3 (the default)

ghc --make testDepConflict.hs
  works fine.

But I can't install via cabal without, I guess, breaking out the
conflict into a separate cabal package.

Build-Depends:   HAppS-Server, xml-parsec, HaXml
-- (Uses HaXml 1.13.3, the default HaXml if no version number is specified)
-- Cabal says:
----    Could not find module `Text.XML.HaXml.Posn':
----          it is a member of package HaXml-1.19.4, which is hidden
-- I say:
----  Ok, I understand why this doesn't work.

Build-Depends:   HAppS-Server xml-parsec, HaXml == 1.19.4
-- Cabal says:
----  cabal: dependencies conflict: HAppS-Server requires HaXml ==1.13.3 however
----  HaXml-1.13.3 was excluded because CabalDepConflict-0.1 requires
HaXml ==1.19.4
-- I say:
----  Since HAppS-Server is its own separate package, why is this a conflict?
----  Shouldn't this work?

The workaround is to put the bits of the current package that depend
on HaXml 1.19.4 into their own separate package,
  which doesn't require HAppS-Server.

But shouldn't it be possible for cabal to figure out how to install
the package without doing this?

2008/11/15 Duncan Coutts <duncan.coutts at worc.ox.ac.uk>:
> On Sat, 2008-11-15 at 13:31 +0100, Thomas Hartman wrote:
>> This is all news to me, and un-googleable to boot:
>> http://www.google.pl/search?hl=en&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=cabal+referred-versions&spell=1
>> (no results)
> It finds something for me (with the right spelling of preferred), eg
> this thread from the libraries list:
> http://archive.netbsd.se/?ml=haskell-libraries&a=2008-10&t=8748731
>> So yes, I think this referred-versions machinery should at least be
>> made more transparent for situations when it does the wrong thing,
>> like with xml-parsec.
> Sure, though it is worth remembering that doing the right thing for
> xml-parsec is completely a guessing game since the package does not say
> which version it needs and yet works with some versions and not others.
> That is the root of this problem. We should be thinking about ways to
> persuade package authors (or others) to supply the correct information.
> That's where the package versioning policy comes in.
>> I think your last suggestion is good
>> > cabal install haxml
>> > Downloading HaXml-1.13.3...
>> > Note: the recommended version is HaXml-1.13.3 but latest version is
>> > HaXml-1.19, use cabal install haxml-1.19 if you want that version.
>> I would have this message pop up for both cabal install and cabal
>> upgrade -- especiallly since with cabal upgrade the result was for me
>> completely bafflling.
> Ok, so that we do not forget this, would you mind filing a ticket to
> explain the confusion and the suggested solution. Linking to this thread
> would also help.
> http://hackage.haskell.org/trac/hackage/
> Duncan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CabalDepConflict.tar.gz
Type: application/x-gzip
Size: 1964582 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20081124/08597395/CabalDepConflict.tar-0001.bin

More information about the Haskell-Cafe mailing list