2
votes

I'm trying to start going through the book / tutorial for Yesod, but I've hit a problem relatively early. I'm able to successfully install yesod-platform and yesod-bin, but whenever I create a framework using yesod init with a SQL database (tried with both postgres and SQLite), I receive the following error when cabal install-ing said framework.

Loading package persistent-sqlite-1.2.1 ... ghc.exe: 
Unknown PEi386 section name `.drectve' (while processing: 
C:\SSol\yesod\one\.cabal-sandbox\i386-windows-ghc-7.6.3\
persistent-sqlite-1.2.1\libHSpersistent-sqlite-1.2.1.a) ghc.exe: 
panic! (the 'impossible' happened)  
(GHC version 7.6.3 for i386-unknown-mingw32):         loadArchive
"C:\\SSol\\yesod\\one\\.cabal-sandbox\\i386-windows-ghc-7.6.3\\
persistent-sqlite-1.2.1\\libHSpersistent-sqlite-1.2.1.a": failed

A similar error occurs when using a different SQL database, with the applicable persistent package.

However, when building a framework with no database, it installs without a hitch.

I'm using cabal-install native sandboxing on cabal-install version 1.18.03 (though I had the same issue with 1.18.02). I've tried a few fresh installs, and with a clean package cache, all with the same result.

Thanks in advance!

2
This may not at all be relevant, but I've had similar kinds of bugs with lots of different packages on my Linux system since using cabal-install 1.18. One thing that worked for me was (1) deleting the entirety of my ~/.ghc folder and (2) reverting to cabal-install 1.16. - Michael Snoyman
I'm actually now running into an error running yesod devel on the no-DB framework. GHC crashes and devel throws the error: Exit code: ExitFailure (-1073741819) I've no idea if they're related. If you think it's worthwhile, I guess I'll try starting over in a totally fresh environment. I'll probably just build a VM; do you recommend linux over win specifically? If so, is any flavor more supported than another? Thanks, both for your answer now, and for all your work on Yesod. - berman.josh
I personally develop on Ubuntu 12.04 64-bit, so that's probably the most well tested combination. That's also what the FP Complete servers run on, so there's a lot of testing there as well. Things should work fine on Windows in general (I just did a build there yesterday), but there's obviously some kind of a bug here. I'd probably still recommend trying to wipe out your package database and trying again before resorting to a VM. - Michael Snoyman
I had wiped out the package database as one of my troubleshooting steps before posting; sorry, I thought I had mentioned that in my original post. I just tried installing on Ubuntu 12.04 64-bit, but got caught up very quickly in cabal hell (conflict in warp). (As an aside, the instructions in 1.2.2.1 after you "lay the foundation" assume you have cabal 1.18 installed; they include "cabal sandbox init"). I guess I'll go back to trying to get it to work with sandboxes. Thanks. - berman.josh

2 Answers

2
votes

Seems to be an instance of this bug in ghc. It should be fixed in HEAD.

How did you install ghc? AFAIK prebuilt package contains known-to-work gcc version. Did you compiled ghc from sources? If yes, then try the prebuilt package.

1
votes

It is a bug of Cabal.

Workaround: uncomment the line library-for-ghci: True in %APPDATA%\cabal\config. And then cabal install persistent-sqlite --reinstall

You can find more discuss here