[Nix-dev] GHC Panic with basic Yesod project under Nix

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Sat Nov 15 08:43:59 CET 2014


On 11/14/2014 09:40 PM, Michael Jones wrote:
> Hi,
> 
> Not sure where to send this so thought I'd try here to see if anyone has
> the same trouble. I'm new to nix and new to Yesod and trying to build the
> default Yesod project with 'yesod devel' in a new shell.
> 
> My steps are:
> 
> 1. Create a new directory with default.nix:
> 
> { haskellPackages ? (import <nixpkgs> {}).haskellPackages }:
> 
> let inherit (haskellPackages);
> 
> in with haskellPackages; cabal.mkDerivation (self: {
>   pname = "cal";
>   version = "0.0.1";
>   src = ./.;
>   buildDepends = with haskellPackages; [
>     yesod yesodStatic yesodTest
>     yesodBin
>     hjsmin persistentSqlite hspec
>     ];
>   buildTools = with haskellPackages; [ cabalInstall ];
> })
> 
> 2. Run 'nix-shell'
> 3. Run 'yesod init' & fill in <project-name>
> 4. 'cd <project-name>'
> 5. 'yesod devel'
> 
> Fails with:
> 
> Yesod devel server. Press ENTER to quit
> Resolving dependencies...
> Configuring tmp-0.0.0...
> Forcing recompile for ./Foundation.hs because of config/routes
> Forcing recompile for ./Foundation.hs because of messages/en.msg
> Forcing recompile for ./Foundation.hs because of
> templates/default-layout-wrapper.hamlet
> Forcing recompile for ./Foundation.hs because of
> templates/default-layout.hamlet
> Forcing recompile for ./Handler/Home.hs because of templates/homepage.hamlet
> Forcing recompile for ./Handler/Home.hs because of templates/homepage.julius
> Forcing recompile for ./Handler/Home.hs because of templates/homepage.lucius
> Rebuilding application... (using cabal)
> ghc: panic! (the 'impossible' happened)
>   (GHC version 7.8.3 for x86_64-unknown-linux):
> Loading temp shared object failed:
> /run/user/1000/ghc11470_0/ghc11470_25.so: failed to map segment from shared
> object: Operation not permitted
> 
> Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
> 
> Is anyone in a position to offer advice? I've run:
> 
> nix-channel --update
> 
> as well to hopefully get the latest?
> 
> Any help would be much appreciated,
> Michael
> 
> 

I believe abraddar on IRC uses Yesod successfully, it may be worthwhile
to ping him.

In general I think that error means that something has gone pretty badly
and it's an error from ld rather than GHC.

I wonder if ‘eval "$configurePhase"’ before ‘yesod devel’ would help.
Likewise, I wonder whether ‘eval "$buildPhase"’ would work: it may at
least help to narrow down where things are going wrong.

If you can increase verbosity from Yesod output then it should help
debugging too.

For all of this, please run in nix-shell --pure.

-- 
Mateusz K.


More information about the nix-dev mailing list