Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 128846 - dev-lang/ghc-6.4.1-r2 does not build on amd64
Summary: dev-lang/ghc-6.4.1-r2 does not build on amd64
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo's Haskell Language team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-04 17:49 UTC by Luke-Jr
Modified: 2006-06-18 14:24 UTC (History)
0 users

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


Attachments
darcs configure failure (darcs-1.0.6_config.log,9.60 KB, text/plain)
2006-04-05 14:57 UTC, Luke-Jr
Details
equery files --md5sum --type ghc-bin (md5s,103.63 KB, text/plain)
2006-04-06 13:06 UTC, Luke-Jr
Details
/opt/ghc/lib64/ghc-6.4.1/package.conf (package.conf,29.26 KB, text/plain)
2006-04-06 23:01 UTC, Luke-Jr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke-Jr 2006-04-04 17:49:58 UTC
GHC fails to build on x86_64.

------------------------------------------------------------------------
==fptools== make boot - --no-print-directory -r;
 in /var/tmp/portage/ghc-6.4.1-r2/work/ghc-6.4.1/ghc/lib/compat
------------------------------------------------------------------------
../../../glafp-utils/mkdependC/mkdependC -f .depend    -I. -Iinclude -I../../includes  -- -O -Wa,--noexecstack -I. -Iinclude    -- cbits/directory.c cbits/rawSystem.c
/opt/ghc/bin/ghc -M -optdep-f -optdep.depend  -osuf o -optdep--exclude-module=System.Directory.Internals   -H16m -O -optc-nopie -optl-nopie -optc-fno-stack-protector -opta-Wa,--noexecstack -fno-warn-deprecations -I. -Iinclude -Rghc-timing -ignore-package Cabal -I../../../libraries -fglasgow-exts -no-recomp Compat/Directory.hs Compat/RawSystem.hs Distribution/Compat/ReadP.hs Distribution/Extension.hs Distribution/GetOpt.hs Distribution/InstalledPackageInfo.hs Distribution/License.hs Distribution/Package.hs Distribution/ParseUtils.hs Distribution/Setup.hs Distribution/Version.hs
Could not find module `System.Directory':
  use -v to see a list of the files searched for
  (imported from Compat/Directory.hs)
<<ghc: 29875608 bytes, 5 GCs, 136792/136792 avg/max bytes residency (1 samples), 16M in use, 0.00 INIT (0.00 elapsed), 0.05 MUT (0.59 elapsed), 0.01 GC (0.73 elapsed) :ghc>>
make[3]: *** [depend] Error 1
make[2]: *** [boot] Error 1
make[1]: *** [boot] Error 1
make[1]: Leaving directory `/var/tmp/portage/ghc-6.4.1-r2/work/ghc-6.4.1/ghc'
make: *** [build] Error 1

luke-jr@tsurukikun gentoo $ emerge --info
Portage 2.0.54 (!/usr/local/portage/profiles/default-linux/amd64/2004.3, gcc-3.4.3, glibc-2.3.5-r2, 2.6.14-gentoo-r2-ljr x86_64)
=================================================================
System uname: 2.6.14-gentoo-r2-ljr x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.6.12
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5, 2.4.1-r1
sys-apps/sandbox:    1.2.11
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=k8 -pipe -fomit-frame-pointer -fweb -ftracer -fPIC"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr//lib/mozilla/defaults/pref /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/lib/X11/xkb /usr/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=k8 -pipe -fomit-frame-pointer -fweb -ftracer -fPIC"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg ccache distlocks fixpackages keeptemp keepwork sandbox"
GENTOO_MIRRORS="http://distfiles.gentoo.org/"
LDFLAGS="-Wl,-O1"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X acl acpi aim alsa apache2 avi berkdb bitmap-fonts bootsplash bzip2 bzlib calendar caps cjk crypt cups curl curlwrappers dbx dvb dvd dvdr eds emboss encode ethereal faad fam fastcgi fbcon ffmpeg flac flatfile foomaticdb fortran ftp gcj gdbm gif gpm gstreamer gtk gtk2 gtkhtml iconv icq imap imlib inifile ipv6 jabber java jikes joystick jpeg kde ldap libsamplerate lzw lzw-tiff mad maildir matroska mcal memlimit mime mng mp3 mpeg msn mysql ncurses nls nocd nptl oggvorbis opengl oscar oss pam pda pdflib perl php pic png posix ppds python qt quicktime readline samba scanner sdk sdl session shared skey slp snmp socks5 speex spell ssl subversion svg tcpd theora tiff truetype truetype-fonts type1-fonts unicode usb userlocales vhosts vorbis wmf wxwindows xml2 xosd xpm xsl xv xvid yahoo zlib"
Unset:  ASFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-04-05 02:26:37 UTC
Which version?
Comment 2 Luke-Jr 2006-04-05 03:16:06 UTC
!!! ERROR: dev-lang/ghc-6.4.1-r2 failed.
Comment 3 Chris Parrott (RETIRED) gentoo-dev 2006-04-05 07:27:18 UTC
It works fine for me.  I am running a testing profile with newer gcc/binutils/glibc versions, but I believe other members of the haskell herd have tested building ghc-6.4.1-r2 with stable gcc-3.4 and glibc-2.3.5 with no problems.

Here is my emerge --info:

Gentoo Base System version 1.12.0_pre16
Portage 2.1_pre7-r3 (default-linux/amd64/2006.0, gcc-4.0.3, glibc-2.4-r1, 2.6.16-gentoo x86_64)
=================================================================
System uname: 2.6.16-gentoo x86_64 AMD Athlon(tm) 64 Processor 3000+
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.3.5-r2, 2.4.2-r1
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -pipe -ffast-math"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib64/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-O3 -pipe -ffast-math"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo-distfiles.mirrors.tds.net"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X alsa apache2 avi berkdb bitmap-fonts cli crypt ctype cups dba dri eds emboss encode expat fastbuild foomaticdb force-cgi-redirect fortran ftp gd gif gnome gpm gstreamer gtk gtk2 imlib ipv6 isdnlog jpeg kde lzw lzw-tiff memlimit mp3 mpeg ncurses nls nptl opengl pam pcre pdflib perl png posix pppd python qt quicktime readline sdl session simplexml soap sockets spell spl ssl tcpd tiff tokenizer truetype truetype-fonts type1-fonts usb xml xpm xsl xv zlib elibc_glibc kernel_linux userland_GNU"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LANG, LC_ALL, LDFLAGS, LINGUAS


My initial guess is that having "ccache" in your FEATURES may be causing you some trouble.  I don't think any of us have tested building ghc with distcc and cache, and this is probably not yet supported by the upstream ghc developers.  To be completely safe, you might also want to take out "distcc", "keepwork", and "keeptemp" from your FEATURES, as well.  You might try reemerging ghc-6.4.1-r2 with the following command, to see if you have better luck:

  FEATURES="-distcc -ccache -keepwork -keeptemp" emerge ghc

We will continue to investigate.
Comment 4 Duncan Coutts (RETIRED) gentoo-dev 2006-04-05 12:50:55 UTC
What version of ghc-bin are you using Luke?
Comment 5 Luke-Jr 2006-04-05 14:05:47 UTC
[ebuild   R   ] dev-lang/ghc-bin-6.4.1  0 kB
Comment 6 Luke-Jr 2006-04-05 14:56:36 UTC
If 'darcs' can be trusted as a quick-and-reliable prediction for GHC's result (they both fail), then -distcc -ccache doesn't help the matter.

checking how to run the C preprocessor... x86_64-pc-linux-gnu-gcc -E
checking for a BSD-compatible install... /bin/install -c
checking for ghc... ghc
configure: error: Compile failed.

!!! Please attach the config.log to your bug report:
!!! /var/tmp/portage/darcs-1.0.6/work/darcs-1.0.6/config.log                    
Comment 7 Luke-Jr 2006-04-05 14:57:29 UTC
Created attachment 84029 [details]
darcs configure failure
Comment 8 Duncan Coutts (RETIRED) gentoo-dev 2006-04-05 15:40:59 UTC
(In reply to comment #7)
> Created an attachment (id=84029) [edit]
> darcs configure failure

This would be the important bit:

configure:2680: found /opt/ghc/bin/ghc
configure:2690: result: ghc
configure:2712: ghc  -o conftest conftest.hs

conftest.hs:1:0:
    Failed to load interface for `Prelude':
	Could not find module `Prelude': use -v to see a list of the files searched for
configure:2715: $? = 1
configure: failed program was:
-- #line 2707 "configure"
main = putStr "Hello world!\n"
end of failed program.
configure:2724: error: Compile failed.

This would indicate a messed-up installation of ghc-bin.

Perhaps you could try compiling a hello world program using -v to see where it's looking and check that those .hi files really do exist.

The output of "ghc-pkg list" might also shed some light on the situation.
Comment 9 Luke-Jr 2006-04-05 17:13:41 UTC
tsurukikun portage # ghc-pkg list
bash: ghc-pkg: command not found
tsurukikun portage # /opt/ghc/bin/ghc-pkg list
/opt/ghc/lib64/ghc-6.4.1/package.conf:
    rts-1.0, base-1.0, haskell98-1.0, template-haskell-1.0, unix-1.0,
    Cabal-1.0, parsec-1.0, haskell-src-1.0, network-1.0,
    QuickCheck-1.0, HUnit-1.1, mtl-1.0, fgl-5.2, stm-1.0, readline-1.0,
    (lang-1.0), (concurrent-1.0), (posix-1.0), (util-1.0), (data-1.0),
    (text-1.0), (net-1.0), (hssource-1.0)
Comment 10 Duncan Coutts (RETIRED) gentoo-dev 2006-04-06 02:06:04 UTC
(In reply to comment #9)
> tsurukikun portage # ghc-pkg list
> bash: ghc-pkg: command not found

Was this run from a terminal that was opened before ghc-bin was installed? Just like if you switch gcc, after installing ghc-bin you need to run
source /etc/profile
in any existing terminals. Otherwise /opt/ghc/bin will not get added to your PATH for the existing sessions.

This will not be the root of the problem however.

Ok, so I suspect that the ghc-bin install is corrupted in some way. Can you run these tests:

For this test you will need to have portage-utils installed. The output from thic command should be short enough that it can be included inline in this bug report.

$ qcheck ghc-bin : verify digests


The output from the following command will be quite long. It would be best to add it as an attachment to this bug report.

$ equery files --md5sum --type ghc-bin
Comment 11 Luke-Jr 2006-04-06 13:05:40 UTC
luke-jr@tsurukikun ~ $ qcheck ghc-bin : verify digests
Checking dev-lang/ghc-bin-6.4.1 ...
  * 1155 out of 1155 files are good
Comment 12 Luke-Jr 2006-04-06 13:06:34 UTC
Created attachment 84075 [details]
equery files --md5sum --type ghc-bin

luke-jr@tsurukikun ~ $ equery files --md5sum --type ghc-bin >/tmp/md5s
Comment 13 Luke-Jr 2006-04-06 13:08:03 UTC
No, it was a new terminal, though not a new login session (which only happens during reboot, really)...
However, sourcing /etc/profile prior to emerging does not help the problem.
Comment 14 Duncan Coutts (RETIRED) gentoo-dev 2006-04-06 15:52:48 UTC
Ok, so that all looks ok. The next things we thought of are:

1. attach your /opt/ghc/lib64/ghc-6.4.1/package.conf

2. what is your $PATH ?

3. what do you get when compiling the following module using -v:

$ echo 'main = print "hello world"' > hello.hs
$ ghc -v hello.hs

again that output is quite big, you may prefer to attach it.
Comment 15 Luke-Jr 2006-04-06 23:01:48 UTC
Created attachment 84105 [details]
/opt/ghc/lib64/ghc-6.4.1/package.conf
Comment 16 Luke-Jr 2006-04-06 23:03:02 UTC
PATH=~/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/3.4.3:/opt/ghc/bin:/opt/blackdown-jdk-1.4.2.02/bin:/opt/blackdown-jdk-1.4.2.02/jre/bin:/usr/bin:/usr/qt/3/bin:/usr/kde/3.4/sbin:/usr/kde/3.4/bin:/usr/kde/3.3/sbin:/usr/kde/3.3/bin

tsurukikun tmp # echo 'main = print "hello world"' > hello.hs
tsurukikun tmp # ghc -v hello.hs
Glasgow Haskell Compiler, Version 6.4.1, for Haskell 98, compiled by GHC version 6.4.1
Using package config file: /opt/ghc/lib64/ghc-6.4.1/package.conf
Hsc static flags: -static
*** Checking old interface for Main:
*** Parser:
*** Renamer/typechecker:

hello.hs:1:0:
    Failed to load interface for `Prelude':
        Could not find module `Prelude':
          locations searched:
            Prelude.hi
            Prelude.hi-boot
            /usr/lib64/ghc-6.4.1/imports/Prelude.hi
*** Deleting temp files
Deleting: /tmp/ghc2077.s
Warning: deleting non-existent /tmp/ghc2077.s
Comment 17 Chris Parrott (RETIRED) gentoo-dev 2006-04-07 00:38:13 UTC
Ah, I see your problem, although the root cause is not yet clear to me.  Your package.conf contains references to directories in /usr/lib64/ghc-6.4.1, which are not valid for ghc-bin-6.4.1, where everything is stored in /opt/ghc.  Here are a few bits in your package.conf which illustrate the problem:

libraryDirs = ["/usr/lib64/ghc-6.4.1"], hsLibraries = ["HSrts"], extraLibraries = ["m","gmp","dl"], includeDirs = ["/usr/lib64/ghc-6.4.1/include"], includes = ["Stg.h"], depends = []

Instead, these paths should resemble the following:

libraryDirs = ["/opt/ghc/lib64/ghc-6.4.1"], hsLibraries = ["HSrts"], extraLibraries = ["m","gmp","dl"], includeDirs = ["/opt/ghc/lib64/ghc-6.4.1/include"], includes = ["Stg.h"], depends = []

Duncan normally tests ghc-bin on a stable configuration, so I am puzzled as to how this ended up in your /opt/ghc/lib64/package.conf file.  As a workaround, you can try using sed to fix your package.conf file, as follows:

  sed -i -e "s|/usr|/opt/ghc|g" /opt/ghc/lib64/package.conf

There WAS a bug in ghc-bin-6.4, in which the wrong paths (such as yours) were not fixed in package.conf by the ebuild script prior to installation.  This should have been fixed in ghc-bin-6.4.1, so I am not sure why the sed commands in src_install() have failed to fix the paths in your package.conf.  (It did the right thing in all of the tests we tried...)

You might try syncing up your portage tree and reemerging ghc-bin-6.4.1, just to see if the paths in package.conf get fixed this time around.  If not, then I will try to replicate your environment in a chroot directory and see if I can reproduce the problem.  This may take a while, as I will be out of town for much of next week.
Comment 18 Duncan Coutts (RETIRED) gentoo-dev 2006-04-27 16:22:24 UTC
Luke, any luck on this? any progress?
Comment 19 Luke-Jr 2006-04-28 07:05:11 UTC
Executing the sed manually worked, thanks.
My portage tree was up to sync prior to emerging and reporting this bug.
Comment 20 Duncan Coutts (RETIRED) gentoo-dev 2006-05-18 14:11:00 UTC
Is this bug still reproducable or can we close it?

Does emerging ghc-bin-6.4.1 still give messed up paths in:
/opt/ghc/lib64/ghc-6.4.1/package.conf
Comment 21 Duncan Coutts (RETIRED) gentoo-dev 2006-06-18 14:24:00 UTC
No activity on this bug for a month. We have not been able to reproduce it.

If anyone can repoduce it then do please reopen this bug report.