Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 245801 - [haskell overlay] dev-haskell/cabal-1.6.0.1 cannot find ghc-pkg.bin (ghc 6.10.1)
Summary: [haskell overlay] dev-haskell/cabal-1.6.0.1 cannot find ghc-pkg.bin (ghc 6.10.1)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo's Haskell Language team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-06 10:17 UTC by Joerg Plate
Modified: 2008-11-13 20:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
workaround patch for ghc-pkg changes (ghc-package.eclass.patch,844 bytes, patch)
2008-11-08 04:35 UTC, Dave Neuer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Plate 2008-11-06 10:17:00 UTC
/tmp/portage/dev-haskell/cabal-1.6.0.1/temp/environment: line 2162: /usr/lib64/ghc-6.10.1/./ghc-pkg.bin: No such file or directory
 * 
 * ERROR: dev-haskell/cabal-1.6.0.1 failed.
 * Call stack:
 * ebuild.sh, line   49:  Called src_install
 * environment, line 2847:  Called cabal_src_install
 * environment, line  582:  Called cabal-pkg
 * environment, line  539:  Called ghc-setup-pkg '/tmp/portage/dev-haskell/cabal-1.6.0.1/temp/cabal-1.6.0.1.conf'
 * environment, line 2162:  Called die
 * The specific snippet of code:
 * $(ghc-getghcpkgbin) -f "${localpkgconf}" -u --force < "${pkg}" || die "failed to register ${pkg}";
 * The die message:
 * failed to register /tmp/portage/dev-haskell/cabal-1.6.0.1/temp/cabal-1.6.0.1.conf


Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2008-11-07 04:06:34 UTC
Please post your `emerge --info' too.
Comment 2 Dave Neuer 2008-11-08 04:35:27 UTC
Created attachment 171069 [details, diff]
workaround patch for ghc-pkg changes

I have this problem, too, after upgrading to ghc-6.10.1 from layman, and running /usr/sbin/ghc-updater (which tried to upgrade to cabal-1.2.3.0, IIRC, but that's way to old to work w/ 6.10.1, I think).

It looks like the format and options of ghc-pkg have changed: it's a binary now, not a script, it takes a command called "update" instead of a flag called -u (it looks like since 6.8), and it requires a "-" to read from std in.

The following patch to ghc-package.eclass is a workaround (it's not a longterm fix: the changes are unconditional, so it's not compatible w/ older versions), but it allowed me to build & install cabal 1.6.0.1.

Note, the stuff in gentoo-haskell overlay is masked as unstable and is explicitly not supported by gentoo, so a long term fix may be a while in coming).

I may try to fix the ghc-package in a way more compatible w/ old ghc too (e.g., test ghc-pkg w/ "file" to see if it's a script, make the "-u" to "update" conversion conditional on $ghc-version, etc) if I get some more free time and can figure out the least hacky way to add those tests. Of course, if some actual gentoo dev _wants_ to fix it...
Comment 3 Ivan 2008-11-10 10:50:10 UTC
I should first of all note that I'm not a Gentoo dev, but I help maintain the Haskell overlay.

There was a period of time between creating the ebuild for ghc-6.10.1 but before we realised that the ghc-pkg.bin tool that the eclasses depended upon no longer exists (ghc-pkg used to be a script wrapper around ghc-pkg.bin, but the two have since been merged together).  As such, you must have built ghc before this was noted and 6.10.1 was masked (also, you must have bootstrapped ghc yourself since I just built the x86 binary).

Lennart Kolmodin has since updated the eclasses, and we're going to test them out for a while before updating the ones in the tree.  We've also got to test all packages in the overlay for compatability with 6.10.1 (see http://code.haskell.org/gentoo/gentoo-haskell/projects/GHC-6.10-failures for those I've found so far).

In future, issues like this would be resolved much sooner if you reported issues either to #gentoo-haskell on Freenode or directly to haskell@gentoo.org (note that each time you sync the overlay, darcs spits out a message stating that bugs from the overlay shouldn't be reported here); in part, this is because there are some of us (like myself) who do not get these bug reports, since we only have two "official" devs in the Haskell herd.
Comment 4 Lennart Kolmodin (RETIRED) gentoo-dev 2008-11-13 20:18:09 UTC
Ivan has already covered most of what I have to say.

Remember that if you run with a unmasked ghc, you should also run with unmasked packages. Otherwise you will install much older cabal versions than what your ghc would like.

The 'update -' command (and friends) has been available since ghc 6.4, when the other flags we used were deprecated.

The patched eclass, supposed to work with all ghc and cabal versions, was added to the overlay the 4th of November. Using that there should be no problems.