Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 188079

Summary: virtual/ghc default causes self-blocking issues
Product: Portage Development Reporter: William Xu <william.xwl>
Component: Core - DependenciesAssignee: Portage team <dev-portage>
Status: RESOLVED DUPLICATE    
Severity: normal CC: askwar, haskell, jakub, konstantin.sobolev, zlin
Priority: High    
Version: 2.1   
Hardware: PPC   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: ghc-6.6 won't compile

Description William Xu 2007-08-08 07:46:33 UTC
william@localhost ~ $ emerge -pv darcs

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ] dev-lang/ghc-bin-6.4.2  22,456 kB 
[ebuild  N    ] dev-lang/ghc-6.6  USE="-binary -doc -ghcbootstrap" 38,100 kB 
[ebuild  N    ] dev-haskell/cabal-1.1.6.2  USE="-doc -profile" 537 kB 
[ebuild  N    ] dev-haskell/quickcheck-1.0.1  USE="-doc -profile" 1,884 kB 
[ebuild  N    ] dev-haskell/html-1.0.1  USE="-doc -profile" 0 kB 
[ebuild  N    ] dev-haskell/mtl-1.0.1  USE="-doc -profile" 0 kB 
[ebuild  N    ] dev-util/darcs-1.0.9  USE="-doc" 1,035 kB 
[blocks B     ] dev-lang/ghc-bin (is blocking dev-lang/ghc-6.6)

Total: 7 packages (7 new, 1 block), Size of downloads: 64,010 kB
william@localhost ~ $ sudo emerge -C ghc-bin

--- Couldn't find 'ghc-bin' to unmerge.

>>> No packages selected for removal by unmerge
william@localhost ~ $ emerge --info
Portage 2.1.3.3 (default-linux/ppc/ppc32/2007.0, gcc-4.2.0, glibc-2.6-r0, 2.6.23-rc1-g45901fd2 ppc)
=================================================================
System uname: 2.6.23-rc1-g45901fd2 ppc 7447A, altivec supported
Gentoo Base System release 1.12.10
Timestamp of tree: Wed, 08 Aug 2007 01:47:01 +0000
ccache version 2.4 [enabled]
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS="ppc ~ppc"
AUTOCLEAN="yes"
CBUILD="powerpc-unknown-linux-gnu"
CFLAGS="-O2 -pipe -mcpu=G4 -maltivec -mabi=altivec -fno-strict-aliasing"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT=""
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe -mcpu=G4 -maltivec -mabi=altivec -fno-strict-aliasing"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache cvs distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.gg3.net/ ftp://gg3.net/pub/linux/gentoo/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/"
LC_ALL="zh_CN.utf-8"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.asia.gentoo.org/gentoo-portage"
USE="X acl alsa altivec berkdb bitmap-fonts cli cracklib crypt cups dri gdbm gpm iconv ipv6 isdnlog libg++ midi mp3 mudflap ncurses nls nptl nptlonly openmp pcre perl ppc pppd python quicktime readline reflection savedconfig session spl ssl tcpd truetype-fonts type1-fonts unicode xorg xv zlib" ALSA_CARDS="aoa aoa-fabric-layout aoa-onyx aoa-soundbus aoa-soundbus-i2s aoa-tas aoa-toonie powermac usb-audio via82xx" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

william@localhost ~ $ 

Reproducible: Always
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-08-08 08:07:41 UTC
The whole problem is that virtual/ghc defaults to dev-lang/ghc-bin; change it to 
dev-lang/ghc and it works. Portage-wise, looks like dupe of Bug 1343 to me. Any reason why not change the default virtual (or convert this to new-style one even)?

# echo "virtual/ghc    dev-lang/ghc" >> /etc/portage/profile/virtuals
# emerge -pv darcs

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ] dev-lang/ghc-6.6.1  USE="-binary -doc -ghcbootstrap" 29,760 kB 
[ebuild  N    ] dev-haskell/cabal-1.1.6.2  USE="-doc -profile" 537 kB 
[ebuild  N    ] dev-haskell/quickcheck-1.0.1  USE="-doc -profile" 1,884 kB 
[ebuild  N    ] dev-haskell/html-1.0.1  USE="-doc -profile" 0 kB 
[ebuild  N    ] dev-haskell/mtl-1.0.1  USE="-doc -profile" 0 kB 
[ebuild  N    ] dev-util/darcs-1.0.9  USE="-doc" 1,035 kB 
Comment 2 Zac Medico gentoo-dev 2007-08-08 09:51:56 UTC
I suggest changing ${PORTDIR}/profiles/base/virtuals so that dev-lang/ghc is the default provider.

@haskell herd: is there any reason not make dev-lang/ghc the default provider? It seems like ghc-bin will be pulled in by dependencies if necessary so it shouldn't need to be the default provider, should it?
Comment 3 William Xu 2007-08-08 10:12:59 UTC
Created attachment 127255 [details]
ghc-6.6 won't compile
Comment 4 William Xu 2007-08-08 10:14:43 UTC
Hi Jakub,

With your suggestion, no blocking now. But it won't compile. (See about
attachment)
Comment 5 Zac Medico gentoo-dev 2007-08-08 10:15:20 UTC
I've tested and I see that it doesn't pull in ghc-bin like it's supposed to when installing one of the older versions of ghc that requires it.  However, it did work if I change the ghc-6.4.2 dep to DEPEND="|| ( <dev-lang/ghc-bin-6.5 <virtual/ghc-6.5 )". A new-style virtual should also work, like Jakub suggested.
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2007-08-08 10:41:28 UTC
(In reply to comment #4)
> But it won't compile. (See about attachment)

Not here; file a separate bug, completely unrelated.


Comment 7 Duncan Coutts (RETIRED) gentoo-dev 2007-08-08 11:23:43 UTC
The reason that the virtual/ghc must default to ghc-bin is that the ghc source ebuild depends on virtual/ghc and ghc needs a version of ghc to build with, so it must pull in ghc-bin first to bootstrap.

We cannot use a new style virtual (we have tried) because bootstrapping does not work correctly that way. The portage devs have confirmed to us previously that this is the intended behavior of new style virtuals and we should continue to use the old style ones (or move to a totally new system...). Similarly having ghc dep on || ( dev-lang/ghc-bin dev-lang/ghc ) does not work since for exactly the same reason the new style virtual does not work (that's effectively just an inlined new style virtual dep).

Now because these virtual deps and the ghc/ghc-bin split just causes insanity we have move to a new system for ghc-6.6 and above. We now have a single dev-lang/ghc ebuild which internally uses a .tbz2 binary build of ghc to compile ghc from source. Remember, ghc needs ghc to build.

So we are now in a transitionary phase, the stable ghc-6.4.x and below use the old virtual. The new ghc-6.6.x provides the virtual so existing libs can still build but it does not depend on virtual/ghc any more. Our plan was to get ghc-6.6.1 stable and then eliminate the virtual completely, changing all deps to be dev-lang/ghc and merging ghc-bin into ghc for the older 6.4.2 and 6.2.2 ebuilds.

However, we had to make the new ghc block on ghc-bin since they install some of the same files, so we can't let them be installed at the same time. The solution is to unmerge ghc-bin-6.4.2 and emerge ghg-6.6.x

If anyone has any better suggestions we'd very much like to hear them.
Comment 8 Duncan Coutts (RETIRED) gentoo-dev 2007-08-08 11:26:55 UTC
BTW, just to be clear:

We cannot change the default provider for virtual/ghc. That would make it impossible for people to bootstrap ghc (ie emerge it if they did not already have ghc-bin or ghc installed).
Comment 9 Duncan Coutts (RETIRED) gentoo-dev 2007-08-08 12:27:54 UTC
Actually, I'm not sure I understand what's going on in the example in the original report.

What I don't understand is what is pulling in ghc-bin. The user is using ~ppc keywords and emerging darcs. darcs depends on >=virtual/ghc-6.2.2. dev-lang/ghc-6.6 provides virtual/ghc. There is no dev-lang/ghc-bin-6.6. dev-lang/ghc-6.6 does not depend on virtual/ghc.

So what depends on ghc-bin?

Looks like portage pulls in ghc-bin because of virtual/ghc even though nothing needs it.

We can't remove the block ghc-6.6 has against ghc-bin at the moment. They really do clash.

So perhaps the best solution is to accelerate our plan to eliminate virtual/ghc. We could do that by merging ghc-bin into ghc for 6.4.2 and 6.2.2. (We've already got these ebuilds waiting in our overlay) and go round and change all uses of virtual/ghc to dev-lang/ghc. And p.mask ghc-bin. And then eliminate virtual/ghc from the profiles and have the ghc ebuilds stop providing it.

We were worried this would cause more disruption since users of stable ghc-bin-6.4.2 would have to move to stable ghc-6.4.2 and then only in a few weeks move to ghc-6.6.1 when that goes stable. But if it's borken right now then fixing that takes precedence.

BTW, the other temporary fix is to emerge ghc-6.6.x and then emerge darcs.
Comment 10 Jakub Moc (RETIRED) gentoo-dev 2007-08-08 12:51:54 UTC
(In reply to comment #7)
> The reason that the virtual/ghc must default to ghc-bin is that the ghc source
> ebuild depends on virtual/ghc and ghc needs a version of ghc to build with, so
> it must pull in ghc-bin first to bootstrap.

Then your dependency tree is broken; ghc does not depend on ghc-bin.
Comment 11 Duncan Coutts (RETIRED) gentoo-dev 2007-08-08 13:21:31 UTC
(In reply to comment #10)
> (In reply to comment #7)
> > The reason that the virtual/ghc must default to ghc-bin is that the ghc source
> > ebuild depends on virtual/ghc and ghc needs a version of ghc to build with, so
> > it must pull in ghc-bin first to bootstrap.
> 
> Then your dependency tree is broken; ghc does not depend on ghc-bin.

As I say, we're changing systems, so ghc-6.6.x does not depend on virtual/ghc. The system used in the current stable ghc-6.4.2 and 6.2.2 does depend on virtual/ghc and so that needs ghc-bin to bootstrap. It's that older case that requires the virtual to default to ghc-bin.
Comment 12 Lennart Kolmodin (RETIRED) gentoo-dev 2007-08-08 19:17:54 UTC
As a fix for this package, we have changed the dependency virtual/ghc into simply dev-lang/ghc. This should fix the issue at least for this package. We would have done this eventually anyway.
If you like to avoid build ghc from source, emerge ghc with
USE="binary" emerge ghc
which will install a pre-compiled version, just as ghc-bin does.

William, I've also tried to fix your issue with ghc not compiling.

Please sync your reposes and try again.
Comment 13 William Xu 2007-08-09 06:21:34 UTC
(In reply to comment #12)
> As a fix for this package, we have changed the dependency virtual/ghc into
> simply dev-lang/ghc. This should fix the issue at least for this package. We
> would have done this eventually anyway.
> If you like to avoid build ghc from source, emerge ghc with
> USE="binary" emerge ghc
> which will install a pre-compiled version, just as ghc-bin does.

Yes, i can install pre-compiled version now.

> William, I've also tried to fix your issue with ghc not compiling.

Compiling ghc or darcs both still fail. Even with the pre-compiled
ghc-bin, darcs won't compile.
Comment 14 Zac Medico gentoo-dev 2007-08-10 19:17:12 UTC
(In reply to comment #13)
> Compiling ghc or darcs both still fail. Even with the pre-compiled
> ghc-bin, darcs won't compile.

Please file a separate bug.

*** This bug has been marked as a duplicate of bug 1343 ***
Comment 15 Jakub Moc (RETIRED) gentoo-dev 2007-10-30 23:33:43 UTC
*** Bug 197570 has been marked as a duplicate of this bug. ***
Comment 16 Jakub Moc (RETIRED) gentoo-dev 2007-11-01 13:43:35 UTC
*** Bug 197772 has been marked as a duplicate of this bug. ***
Comment 17 Duncan Coutts (RETIRED) gentoo-dev 2007-11-01 14:24:52 UTC
Nothing in portage depends on virtual/ghc anymore except ghc itself and that's always worked. This change was made in the last day, so people still having trouble should sync and see if it goes away. If it does not, please report it here.

We'll also be switching over to the unified ghc ebuilds that will not depend on virual/ghc at all. We already did that with ghc-6.6.1 and we'll be doing the same for ghc-6.2.2 and 6.4.2 just as soon as we've finished testing.

Then nothing at all will depend on ghc-bin and we can remove the virtual and mask ghc-bin.