[Nix-dev] GHC 7.8.2-binary.nix to bootstrap GHC HEAD

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Sat May 3 07:42:11 CEST 2014


On 05/03/2014 07:15 AM, Mateusz Kowalczyk wrote:
> Amongst my struggles to get recent GHC HEAD snapshots to work on NixOS,
> I noticed that GHC 7.4.2 is used to bootstrap it. Perhaps that's what's
> causing the problems[1] so my current goal is to make a binary install
> of GHC 7.8.2 work. To be clear, I want to be able to install the GHC
> 7.8.2 binary provided by the GHC team, which I can then hopefully use to
> bootstrap HEAD.
> 
> 
> I added
> 
>   ghc782Binary = lowPrio (callPackage
> ../development/compilers/ghc/7.8.2-binary.nix {
>     gmp = pkgs.gmp;
>   });
> 
> to haskell-defaults.nix and set ‘ghcBinary = ghc782Binary; in the same
> file for ghcHEAD.
> 
> I had then copied + pasted the most recent binary package, that is 7.4.2
> and renamed it appropriately. I fixed the download links and hashes.
> 
> First problem was some /bin/bash paths. I fix those with shebang fix.
> 
> Second problem was libgcc_s.so not being found. I change LD_LIBRARY_PATH
> in configurePhase to accommodate for this.
> 
> It now goes to the install phase but in the end fails with:
> 
> /nix/store/451gmdjnzl3pwvgclrhyqb3znfg3mzi1-ghc-7.8.2-binary/lib/ghc-7.8.2/bin/ghc-pkg:
> error while loading shared libraries: libHSterminfo-0.4.0.0-ghc7.8.2.so:
> cannot open shared object file: No such file or directory
> 
> I can confirm that all those libraries are in the stored under
> lib/ghc-7.8.2/<libraryname> but the copied binaries seem to have no idea
> about them. IN fact, everything in lib/ghc-7.8.2/bin has no idea about
> where its libraries are:
> 
> [shana at lenalee:~/programming/haddock]$ ldd
> /nix/store/451gmdjnzl3pwvgclrhyqb3znfg3mzi1-ghc-7.8.2-binary/lib/ghc-7.8.2/bin/ghc-pkg
> 
>         linux-gate.so.1 (0xb7736000)
> 
> 
>         libHSterminfo-0.4.0.0-ghc7.8.2.so => not found
> 
> 
>         libHSbin-package-db-0.0.0.0-ghc7.8.2.so => not found
> 
> 
>         libHSbinary-0.7.1.0-ghc7.8.2.so => not found
> 
> 
>         libHSCabal-1.18.1.3-ghc7.8.2.so => not found
> 
> 
>         libHSprocess-1.2.0.0-ghc7.8.2.so => not found
> 
> 
>         libHSpretty-1.1.1.1-ghc7.8.2.so => not found
> 
> 
>         libHSdirectory-1.2.1.0-ghc7.8.2.so => not found
>         libHSunix-2.7.0.1-ghc7.8.2.so => not found
>         libHStime-1.4.2-ghc7.8.2.so => not found
>         libHSold-locale-1.0.0.6-ghc7.8.2.so => not found
>         libHSfilepath-1.3.0.2-ghc7.8.2.so => not found
>         libHScontainers-0.5.5.1-ghc7.8.2.so => not found
>         libHSbytestring-0.10.4.0-ghc7.8.2.so => not found
>         libHSdeepseq-1.3.0.2-ghc7.8.2.so => not found
>         libHSarray-0.5.0.0-ghc7.8.2.so => not found
>         libHSbase-4.7.0.0-ghc7.8.2.so => not found
>         libHSinteger-gmp-0.5.1.0-ghc7.8.2.so => not found
>         libHSghc-prim-0.3.1.0-ghc7.8.2.so => not found
>         libHSrts-ghc7.8.2.so => not found
>         libffi.so.6 => not found
>         libtinfo.so.5 => not found
>         librt.so.1 =>
> /nix/store/4v0a2fncxsk2f57jixq7i59k6hdl34fx-glibc-2.19/lib/librt.so.1
> (0xb7728000)
>         libutil.so.1 =>
> /nix/store/4v0a2fncxsk2f57jixq7i59k6hdl34fx-glibc-2.19/lib/libutil.so.1
> (0xb7723000)
>         libdl.so.2 =>
> /nix/store/4v0a2fncxsk2f57jixq7i59k6hdl34fx-glibc-2.19/lib/libdl.so.2
> (0xb771f000)
>         libgmp.so.10 =>
> /nix/store/qnkyas42nf0knps3va30y29y3zvmgy2v-gmp-5.1.3/lib/libgmp.so.10
> (0xb769d000)
>         libm.so.6 =>
> /nix/store/4v0a2fncxsk2f57jixq7i59k6hdl34fx-glibc-2.19/lib/libm.so.6
> (0xb765c000)
>         libc.so.6 =>
> /nix/store/4v0a2fncxsk2f57jixq7i59k6hdl34fx-glibc-2.19/lib/libc.so.6
> (0xb74c7000)
>         libpthread.so.0 =>
> /nix/store/4v0a2fncxsk2f57jixq7i59k6hdl34fx-glibc-2.19/lib/libpthread.so.0
> (0xb74ad000)
> 
> /nix/store/4v0a2fncxsk2f57jixq7i59k6hdl34fx-glibc-2.19/lib/ld-linux.so.2
> (0xb7737000)
> 
> 
> I am now stuck here, I don't know how to get the binaries to see the
> libraries properly. All this happens during the installPhase (left
> default) step, copying the libs followed by whatever it is the binaries
> are meant to be doing. The next thing that comes to mind is to gut GHC's
> install phase to let me patchelf the binaries after copying the
> libraries, but that doesn't sound pretty. Perhaps I am simply doing
> something very wrong, or the nix code from 7.4.2 messes something up.
> 
> I am attaching the two relevant files. Any input *very* welcome.
> 
> [1]: https://github.com/NixOS/nixpkgs/issues/2428
> 
> 
> 
> 
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> 

Alternatively, instructions on how to use GHC 7.8.2 that we can build
(or get from Hydra) already to build 7.9 would probably be much easier.

-- 
Mateusz K.


More information about the nix-dev mailing list