Ticket #3151 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

Hello World does not compile (missing Prelude?)

Reported by: fft1976 Owned by:
Priority: normal Milestone: 6.10 branch
Component: Build System Version: 6.10.2
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Note: This is actually 6.10.2 (the Ticket Properties does not give this choice)

$ cat hello.hs 
main = do
  putStrLn "Hello, World"

$ which ghc
/home/t/local/bin/ghc
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.10.2
$ ghc --make hello
[1 of 1] Compiling Main             ( hello.hs, hello.o )

hello.hs:1:0:
    Failed to load interface for `Prelude':
      Use -v to see a list of the files searched for.

Ubuntu 8.04 GHC 6.8.2 works though:

$ /usr/bin/ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.8.2
$ /usr/bin/ghc --make hello
[1 of 1] Compiling Main             ( hello.hs, hello.o )
Linking hello ...
$ ./hello 
Hello, World
$ ghc -v --make hello

Prints lots of stuff, including:

hello.hs:1:0:
    Failed to load interface for `Prelude':
      locations searched:
        Prelude.hs
        Prelude.lhs

Indeed, Prelude seems to be missing:

$ cd ~/local/lib/ghc-6.10.2/
$ find . -name \*elude\*

I can also confirm another bug report (the reason is likely the same):

$ ghci
GHCi, version 6.10.2: http://www.haskell.org/ghc/  :? for help
ghc: panic! (the 'impossible' happened)
  (GHC version 6.10.2 for i386-unknown-linux):
	interactiveUI:setBuffering2

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Attachments

config.log Download (8.8 KB) - added by fft1976 3 years ago.
configure_stdout.log Download (1.5 KB) - added by fft1976 3 years ago.
make_install_stdout.log Download (47.3 KB) - added by fft1976 3 years ago.

Change History

  Changed 3 years ago by fft1976

I should add that I installed the binary version with

./configure --prefix=/home/t/local ; make install

  Changed 3 years ago by fft1976

  • severity changed from normal to critical

  Changed 3 years ago by igloo

  • difficulty set to Unknown
  • version changed from 6.10.1 to 6.10.2
  • milestone set to 6.10 branch

Which bindist were you trying to install from?

Can you please redirect the "configure" and "make install" output to files and attach them?

Changed 3 years ago by fft1976

  Changed 3 years ago by fft1976

I retried the installation after emptying ~/.bashrc just in case. config.log attached above. STDOUT redirections attached below. As you can see, a lot is missing in PREFIX/lib/ghc-*

$ env | grep ^PATH
PATH=/home/t/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
$ ls /usr/local/sbin /usr/local/bin/
/usr/local/bin/:

/usr/local/sbin:

$ mkdir ~/try_ghc
$ tar xjf ghc-6.10.2-i386-unknown-linux-libedit2.tar.bz2 
$ cd ghc-6.10.2
$ ./configure --prefix=/home/t/try_ghc > configure_stdout.log
$ make install > make_install_stdout.log
mkdir /home/t/try_ghc/bin
mkdir /home/t/try_ghc/lib
mkdir /home/t/try_ghc/lib/ghc-6.10.2
mkdir /home/t/try_ghc/lib/ghc-6.10.2/include
haddock-2.4.2: dependency Cabal-1.6.0.3 doesn't exist (ignoring)
haddock-2.4.2: dependency array-0.2.0.0 doesn't exist (ignoring)
haddock-2.4.2: dependency base-4.1.0.0 doesn't exist (ignoring)
haddock-2.4.2: dependency containers-0.2.0.1 doesn't exist (ignoring)
haddock-2.4.2: dependency directory-1.0.0.3 doesn't exist (ignoring)
haddock-2.4.2: dependency filepath-1.1.0.2 doesn't exist (ignoring)
haddock-2.4.2: dependency ghc-6.10.2 doesn't exist (ignoring)
haddock-2.4.2: dependency haskell98-1.0.1.0 doesn't exist (ignoring)
haddock-2.4.2: dependency pretty-1.0.1.0 doesn't exist (ignoring)
rts-1.0: include-dirs: PAPI_INCLUDE_DIR doesn't exist or isn't a directory (ignoring)
rts-1.0: cannot find libHSrts.a on library path (ignoring)
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
ifBuildable/ifBuildable: error while loading shared libraries: libffi.so.5: cannot open shared object file: No such file or directory
mkdir /home/t/try_ghc/share/doc/ghc/libraries
ghc-6.10.2: dependency Cabal-1.6.0.3 doesn't exist (ignoring)
ghc-6.10.2: dependency array-0.2.0.0 doesn't exist (ignoring)
ghc-6.10.2: dependency base-4.1.0.0 doesn't exist (ignoring)
ghc-6.10.2: dependency bytestring-0.9.1.4 doesn't exist (ignoring)
ghc-6.10.2: dependency containers-0.2.0.1 doesn't exist (ignoring)
ghc-6.10.2: dependency directory-1.0.0.3 doesn't exist (ignoring)
ghc-6.10.2: dependency editline-0.2.1.0 doesn't exist (ignoring)
ghc-6.10.2: dependency filepath-1.1.0.2 doesn't exist (ignoring)
ghc-6.10.2: dependency haskell98-1.0.1.0 doesn't exist (ignoring)
ghc-6.10.2: dependency hpc-0.5.0.3 doesn't exist (ignoring)
ghc-6.10.2: dependency old-time-1.0.0.2 doesn't exist (ignoring)
ghc-6.10.2: dependency process-1.0.1.1 doesn't exist (ignoring)
ghc-6.10.2: dependency template-haskell-2.3.0.1 doesn't exist (ignoring)
ghc-6.10.2: dependency unix-2.3.2.0 doesn't exist (ignoring)
mkdir /home/t/try_ghc/share/man
mkdir /home/t/try_ghc/share/man/man1
$ ls ~/try_ghc/lib/ghc-6.10.2/
extra-gcc-opts	ghc-asm		ghc-split      haddock-2.4.2  HSrts.o  libffi.a		 libHSrts_p.a	       libHSrts_thr_p.a  unlit
ghc		ghci-usage.txt	ghc-usage.txt  hsc2hs	      html     libHSrts.a	 libHSrts_thr.a        package.conf
ghc-6.10.2	ghc-pkg		haddock        hsc2hs-0.67    include  libHSrts_debug.a  libHSrts_thr_debug.a  runghc
$ /usr/bin/du -sh ~/try_ghc/lib/ghc-6.10.2/
150M	/home/t/try_ghc/lib/ghc-6.10.2/
$ find ~/try_ghc/lib/ghc-6.10.2/ -name \*elude\*
$ 

Changed 3 years ago by fft1976

Changed 3 years ago by fft1976

  Changed 3 years ago by fft1976

I just retried it with

export PATH=/bin:/usr/bin

Exactly the same outcome.

Also, the same thing happens when trying this as root and without

--prefix=...

  Changed 3 years ago by igloo

  • component changed from Compiler to Build System

OK, if you install libffi5 then this should work.

I think it's a bug that you need to, so we should look into this if we make a 6.10.3.

follow-up: ↓ 12   Changed 3 years ago by fft1976

Thanks, Igloo!

Indeed, ghci seems to start now and Hello World compiles and runs, but

make install > /dev/null

still prints this:

mkdir /home/t/try_ghc/bin
mkdir /home/t/try_ghc/lib
mkdir /home/t/try_ghc/lib/ghc-6.10.2
mkdir /home/t/try_ghc/lib/ghc-6.10.2/include
haddock-2.4.2: dependency Cabal-1.6.0.3 doesn't exist (ignoring)
haddock-2.4.2: dependency array-0.2.0.0 doesn't exist (ignoring)
haddock-2.4.2: dependency base-4.1.0.0 doesn't exist (ignoring)
haddock-2.4.2: dependency containers-0.2.0.1 doesn't exist (ignoring)
haddock-2.4.2: dependency directory-1.0.0.3 doesn't exist (ignoring)
haddock-2.4.2: dependency filepath-1.1.0.2 doesn't exist (ignoring)
haddock-2.4.2: dependency ghc-6.10.2 doesn't exist (ignoring)
haddock-2.4.2: dependency haskell98-1.0.1.0 doesn't exist (ignoring)
haddock-2.4.2: dependency pretty-1.0.1.0 doesn't exist (ignoring)
rts-1.0: include-dirs: PAPI_INCLUDE_DIR doesn't exist or isn't a directory (ignoring)
rts-1.0: cannot find libHSrts.a on library path (ignoring)
mkdir /home/t/try_ghc/share/man
mkdir /home/t/try_ghc/share/man/man1

Are those rts errors (and others) something I should worry about?

By the way, trac may be broken or there are email problems. I didn't get an email notification about your last entry here, so I almost missed it.

follow-up: ↓ 9   Changed 3 years ago by lpsmith

I too can confirm both this bug and #3144

As libffi5 is not available for my distro (Ubuntu 8.04), and I didn't particularly want to manage it myself, I simply compiled my own GHC. It appears to be working a-ok.

in reply to: ↑ 8   Changed 3 years ago by fft1976

Replying to lpsmith:

I too can confirm both this bug and #3144 As libffi5 is not available for my distro (Ubuntu 8.04), and I didn't particularly want to manage it myself, I simply compiled my own GHC. It appears to be working a-ok.

Does your "readline"/"line-edit" functionality work in ghci? I tried compiling from source (Ubuntu 8.04 here as well), but that functionality is broken. In the binary, it works fine though.

follow-up: ↓ 11   Changed 3 years ago by lpsmith

Yep, libedit works fine as well. This guess is probably wrong, but are you sure you have the libedit-dev package installed?

in reply to: ↑ 10   Changed 3 years ago by fft1976

Replying to lpsmith:

Yep, libedit works fine as well. This guess is probably wrong, but are you sure you have the libedit-dev package installed?

Installing libedit-dev fixed it for me. (Thanks!) I knew I only had libedit2, but I assumed GHC didn't need C headers.

in reply to: ↑ 7   Changed 3 years ago by igloo

Replying to fft1976:

Are those rts errors (and others) something I should worry about?

No, that looks fine.

  Changed 3 years ago by igloo

I've just done a little more digging. It looks like only the i386-unknown-linux-libedit2 build needs libffi, which is due to a combination of two things:

  • The Debian ghc6 package that it was built with uses the system libffi rather than the in-tree libffi
  • ifBuildable is built with the bootstrapping compiler rather than the in-tree compiler

If we make a 6.10.3 then we should fix the last point. For 6.12, this is done differently in the new build system, and the libedit2 builds won't be needed for 6.12 anyway (as we won't be using libedit).

  Changed 3 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

This was built without the libffi dependency in 6.10.3.

Note: See TracTickets for help on using tickets.