yesodweb / yesod

A RESTful Haskell web framework built on WAI.
http://www.yesodweb.com/
MIT License
2.64k stars 373 forks source link

yesod devel "cannot satisfy -package-id main-inplace" #864

Closed DaveCTurner closed 9 years ago

DaveCTurner commented 9 years ago

Hi,

Just been starting to run through a yesod tutorial and have run into a problem running yesod devel, that it cannot find package main-inplace.

I have a slightly odd setup - I'm not using Haskell Platform so my only global packages are the ones that GHC depends on, and then I use sandboxes for everything else. I've not had too many problems with this setup before, but I've no idea where to start on this issue.

Here is the output of yesod devel -v:

$ yesod devel -v
Yesod devel server. Press ENTER to quit
Resolving dependencies...
Configuring tutorial-0.0.0...
Rebuilding application... (using cabal)
Building tutorial-0.0.0...
Preprocessing library tutorial-0.0.0...
In-place registering tutorial-0.0.0...
Preprocessing test suite 'test' for tutorial-0.0.0...
Starting development server: runghc -package-dbdist/package.conf.inplace -package-db/home/linuxadmin/cabal-sandbox/x86_64-linux-ghc-7.8.3-packages.conf.d -hide-all-packages -package-idtutorial-0.0.0-inplace -package-idyesod-test-1.4.1-b31b95049ef6ba1730eb850390f5e8fc -package-idyesod-core-1.4.3.1-074b8043be3c9133f6ddfdf0045f8924 -package-idyesod-1.4.0-5e3206aec7133ee6d8a74b1054fd4616 -package-idhspec-1.12.4-9457d8016c9beacd4c15267fc4d14090 -package-idbase-4.7.0.1-e4b74d27ad8c8987c63abc42a80e7335 -package-idmain-inplace devel.hs
<command line>: cannot satisfy -package-id main-inplace
    (use -v for more information)
Exit code: ExitFailure 1

And here is what happens when I run runghc myself with the -v option:

$ runghc -v -package-dbdist/package.conf.inplace -package-db/home/linuxadmin/cabal-sandbox/x86_64-linux-ghc-7.8.3-packages.conf.d -hide-all-packages -package-idtutorial-0.0.0-inplace -package-idyesod-test-1.4.1-b31b95049ef6ba1730eb850390f5e8fc -package-idyesod-core-1.4.3.1-074b8043be3c9133f6ddfdf0045f8924 -package-idyesod-1.4.0-5e3206aec7133ee6d8a74b1054fd4616 -package-idhspec-1.12.4-9457d8016c9beacd4c15267fc4d14090 -package-idbase-4.7.0.1-e4b74d27ad8c8987c63abc42a80e7335 -package-idmain-inplace devel.hs
Glasgow Haskell Compiler, Version 7.8.3, stage 2 booted by GHC version 7.4.1
Using binary package database: /opt/ghc/7.8.3/lib/ghc-7.8.3/package.conf.d/package.cache
Using binary package database: /home/linuxadmin/.ghc/x86_64-linux-7.8.3/package.conf.d/package.cache
Using package config file: dist/package.conf.inplace
Using binary package database: /home/linuxadmin/cabal-sandbox/x86_64-linux-ghc-7.8.3-packages.conf.d/package.cache
package tutorial-0.0.0-9614df4efb8c03ab89d0e29d89c3a06a is shadowed by package tutorial-0.0.0-inplace
*** Deleting temp files:
Deleting:
*** Deleting temp dirs:
Deleting:
<command line>: cannot satisfy -package-id main-inplace
    (use -v for more information)

Not sure what else might help.

Any advice gratefully received!

DCT

snoyberg commented 9 years ago

I don't know what's going on here, the -inplace package should be tutorial-inplace, but somehow it's coming out as main-inplace. Can you try generating an unaltered scaffolding and see if yesod devel works in there?

creichert commented 9 years ago

A short in the dark here, have you changed the executable or package name in your cabal file? I have seen similar errors when I forget to also modify the executable name at the top of `devel.hs'.

e.g. import "tutorial" Application (getApplicationDev)

DaveCTurner commented 9 years ago

@creichert - I'm afraid not, no. This was a fresh project. The top three lines of of devel.hs are

{-# LANGUAGE CPP #-}
{-# LANGUAGE PackageImports #-}
import "tutorial" Application (getApplicationDev)

Here's a full transcript going from scratch:

Using username "linuxadmin".
Authenticating with public key "trac-leeds-09"
Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-39-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Thu Nov 13 10:51:54 UTC 2014

  System load:  0.0                Processes:           132
  Usage of /:   72.2% of 19.31GB   Users logged in:     1
  Memory usage: 15%                IP address for eth0: 10.0.3.139
  Swap usage:   0%

  Graph this data and manage this system at:
    https://landscape.canonical.com/

8 packages can be updated.
0 updates are security updates.

Last login: Thu Nov 13 10:08:35 2014 from 10.0.3.110
[linuxadmin@vm01 11:20:26 ~ ]
$ mkdir yesod-test-2
[linuxadmin@vm01 11:20:37 ~ ]
$ cd yesod-test-2
[linuxadmin@vm01 11:20:39 ~/yesod-test-2 ]
$ ls
[linuxadmin@vm01 11:20:40 ~/yesod-test-2 ]
$ yesod init
Welcome to the Yesod scaffolder.
I'm going to be creating a skeleton Yesod project for you.

What do you want to call your project? We'll use this for the cabal name.

Project name: tutorial
Yesod uses Persistent for its (you guessed it) persistence layer.
This tool will build in either SQLite or PostgreSQL or MongoDB support for you.
We recommend starting with SQLite: it has no dependencies.

    s      = sqlite
    p      = postgresql
    pf     = postgresql + Fay (experimental)
    mongo  = mongodb
    mysql  = MySQL
    simple = no database, no auth
    url    = Let me specify URL containing a site (advanced)

So, what'll it be? simple
That's it! I'm creating your files now...

---------------------------------------

                     ___
                            {-)   |\
                       [m,].-"-.   /
      [][__][__]         \(/\__/\)/
      [__][__][__][__]~~~~  |  |
      [][__][__][__][__][] /   |
      [__][__][__][__][__]| /| |
      [][__][__][__][__][]| || |  ~~~~
  ejm [__][__][__][__][__]__,__,  \__/

---------------------------------------

The foundation for your web application has been built.

There are a lot of resources to help you use Yesod.
Start with the book: http://www.yesodweb.com/book
Take part in the community: http://yesodweb.com/page/community

It's highly recommended to follow the quick start guide for
installing Yesod: http://www.yesodweb.com/page/quickstart

If your system is already configured correctly, please run:

   cd tutorial && cabal install -j --enable-tests --max-backjumps=-1 --reorder-goals && yesod devel
[linuxadmin@vm01 11:20:52 ~/yesod-test-2 ]
$ cd tutorial
[linuxadmin@vm01 11:20:59 ~/yesod-test-2/tutorial ]
$ cabal sandbox init --sandbox ~/cabal-sandbox/
Writing a default package environment file to
/home/linuxadmin/yesod-test-2/tutorial/cabal.sandbox.config
Using an existing sandbox located at /home/linuxadmin/cabal-sandbox
[linuxadmin@vm01 11:21:09 ~/yesod-test-2/tutorial ]
$ cabal install -j --enable-tests --max-backjumps=-1 --reorder-goals
Resolving dependencies...
In order, the following will be installed:
tutorial-0.0.0 *test (reinstall) changes: hspec-1.12.4 added, yesod-test-1.4.1
added
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Notice: installing into a sandbox located at /home/linuxadmin/cabal-sandbox
Configuring tutorial-0.0.0...
Building tutorial-0.0.0...
Installed tutorial-0.0.0
Updating documentation index
/home/linuxadmin/cabal-sandbox/share/doc/index.html
[linuxadmin@vm01 11:22:03 ~/yesod-test-2/tutorial ]
$ yesod devel
Yesod devel server. Press ENTER to quit
Resolving dependencies...
Configuring tutorial-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)
Starting development server...
<command line>: cannot satisfy -package-id main-inplace
    (use -v for more information)
Exit code: ExitFailure 1
DaveCTurner commented 9 years ago

NB that is using a shared sandbox that already had everything installed, hence the warning about test being reinstalled. I get the same effect if I replace the command at 11:20:59 with a straight cabal sandbox init to make a fresh sandbox.

DaveCTurner commented 9 years ago

Furthermore, just to check, I set myself up to use Stackage (snapshot e36ddac9333f2197ada6883b52f4834ddc0d5e37), reinstalled yesod-bin and tried again with the new binary. Same effect.

snoyberg commented 9 years ago

I tried some of these tweaks, and was still unable to reproduce. Can you tell me the outputs of cabal --version and ghc-pkg list Cabal, and preferably how you installed cabal-install?

Also, if you could test this without a sandbox, that might be informative. I just tested with a sandbox and it worked, so I doubt that's the problem, but you never know.

DaveCTurner commented 9 years ago
[linuxadmin@vm01 12:51:34 ~ ]
$ cabal --version
cabal-install version 1.21.0.0
using version 1.21.0.0 of the Cabal library
[linuxadmin@vm01 12:51:38 ~ ]
$ ghc-pkg list Cabal
/opt/ghc/7.8.3/lib/ghc-7.8.3/package.conf.d
   Cabal-1.18.1.3
/home/linuxadmin/.ghc/x86_64-linux-7.8.3/package.conf.d
   Cabal-1.20.0.0

You might be onto something with your question about where cabal-install came from. The latest one on Hackage is 1.20.0.3 but I seem to have 1.21.0.0 which I must have obtained directly from github. I believe it to be from commit 47984faadaafc90017c8b12593941763836a4306. I had forgotten I'd done that - I was having issues with the --allow-newer flag that was fixed in an unreleased version.

I will try going back to a proper version of cabal-install and see if that helps.

DaveCTurner commented 9 years ago

Ok, I've wiped out what I think counts as 'everything' and started again, without a sandbox and using Stackage e36ddac9333f2197ada6883b52f4834ddc0d5e37 from the word go. I'm still getting that message.

Installed cabal-install with cabal unpack cabal-install (which picked cabal-install-1.18.0.5) followed by ./bootstrap.sh then moved the binary into my $PATH.

From there I installed yesod-bin and then ran yesod init, cabal install and yesod devel (transcript below) and still it complains about 'main-inplace'.

(The 'unrecognised stanza' is talking about a haddock block that apparently isn't supported in cabal-install-1.18)

[linuxadmin@vm01 13:32:50 ~/yesod-test ]
$ cabal install yesod-bin
Warning: /home/linuxadmin/.cabal/config: Unrecognized stanza on line 72
Resolving dependencies...
Configuring ansi-terminal-0.6.2.1...
Configuring auto-update-0.1.2...
Configuring base-unicode-symbols-0.2.2.4...
Configuring base64-bytestring-1.0.0.1...
Building auto-update-0.1.2...
Building base64-bytestring-1.0.0.1...
Building base-unicode-symbols-0.2.2.4...
Building ansi-terminal-0.6.2.1...
Installed auto-update-0.1.2
Configuring byteable-0.1.1...
Configuring byteorder-1.0.4...
Installed base-unicode-symbols-0.2.2.4
Building byteable-0.1.1...
Building byteorder-1.0.4...
Configuring cereal-0.4.1.0...
Installed base64-bytestring-1.0.0.1
Building cereal-0.4.1.0...
Configuring data-default-class-0.0.1...
Installed byteable-0.1.1
Building data-default-class-0.0.1...
Configuring dlist-0.7.1...
Installed byteorder-1.0.4
Building dlist-0.7.1...
Configuring easy-file-0.2.0...
Installed ansi-terminal-0.6.2.1
Configuring file-embed-0.0.7...
Installed data-default-class-0.0.1
Building easy-file-0.2.0...
Building file-embed-0.0.7...
Configuring ghc-paths-0.1.0.9...
Installed dlist-0.7.1
Configuring hinotify-0.3.7...
Installed easy-file-0.2.0
Configuring hourglass-0.2.6...
Installed file-embed-0.0.7
Building hinotify-0.3.7...
Building ghc-paths-0.1.0.9...
Building hourglass-0.2.6...
Configuring mmorph-1.0.4...
Installed ghc-paths-0.1.0.9
Building mmorph-1.0.4...
Configuring mtl-2.1.3.1...
Installed mmorph-1.0.4
Configuring primitive-0.5.4.0...
Installed hinotify-0.3.7
Building mtl-2.1.3.1...
Building primitive-0.5.4.0...
Configuring random-1.0.1.1...
Installed cereal-0.4.1.0
Building random-1.0.1.1...
Configuring split-0.2.2...
Installed mtl-2.1.3.1
Building split-0.2.2...
Configuring stm-2.4.3...
Installed primitive-0.5.4.0
Building stm-2.4.3...
Configuring stringsearch-0.3.6.5...
Installed split-0.2.2
Building stringsearch-0.3.6.5...
Configuring syb-0.4.2...
Installed hourglass-0.2.6
Configuring tar-0.4.0.1...
Installed stm-2.4.3
Building syb-0.4.2...
Building tar-0.4.0.1...
Configuring text-1.1.1.3...
Installed random-1.0.1.1
Building text-1.1.1.3...
Configuring transformers-compat-0.3.3.3...
Installed tar-0.4.0.1
Configuring unix-compat-0.4.1.3...
Installed syb-0.4.2
Building transformers-compat-0.3.3.3...
Building unix-compat-0.4.1.3...
Configuring unix-time-0.3.4...
Installed unix-compat-0.4.1.3
Configuring utf8-string-0.3.8...
Installed stringsearch-0.3.6.5
Building utf8-string-0.3.8...
Building unix-time-0.3.4...
Configuring word8-0.1.1...
Installed transformers-compat-0.3.3.3
Building word8-0.1.1...
Configuring zlib-0.5.4.1...
Installed word8-0.1.1
Building zlib-0.5.4.1...
Installed unix-time-0.3.4
Configuring cryptohash-0.11.6...
Building cryptohash-0.11.6...
Configuring securemem-0.1.3...
Installed utf8-string-0.3.8
Building securemem-0.1.3...
Configuring ansi-wl-pprint-0.6.7.1...
Installed zlib-0.5.4.1
Configuring data-default-instances-base-0.0.1...
Installed securemem-0.1.3
Building ansi-wl-pprint-0.6.7.1...
Building data-default-instances-base-0.0.1...
Configuring data-default-instances-containers-0.0.1...
Installed data-default-instances-base-0.0.1
Building data-default-instances-containers-0.0.1...
Configuring data-default-instances-old-locale-0.0.1...
Installed ansi-wl-pprint-0.6.7.1
Building data-default-instances-old-locale-0.0.1...
Configuring data-default-instances-dlist-0.0.1...
Installed data-default-instances-containers-0.0.1
Building data-default-instances-dlist-0.0.1...
Configuring exceptions-0.6.1...
Installed data-default-instances-old-locale-0.0.1
Building exceptions-0.6.1...
Configuring pem-0.2.2...
Installed data-default-instances-dlist-0.0.1
Building pem-0.2.2...
Configuring vector-0.10.12.1...
Installed cryptohash-0.11.6
Configuring asn1-types-0.3.0...
Installed pem-0.2.2
Building vector-0.10.12.1...
Building asn1-types-0.3.0...
Configuring async-2.0.1.6...
Installed exceptions-0.6.1
Building async-2.0.1.6...
Configuring transformers-base-0.4.3...
Installed async-2.0.1.6
Building transformers-base-0.4.3...
Installed asn1-types-0.3.0
Configuring crypto-cipher-types-0.0.9...
Building crypto-cipher-types-0.0.9...
Configuring optparse-applicative-0.11.0.1...
Installed transformers-base-0.4.3
Building optparse-applicative-0.11.0.1...
Configuring data-default-0.5.3...
Installed crypto-cipher-types-0.0.9
Building data-default-0.5.3...
Installed data-default-0.5.3
Configuring asn1-encoding-0.9.0...
Building asn1-encoding-0.9.0...
Configuring crypto-pubkey-types-0.4.2.3...
Installed optparse-applicative-0.11.0.1
Building crypto-pubkey-types-0.4.2.3...
Configuring monad-control-0.3.3.0...
Installed asn1-encoding-0.9.0
Building monad-control-0.3.3.0...
Configuring cipher-aes-0.2.9...
Installed monad-control-0.3.3.0
Building cipher-aes-0.2.9...
Configuring cipher-des-0.0.6...
Installed cipher-aes-0.2.9
Building cipher-des-0.0.6...
Configuring cipher-rc4-0.1.4...
Installed crypto-pubkey-types-0.4.2.3
Building cipher-rc4-0.1.4...
Configuring lifted-base-0.2.2.1...
Installed cipher-des-0.0.6
Building lifted-base-0.2.2.1...
Installed cipher-rc4-0.1.4
Installed lifted-base-0.2.2.1
Configuring resourcet-1.1.2.3...
Building resourcet-1.1.2.3...
Installed resourcet-1.1.2.3
Installed text-1.1.1.3
Configuring asn1-parse-0.9.0...
Configuring blaze-builder-0.3.3.4...
Configuring hashable-1.2.2.0...
Building asn1-parse-0.9.0...
Building hashable-1.2.2.0...
Building blaze-builder-0.3.3.4...
Installed asn1-parse-0.9.0
Configuring mime-types-0.1.0.4...
Building mime-types-0.1.0.4...
Configuring parsec-3.1.7...
Installed hashable-1.2.2.0
Building parsec-3.1.7...
Configuring publicsuffixlist-0.1...
Installed blaze-builder-0.3.3.4
Building publicsuffixlist-0.1...
Configuring system-filepath-0.4.12...
Installed publicsuffixlist-0.1
Installed vector-0.10.12.1
Configuring x509-1.5.0.1...
Building system-filepath-0.4.12...
Building x509-1.5.0.1...
Configuring nats-0.2...
Installed mime-types-0.1.0.4
Building nats-0.2...
Configuring case-insensitive-1.2.0.1...
Installed nats-0.2
Building case-insensitive-1.2.0.1...
Configuring scientific-0.3.3.2...
Installed parsec-3.1.7
Building scientific-0.3.3.2...
Configuring unordered-containers-0.2.5.1...
Installed case-insensitive-1.2.0.1
Building unordered-containers-0.2.5.1...
Configuring blaze-markup-0.6.1.1...
Installed x509-1.5.0.1
Building blaze-markup-0.6.1.1...
Configuring cookie-0.4.1.4...
Installed scientific-0.3.3.2
Building cookie-0.4.1.4...
Configuring fast-logger-2.2.3...
Installed blaze-markup-0.6.1.1
Building fast-logger-2.2.3...
Configuring crypto-random-0.0.8...
Installed cookie-0.4.1.4
Installed unordered-containers-0.2.5.1
Configuring network-2.5.0.0...
Building crypto-random-0.0.8...
Configuring http-types-0.8.5...
Installed fast-logger-2.2.3
Building http-types-0.8.5...
Configuring x509-store-1.5.0...
Installed crypto-random-0.0.8
Building x509-store-1.5.0...
Building network-2.5.0.0...
Installed x509-store-1.5.0
Configuring blaze-html-0.7.0.3...
Building blaze-html-0.7.0.3...
Configuring attoparsec-0.12.1.2...
Installed http-types-0.8.5
Building attoparsec-0.12.1.2...
Configuring semigroups-0.15.4...
Installed network-2.5.0.0
Installed system-filepath-0.4.12
Configuring vault-0.3.0.3...
Building semigroups-0.15.4...
Building vault-0.3.0.3...
Installed vault-0.3.0.3
Configuring cprng-aes-0.6.0...
Configuring crypto-numbers-0.2.3...
Installed blaze-html-0.7.0.3
Building cprng-aes-0.6.0...
Building crypto-numbers-0.2.3...
Configuring x509-system-1.5.0...
Installed cprng-aes-0.6.0
Building x509-system-1.5.0...
Configuring simple-sendfile-0.2.18...
Installed crypto-numbers-0.2.3
Configuring socks-0.5.4...
Installed x509-system-1.5.0
Building simple-sendfile-0.2.18...
Building socks-0.5.4...
Configuring streaming-commons-0.1.5...
Installed semigroups-0.15.4
Building streaming-commons-0.1.5...
Configuring system-fileio-0.3.15...
Installed simple-sendfile-0.2.18
Building system-fileio-0.3.15...
Configuring wai-3.0.2...
Installed system-fileio-0.3.15
Configuring crypto-pubkey-0.2.4...
Installed socks-0.5.4
Building wai-3.0.2...
Building crypto-pubkey-0.2.4...
Configuring void-0.6.1...
Installed wai-3.0.2
Building void-0.6.1...
Configuring fsnotify-0.1.0.3...
Installed streaming-commons-0.1.5
Building fsnotify-0.1.0.3...
Configuring wai-logger-2.2.3...
Installed crypto-pubkey-0.2.4
Configuring http-client-0.4.2.2...
Installed void-0.6.1
Building wai-logger-2.2.3...
Building http-client-0.4.2.2...
Installed wai-logger-2.2.3
Configuring x509-validation-1.5.1...
Building x509-validation-1.5.1...
Configuring conduit-1.2.2.1...
Installed fsnotify-0.1.0.3
Building conduit-1.2.2.1...
Configuring wai-extra-3.0.2.1...
Installed x509-validation-1.5.1
Building wai-extra-3.0.2.1...
Configuring tls-1.2.13...
Installed http-client-0.4.2.2
Installed conduit-1.2.2.1
Building tls-1.2.13...
Installed wai-extra-3.0.2.1
Installed attoparsec-0.12.1.2
Configuring aeson-0.8.0.2...
Configuring conduit-extra-1.1.4.1...
Configuring http-date-0.0.4...
Building aeson-0.8.0.2...
Building http-date-0.0.4...
Building conduit-extra-1.1.4.1...
Installed http-date-0.0.4
Configuring warp-3.0.2.3...
Building warp-3.0.2.3...
Installed conduit-extra-1.1.4.1
Configuring http-reverse-proxy-0.4.1.2...
Building http-reverse-proxy-0.4.1.2...
Configuring project-template-0.1.4.2...
Installed tls-1.2.13
Building project-template-0.1.4.2...
Configuring connection-0.2.3...
Installed warp-3.0.2.3
Building connection-0.2.3...
Installed project-template-0.1.4.2
Installed http-reverse-proxy-0.4.1.2
Installed connection-0.2.3
Configuring http-client-tls-0.2.2...
Building http-client-tls-0.2.2...
Installed http-client-tls-0.2.2
Configuring http-conduit-2.1.4.7...
Building http-conduit-2.1.4.7...
Installed http-conduit-2.1.4.7
Installed aeson-0.8.0.2
Configuring shakespeare-2.0.1.1...
Configuring yaml-0.8.9.3...
Building yaml-0.8.9.3...
Building shakespeare-2.0.1.1...
Installed yaml-0.8.9.3
Installed shakespeare-2.0.1.1
Configuring yesod-bin-1.4.0.6...
Building yesod-bin-1.4.0.6...
Installed yesod-bin-1.4.0.6
Updating documentation index /home/linuxadmin/.cabal/share/doc/index.html
[linuxadmin@vm01 13:56:57 ~/yesod-test ]
$ yesod init
Welcome to the Yesod scaffolder.
I'm going to be creating a skeleton Yesod project for you.

What do you want to call your project? We'll use this for the cabal name.

Project name: tutorial
Yesod uses Persistent for its (you guessed it) persistence layer.
This tool will build in either SQLite or PostgreSQL or MongoDB support for you.
We recommend starting with SQLite: it has no dependencies.

    s      = sqlite
    p      = postgresql
    pf     = postgresql + Fay (experimental)
    mongo  = mongodb
    mysql  = MySQL
    simple = no database, no auth
    url    = Let me specify URL containing a site (advanced)

So, what'll it be? simple
That's it! I'm creating your files now...

---------------------------------------

                     ___
                            {-)   |\
                       [m,].-"-.   /
      [][__][__]         \(/\__/\)/
      [__][__][__][__]~~~~  |  |
      [][__][__][__][__][] /   |
      [__][__][__][__][__]| /| |
      [][__][__][__][__][]| || |  ~~~~
  ejm [__][__][__][__][__]__,__,  \__/

---------------------------------------

The foundation for your web application has been built.

There are a lot of resources to help you use Yesod.
Start with the book: http://www.yesodweb.com/book
Take part in the community: http://yesodweb.com/page/community

It's highly recommended to follow the quick start guide for
installing Yesod: http://www.yesodweb.com/page/quickstart

If your system is already configured correctly, please run:

   cd tutorial && cabal install -j --enable-tests --max-backjumps=-1 --reorder-goals && yesod devel
[linuxadmin@vm01 13:57:04 ~/yesod-test ]
$ cd tutorial/
[linuxadmin@vm01 13:57:09 ~/yesod-test/tutorial ]
$ cabal install -j --enable-tests --max-backjumps=-1 --reorder-goals
Warning: /home/linuxadmin/.cabal/config: Unrecognized stanza on line 72
Resolving dependencies...
Configuring HUnit-1.2.5.2...
Configuring base16-bytestring-0.1.1.6...
Configuring cryptohash-conduit-0.1.1...
Configuring css-text-0.1.2.1...
Building css-text-0.1.2.1...
Building HUnit-1.2.5.2...
Building cryptohash-conduit-0.1.1...
Building base16-bytestring-0.1.1.6...
Installed base16-bytestring-0.1.1.6
Configuring email-validate-2.0.1...
Configuring entropy-0.3.4.1...
Installed cryptohash-conduit-0.1.1
Building email-validate-2.0.1...
Configuring language-javascript-0.5.13...
Installed HUnit-1.2.5.2
Building language-javascript-0.5.13...
Building entropy-0.3.4.1...
Configuring mime-mail-0.4.6...
Installed css-text-0.1.2.1
Building mime-mail-0.4.6...
Configuring monad-loops-0.4.2.1...
Installed email-validate-2.0.1
Building monad-loops-0.4.2.1...
Configuring mwc-random-0.13.2.0...
Installed entropy-0.3.4.1
Building mwc-random-0.13.2.0...
Configuring path-pieces-0.1.4...
Installed monad-loops-0.4.2.1
Building path-pieces-0.1.4...
Configuring safe-0.3.8...
Installed mime-mail-0.4.6
Building safe-0.3.8...
Configuring resource-pool-0.2.3.1...
Installed path-pieces-0.1.4
Building resource-pool-0.2.3.1...
Configuring setenv-0.1.1.1...
Installed safe-0.3.8
Building setenv-0.1.1.1...
Configuring silently-1.2.4.1...
Installed resource-pool-0.2.3.1
Configuring stm-chans-3.0.0.2...
Installed setenv-0.1.1.1
Building silently-1.2.4.1...
Configuring tagged-0.7.3...
Installed silently-1.2.4.1
Building stm-chans-3.0.0.2...
Building tagged-0.7.3...
Configuring tagsoup-0.13.3...
Installed tagged-0.7.3
Configuring xml-types-0.3.4...
Installed stm-chans-3.0.0.2
Building tagsoup-0.13.3...
Building xml-types-0.3.4...
Configuring tf-random-0.5...
Installed xml-types-0.3.4
Building tf-random-0.5...
Installed mwc-random-0.13.2.0
Configuring wai-app-static-3.0.0.2...
Building wai-app-static-3.0.0.2...
Configuring hspec-expectations-0.6.1...
Installed language-javascript-0.5.13
Building hspec-expectations-0.6.1...
Configuring crypto-api-0.13.2...
Installed hspec-expectations-0.6.1
Building crypto-api-0.13.2...
Configuring monad-logger-0.3.8...
Installed tf-random-0.5
Building monad-logger-0.3.8...
Configuring xml-conduit-1.2.3...
Installed tagsoup-0.13.3
Building xml-conduit-1.2.3...
Installed monad-logger-0.3.8
Configuring hjsmin-0.1.4.7...
Building hjsmin-0.1.4.7...
Configuring QuickCheck-2.7.6...
Installed crypto-api-0.13.2
Building QuickCheck-2.7.6...
Configuring xss-sanitize-0.3.5.4...
Installed wai-app-static-3.0.0.2
Building xss-sanitize-0.3.5.4...
Installed hjsmin-0.1.4.7
Configuring persistent-2.1.1...
Building persistent-2.1.1...
Configuring skein-1.0.9...
Installed xss-sanitize-0.3.5.4
Building skein-1.0.9...
Installed skein-1.0.9
Configuring clientsession-0.9.1...
Building clientsession-0.9.1...
Installed clientsession-0.9.1
Configuring yesod-core-1.4.3.1...
Building yesod-core-1.4.3.1...
Installed QuickCheck-2.7.6
Configuring quickcheck-io-0.1.1...
Building quickcheck-io-0.1.1...
Installed quickcheck-io-0.1.1
Configuring hspec-1.12.4...
Building hspec-1.12.4...
Installed hspec-1.12.4
Installed xml-conduit-1.2.3
Configuring tagstream-conduit-0.5.5.3...
Building tagstream-conduit-0.5.5.3...
Installed tagstream-conduit-0.5.5.3
Configuring authenticate-1.3.2.10...
Configuring html-conduit-1.1.1.1...
Building html-conduit-1.1.1.1...
Building authenticate-1.3.2.10...
Installed html-conduit-1.1.1.1
Installed yesod-core-1.4.3.1
Configuring yesod-static-1.4.0.2...
Building yesod-static-1.4.0.2...
Installed authenticate-1.3.2.10
Installed yesod-static-1.4.0.2
Installed persistent-2.1.1
Configuring persistent-template-2.1...
Configuring yesod-test-1.4.1...
Building persistent-template-2.1...
Building yesod-test-1.4.1...
Installed yesod-test-1.4.1
Installed persistent-template-2.1
Configuring yesod-persistent-1.4.0.1...
Building yesod-persistent-1.4.0.1...
Installed yesod-persistent-1.4.0.1
Configuring yesod-form-1.4.1...
Building yesod-form-1.4.1...
Installed yesod-form-1.4.1
Configuring yesod-auth-1.4.0.2...
Building yesod-auth-1.4.0.2...
Installed yesod-auth-1.4.0.2
Configuring yesod-1.4.0...
Building yesod-1.4.0...
Installed yesod-1.4.0
Configuring tutorial-0.0.0...
Building tutorial-0.0.0...
Installed tutorial-0.0.0
Updating documentation index /home/linuxadmin/.cabal/share/doc/index.html
[linuxadmin@vm01 14:03:51 ~/yesod-test/tutorial ]
$ yesod devel
Yesod devel server. Press ENTER to quit
Warning: /home/linuxadmin/.cabal/config: Unrecognized stanza on line 72
Resolving dependencies...
Configuring tutorial-0.0.0...
Rebuilding application... (using cabal)
Starting development server...
<command line>: cannot satisfy -package-id main-inplace
    (use -v for more information)
Exit code: ExitFailure 1

[linuxadmin@vm01 13:14:15 ~ ]
$ cabal --version
cabal-install version 1.18.0.5
using version 1.18.1.3 of the Cabal library
[linuxadmin@vm01 14:05:44 ~ ]
$ ghc-pkg list Cabal
/opt/ghc/7.8.3/lib/ghc-7.8.3/package.conf.d
   Cabal-1.18.1.3
/home/linuxadmin/.ghc/x86_64-linux-7.8.3/package.conf.d
DaveCTurner commented 9 years ago

In case it helps, here's what my package database looks like:

/home/linuxadmin/.ghc/x86_64-linux-7.8.3/package.conf.d
[linuxadmin@vm01 14:05:54 ~ ]
$ ghc-pkg list
/opt/ghc/7.8.3/lib/ghc-7.8.3/package.conf.d
   Cabal-1.18.1.3
   array-0.5.0.0
   base-4.7.0.1
   bin-package-db-0.0.0.0
   binary-0.7.1.0
   bytestring-0.10.4.0
   containers-0.5.5.1
   deepseq-1.3.0.2
   directory-1.2.1.0
   filepath-1.3.0.2
   ghc-7.8.3
   ghc-prim-0.3.1.0
   haskeline-0.7.1.2
   haskell2010-1.1.2.0
   haskell98-2.0.0.3
   hoopl-3.10.0.1
   hpc-0.6.0.1
   integer-gmp-0.5.1.0
   old-locale-1.0.0.6
   old-time-1.1.0.2
   pretty-1.1.1.1
   process-1.2.0.0
   rts-1.0
   template-haskell-2.9.0.0
   terminfo-0.4.0.0
   time-1.4.2
   transformers-0.3.0.0
   unix-2.7.0.1
   xhtml-3000.2.1
/home/linuxadmin/.ghc/x86_64-linux-7.8.3/package.conf.d
   HUnit-1.2.5.2
   QuickCheck-2.7.6
   aeson-0.8.0.2
   ansi-terminal-0.6.2.1
   ansi-wl-pprint-0.6.7.1
   asn1-encoding-0.9.0
   asn1-parse-0.9.0
   asn1-types-0.3.0
   async-2.0.1.6
   attoparsec-0.12.1.2
   authenticate-1.3.2.10
   auto-update-0.1.2
   base-unicode-symbols-0.2.2.4
   base16-bytestring-0.1.1.6
   base64-bytestring-1.0.0.1
   blaze-builder-0.3.3.4
   blaze-html-0.7.0.3
   blaze-markup-0.6.1.1
   byteable-0.1.1
   byteorder-1.0.4
   case-insensitive-1.2.0.1
   cereal-0.4.1.0
   cipher-aes-0.2.9
   cipher-des-0.0.6
   cipher-rc4-0.1.4
   clientsession-0.9.1
   conduit-1.2.2.1
   conduit-extra-1.1.4.1
   connection-0.2.3
   cookie-0.4.1.4
   cprng-aes-0.6.0
   crypto-api-0.13.2
   crypto-cipher-types-0.0.9
   crypto-numbers-0.2.3
   crypto-pubkey-0.2.4
   crypto-pubkey-types-0.4.2.3
   crypto-random-0.0.8
   cryptohash-0.11.6
   cryptohash-conduit-0.1.1
   css-text-0.1.2.1
   data-default-0.5.3
   data-default-class-0.0.1
   data-default-instances-base-0.0.1
   data-default-instances-containers-0.0.1
   data-default-instances-dlist-0.0.1
   data-default-instances-old-locale-0.0.1
   dlist-0.7.1
   easy-file-0.2.0
   email-validate-2.0.1
   entropy-0.3.4.1
   exceptions-0.6.1
   fast-logger-2.2.3
   file-embed-0.0.7
   fsnotify-0.1.0.3
   ghc-paths-0.1.0.9
   hashable-1.2.2.0
   hinotify-0.3.7
   hjsmin-0.1.4.7
   hourglass-0.2.6
   hspec-1.12.4
   hspec-expectations-0.6.1
   html-conduit-1.1.1.1
   http-client-0.4.2.2
   http-client-tls-0.2.2
   http-conduit-2.1.4.7
   http-date-0.0.4
   http-reverse-proxy-0.4.1.2
   http-types-0.8.5
   language-javascript-0.5.13
   lifted-base-0.2.2.1
   mime-mail-0.4.6
   mime-types-0.1.0.4
   mmorph-1.0.4
   monad-control-0.3.3.0
   monad-logger-0.3.8
   monad-loops-0.4.2.1
   mtl-2.1.3.1
   mwc-random-0.13.2.0
   nats-0.2
   network-2.5.0.0
   optparse-applicative-0.11.0.1
   parsec-3.1.7
   path-pieces-0.1.4
   pem-0.2.2
   persistent-2.1.1
   persistent-template-2.1
   primitive-0.5.4.0
   project-template-0.1.4.2
   publicsuffixlist-0.1
   quickcheck-io-0.1.1
   random-1.0.1.1
   resource-pool-0.2.3.1
   resourcet-1.1.2.3
   safe-0.3.8
   scientific-0.3.3.2
   securemem-0.1.3
   semigroups-0.15.4
   setenv-0.1.1.1
   shakespeare-2.0.1.1
   silently-1.2.4.1
   simple-sendfile-0.2.18
   skein-1.0.9
   socks-0.5.4
   split-0.2.2
   stm-2.4.3
   stm-chans-3.0.0.2
   streaming-commons-0.1.5
   stringsearch-0.3.6.5
   syb-0.4.2
   system-fileio-0.3.15
   system-filepath-0.4.12
   tagged-0.7.3
   tagsoup-0.13.3
   tagstream-conduit-0.5.5.3
   tar-0.4.0.1
   text-1.1.1.3
   tf-random-0.5
   tls-1.2.13
   transformers-base-0.4.3
   transformers-compat-0.3.3.3
   tutorial-0.0.0
   unix-compat-0.4.1.3
   unix-time-0.3.4
   unordered-containers-0.2.5.1
   utf8-string-0.3.8
   vault-0.3.0.3
   vector-0.10.12.1
   void-0.6.1
   wai-3.0.2
   wai-app-static-3.0.0.2
   wai-extra-3.0.2.1
   wai-logger-2.2.3
   warp-3.0.2.3
   word8-0.1.1
   x509-1.5.0.1
   x509-store-1.5.0
   x509-system-1.5.0
   x509-validation-1.5.1
   xml-conduit-1.2.3
   xml-types-0.3.4
   xss-sanitize-0.3.5.4
   yaml-0.8.9.3
   yesod-1.4.0
   yesod-auth-1.4.0.2
   yesod-core-1.4.3.1
   yesod-form-1.4.1
   yesod-persistent-1.4.0.1
   yesod-static-1.4.0.2
   yesod-test-1.4.1
   zlib-0.5.4.1
snoyberg commented 9 years ago

Only one more idea: what happens if you wipe out your ~/.cabal/config file and try again?

I'd like to understand what's happening, but I need some way of reproducing this problem, which I don't have right now.

creichert commented 9 years ago

I'm still not quite sure what the issue is but I'll try to reproduce this later myself.

Have you used the same cabal configuration since opening the issue? e.g. have you removed your "~/.cabal/" at all. I'm not necessarily suggesting you do but it might help to start over there too.

Installed cabal-install with cabal unpack cabal-install (which picked cabal-install-1.18.0.5) followed by ./bootstrap.sh then moved the binary into my $PATH.

Hmm, I could be misunderstanding your method but my process for getting latest cabal-install on my system is:

cabal update
cabal install cabal-install
sudo apt-get remove cabal-install

$ cabal install -j --enable-tests --max-backjumps=-1 --reorder-goals Warning: /home/linuxadmin/.cabal/config: Unrecognized stanza on line 72

Do you happen to know what that warning is? I'm not sure it will make a difference.

Another shot in the dark. Possibly try:

ghc-pkg recache

Sorry I can't be of more help. This is a strange issue.

DaveCTurner commented 9 years ago

Thanks for the help so far by the way. Christopher, yes, I've had the same ~/.cabal/config throughout (but not any more). The process I've used for getting cabal-install is the one I've used to build from source without a pre-existing cabal binary, which seemed preferable to using the one that comes with Ubuntu. My GHC is also built from source, although that one had to be bootstrapped from the Ubuntu version.

Ok, I've wiped my ~/.cabal/config and ~/.ghc/.

Running cabal update recreated ~/.cabal/config, which I then altered to point at Stackage, enable library-profiling and set optimization: 2, then I re-ran cabal update.

From there I've reinstalled yesod-bin, made my tutorial scaffolding, and no longer have the problem. Comparison of the old and new ~/cabal/config files will follow...

DaveCTurner commented 9 years ago

In the broken config (as opposed to the working one) I had added:

verbose: 1
tests: True
documentation: True
doc-index-file: $datadir/doc/index.html

haddock
  html: True
  hyperlink-source: True

constraint: array installed
constraint: base installed
constraint: binary installed
constraint: bin-package-db installed
constraint: bytestring installed
constraint: containers installed
constraint: deepseq installed
constraint: directory installed
constraint: filepath installed
constraint: ghc installed
constraint: ghc-prim installed
constraint: haskeline installed
constraint: haskell2010 installed
constraint: haskell98 installed
constraint: hoopl installed
constraint: hpc installed
constraint: integer-gmp installed
constraint: old-locale installed
constraint: old-time installed
constraint: pretty installed
constraint: process installed
constraint: rts installed
constraint: template-haskell installed
constraint: terminfo installed
constraint: time installed
constraint: transformers installed
constraint: unix installed
constraint: xhtml installed

Also I had added haddockdir: $docdir/html to install-dirs user and install-dirs global.

If I reinstate the old ~/.cabal/config then it breaks again at yesod devel (no need to rebuild everything).

If I then comment the line tests: True then it works again.

snoyberg commented 9 years ago

Brilliant, tests: True lets me reproduce the issue. Sorry it was such a painful process, but I'm appreciative that you stuck through it. I can try to debug this now.

snoyberg commented 9 years ago

OK, it's a bit of a hack, but I have a solution. yesod devel now passes --disable-tests --disable-benchmarks to cabal configure. The ideal solution would be for it to not get tripped up so easily, but I honestly have no idea what's going on in the GhcBuild.hs module.

@DaveCTurner If you're able to test the newest yesod-bin from Github, I'd appreciate it.

DaveCTurner commented 9 years ago

No problem, I always like a good puzzle! Glad it wasn't just something daft in my setup after all.

I've built yesod-bin from commit d1815857df4b44655a47e0a79f20c9bcf9492e63 and it works for me, with both cabal-install 1.21.0.0 and 1.18.0.5.

Thanks for your help!

snoyberg commented 9 years ago

Awesome, this is now on Hackage. To celebrate crazy bugs like that: :beers: