postgresql-fay scaffold and yesod-fay dependency problem

235 views
Skip to first unread message

Willem van den Ende

unread,
Apr 7, 2014, 7:35:22 AM4/7/14
to yeso...@googlegroups.com
Hi,

I've played around with various yesod tutorials, getting some things to work, including a previous version of the postgresql-fay scaffold. I wanted to start actually building something, so I thought it would be a good idea to start with the latest yesod-bin and a fresh scaffold. I must be doing something wrong, because some things (not all) work on another machine with an older yesod-bin (1.2.7.4), at least I can compile the yesod-fay master from github, not on the machine with (as far as I can tell) cleanly installed packages. On the clean machine:

yesod-bin version: 1.2.8

Any help would be greatly appreciated... (including, but not limited to tips to end up with a sane set of versions. happy to help keeping this scaffold up to date if I'd know what I'm doing ;) ).

Summary: the scaffolded application tries to install fay-0.17.0.0 depends on language-ecmascript-0.15.2 and that fails to install. I've tried to comment out the fay version spec in the scaffolded app's cabal file, no luck. Also tried increasing the fay version number, so it installs the same version as yesod-fay (fay 0.19.)   I've also cloned yesod-fay from github, and that also fails on the ecmascript library, while trying to install fay 0.17. I have tried increasing the version requirement for fay to >= 0.18, and that gives yet other errors.

Yesod-bin installed fresh after removing it with ghc-pkg and manually removing the binaries from .cabal/bin. also removed yesod-platfrom from the global environment so it exists only in the sandbox.

Output from installing dependencies in  the sandboxed app and yesod-fay below.

Thanks,

Willem

.....
Failed to install language-ecmascript-0.15.2
Last 10 lines of the build log ( /home/willem/dev/spikes/haskell/yesod-split-testing/.cabal-sandbox/logs/language-ecmascript-0.15.2.log ):
[ 2 of 13] Compiling Language.ECMAScript3.Parser.Type ( src/Language/ECMAScript3/Parser/Type.hs, dist/dist-sandbox-f8ff9df1/build/Language/ECMAScript3/Parser/Type.o )
[ 3 of 13] Compiling Language.ECMAScript3.Lexer ( src/Language/ECMAScript3/Lexer.hs, dist/dist-sandbox-f8ff9df1/build/Language/ECMAScript3/Lexer.o )
[ 4 of 13] Compiling Language.ECMAScript3.Syntax ( src/Language/ECMAScript3/Syntax.hs, dist/dist-sandbox-f8ff9df1/build/Language/ECMAScript3/Syntax.o )
[ 5 of 13] Compiling Language.ECMAScript3.PrettyPrint ( src/Language/ECMAScript3/PrettyPrint.hs, dist/dist-sandbox-f8ff9df1/build/Language/ECMAScript3/PrettyPrint.o )
[ 6 of 13] Compiling Language.ECMAScript3.Syntax.Annotations ( src/Language/ECMAScript3/Syntax/Annotations.hs, dist/dist-sandbox-f8ff9df1/build/Language/ECMAScript3/Syntax/Annotations.o )
[ 7 of 13] Compiling Language.ECMAScript3.Parser ( src/Language/ECMAScript3/Parser.hs, dist/dist-sandbox-f8ff9df1/build/Language/ECMAScript3/Parser.o )
[ 8 of 13] Compiling Language.ECMAScript3.Syntax.Arbitrary ( src/Language/ECMAScript3/Syntax/Arbitrary.hs, dist/dist-sandbox-f8ff9df1/build/Language/ECMAScript3/Syntax/Arbitrary.o )

src/Language/ECMAScript3/Syntax/Arbitrary.hs:8:32:
    Module `Test.QuickCheck' does not export `Prop'

....
Building yesod-1.2.5.2...
Installed yesod-1.2.5.2
Configuring yesod-platform-1.2.9.1...
Building yesod-platform-1.2.9.1...
Installed yesod-platform-1.2.9.1
cabal: Error: some packages failed to install:
fay-0.17.0.0 depends on language-ecmascript-0.15.2 which failed to install.
language-ecmascript-0.15.2 failed during the building phase. The exception
was:
ExitFailure 1
yesod-fay-0.5.0.1 depends on language-ecmascript-0.15.2 which failed to
install.
yesod-split-testing-0.0.0 depends on language-ecmascript-0.15.2 which failed
to install.

...

building yesod-fay:
willem@angel:~/dev/spikes/haskell/yesod-fay$ cabal install --only-dependencies
Resolving dependencies...
Notice: installing into a sandbox located at
/home/willem/dev/spikes/haskell/yesod-fay/.cabal-sandbox
Configuring Diff-0.3.0...
Configuring ansi-terminal-0.6.1.1...
Configuring async-2.0.1.5...
Configuring base64-bytestring-1.0.0.1...
Configuring base-unicode-symbols-0.2.2.4...
Configuring byteorder-1.0.4...
Building ansi-terminal-0.6.1.1...
Configuring byteable-0.1.1...
Configuring data-default-class-0.0.1...
Building base-unicode-symbols-0.2.2.4...
Building Diff-0.3.0...
Building async-2.0.1.5...
Building base64-bytestring-1.0.0.1...
Building byteorder-1.0.4...
Configuring dlist-0.7.0.1...
Installed base-unicode-symbols-0.2.2.4
Building byteable-0.1.1...
Building data-default-class-0.0.1...
Configuring cereal-0.4.0.1...
Installed async-2.0.1.5
Configuring entropy-0.2.2.4...
Installed byteorder-1.0.4
Configuring file-embed-0.0.6...
Installed Diff-0.3.0
Building dlist-0.7.0.1...
Configuring exceptions-0.5...
Installed base64-bytestring-1.0.0.1
Configuring ghc-paths-0.1.0.9...
Installed data-default-class-0.0.1
Configuring haskell-lexer-1.0...
Installed byteable-0.1.1
Configuring blaze-builder-0.3.3.2...
Installed ansi-terminal-0.6.1.1
Building cereal-0.4.0.1...
Configuring hostname-1.0...
Installed dlist-0.7.0.1
Building file-embed-0.0.6...
Building entropy-0.2.2.4...
Building exceptions-0.5...
Building haskell-lexer-1.0...
Building blaze-builder-0.3.3.2...
Building hostname-1.0...
Configuring language-haskell-extract-0.2.4...
Installed entropy-0.2.2.4
Configuring mime-types-0.1.0.3...
Installed file-embed-0.0.6
Building ghc-paths-0.1.0.9...
Configuring mmorph-1.0.2...
Installed hostname-1.0
Configuring hashable-1.2.1.0...
Installed exceptions-0.5
Configuring monad-loops-0.4.2...
Installed ghc-paths-0.1.0.9
Building language-haskell-extract-0.2.4...
Building mime-types-0.1.0.3...
Configuring path-pieces-0.1.3.1...
Installed language-haskell-extract-0.2.4
Building mmorph-1.0.2...
Building hashable-1.2.1.0...
Building monad-loops-0.4.2...
Configuring nats-0.1.2...
Installed mmorph-1.0.2
Building path-pieces-0.1.3.1...
Configuring safe-0.3.4...
Installed blaze-builder-0.3.3.2
Configuring primitive-0.5.2.1...
Installed hashable-1.2.1.0
Building nats-0.1.2...
Configuring polyparse-1.9...
Installed path-pieces-0.1.3.1
Configuring silently-1.2.4.1...
Installed monad-loops-0.4.2
Installed cereal-0.4.0.1
Configuring split-0.2.2...
Configuring simple-sendfile-0.2.13...
Installed nats-0.1.2
Building safe-0.3.4...
Building primitive-0.5.2.1...
Configuring stm-chans-2.0.0...
Installed safe-0.3.4
Building polyparse-1.9...
Building split-0.2.2...
Building silently-1.2.4.1...
Building simple-sendfile-0.2.13...
Configuring system-filepath-0.4.10...
Installed silently-1.2.4.1
Configuring stringsearch-0.3.6.5...
Installed split-0.2.2
Configuring tagged-0.7.1...
Installed primitive-0.5.2.1
Installed simple-sendfile-0.2.13
Configuring streaming-commons-0.1.0.2...
Building stm-chans-2.0.0...
Building stringsearch-0.3.6.5...
Building tagged-0.7.1...
Building streaming-commons-0.1.0.2...
Building system-filepath-0.4.10...
Configuring terminfo-0.4.0.0...
Installed haskell-lexer-1.0
Configuring tagsoup-0.13.1...
Installed stm-chans-2.0.0
Configuring transformers-base-0.4.1...
Installed tagged-0.7.1
Building tagsoup-0.13.1...
Building transformers-base-0.4.1...
Configuring text-stream-decode-0.1.0.5...
Installed transformers-base-0.4.1
Building terminfo-0.4.0.0...
Configuring unix-compat-0.4.1.1...
Installed polyparse-1.9
Building text-stream-decode-0.1.0.5...
Configuring unix-time-0.2.2...
Installed streaming-commons-0.1.0.2
Configuring utf8-string-0.3.7...
Installed system-filepath-0.4.10
Configuring word8-0.0.4...
Installed terminfo-0.4.0.0
Building unix-compat-0.4.1.1...
Configuring xml-1.3.13...
Installed stringsearch-0.3.6.5
Installed unix-compat-0.4.1.1
Building utf8-string-0.3.7...
Building word8-0.0.4...
Configuring data-default-instances-base-0.0.1...
Building xml-1.3.13...
Configuring data-default-instances-containers-0.0.1...
Installed text-stream-decode-0.1.0.5
Building unix-time-0.2.2...
Configuring data-default-instances-old-locale-0.0.1...
Installed word8-0.0.4
Building data-default-instances-base-0.0.1...
Configuring cryptohash-0.11.4...
Installed data-default-instances-base-0.0.1
Building data-default-instances-containers-0.0.1...
Building data-default-instances-old-locale-0.0.1...
Configuring securemem-0.1.3...
Installed unix-time-0.2.2
Configuring ansi-wl-pprint-0.6.7.1...
Installed data-default-instances-containers-0.0.1
Configuring data-default-instances-dlist-0.0.1...
Installed data-default-instances-old-locale-0.0.1
Configuring blaze-markup-0.6.0.0...
Installed utf8-string-0.3.7
Building cryptohash-0.11.4...
Building securemem-0.1.3...
Configuring fast-logger-2.1.5...
Installed xml-1.3.13
Configuring case-insensitive-1.2.0.0...
Building ansi-wl-pprint-0.6.7.1...
Installed tagsoup-0.13.1
Building data-default-instances-dlist-0.0.1...
Configuring scientific-0.2.0.2...
Installed securemem-0.1.3
Building blaze-markup-0.6.0.0...
Configuring unordered-containers-0.2.3.3...
Installed data-default-instances-dlist-0.0.1
Configuring tf-random-0.4...
Installed ansi-wl-pprint-0.6.7.1
Building fast-logger-2.1.5...
Building case-insensitive-1.2.0.0...
Building scientific-0.2.0.2...
Building unordered-containers-0.2.3.3...
Building tf-random-0.4...
Configuring vector-0.10.9.1...
Installed fast-logger-2.1.5
Configuring pretty-show-1.6.7...
Installed case-insensitive-1.2.0.0
Building vector-0.10.9.1...
Building pretty-show-1.6.7...
Configuring crypto-api-0.13...
Installed cryptohash-0.11.4
Configuring monad-control-0.3.2.3...
Installed scientific-0.2.0.2
Configuring cpphs-1.18.4...
Installed blaze-markup-0.6.0.0
Building crypto-api-0.13...
Configuring system-fileio-0.3.12...
Installed tf-random-0.4
Building monad-control-0.3.2.3...
Building cpphs-1.18.4...
Building system-fileio-0.3.12...
Configuring haskeline-0.7.1.2...
Installed monad-control-0.3.2.3
Installed pretty-show-1.6.7
Configuring language-javascript-0.5.11...
Configuring crypto-cipher-types-0.0.9...
Installed system-fileio-0.3.12
Configuring data-default-0.5.3...
Installed unordered-containers-0.2.3.3
Building language-javascript-0.5.11...
Building crypto-cipher-types-0.0.9...
Configuring optparse-applicative-0.8.0.1...
Installed crypto-api-0.13
Building haskeline-0.7.1.2...
Building data-default-0.5.3...
Building optparse-applicative-0.8.0.1...
Configuring test-framework-0.8.0.3...
Installed data-default-0.5.3
Configuring http-types-0.8.4...
Installed crypto-cipher-types-0.0.9
Building test-framework-0.8.0.3...
Building http-types-0.8.4...
Configuring attoparsec-0.11.1.0...
Installed cpphs-1.18.4
Configuring blaze-html-0.7.0.1...
Installed optparse-applicative-0.8.0.1
Building attoparsec-0.11.1.0...
Configuring QuickCheck-2.7.3...
Installed test-framework-0.8.0.3
Configuring lifted-base-0.2.2.1...
Installed http-types-0.8.4
Building blaze-html-0.7.0.1...
Building QuickCheck-2.7.3...
Building lifted-base-0.2.2.1...
Failed to install language-javascript-0.5.11
Last 10 lines of the build log ( /home/willem/dev/spikes/haskell/yesod-fay/.cabal-sandbox/logs/language-javascript-0.5.11.log ):
[ 5 of 12] Compiling Language.JavaScript.Parser.ParserMonad ( src/Language/JavaScript/Parser/ParserMonad.hs, dist/dist-sandbox-41dac409/build/Language/JavaScript/Parser/ParserMonad.o )
[ 6 of 12] Compiling Language.JavaScript.Parser.Lexer ( dist/dist-sandbox-41dac409/build/Language/JavaScript/Parser/Lexer.hs, dist/dist-sandbox-41dac409/build/Language/JavaScript/Parser/Lexer.o )

templates/wrappers.hs:208:17:
    Couldn't match expected type `AlexInput'
                with actual type `(t0, t1, t2)'
    In the return type of a call of `ignorePendingBytes'
    In the first argument of `action', namely
      `(ignorePendingBytes inp)'
    In a stmt of a 'do' block: action (ignorePendingBytes inp) len
Configuring semigroups-0.12.2...
Configuring uniplate-1.6.12...
Installed lifted-base-0.2.2.1
Building semigroups-0.12.2...
Building uniplate-1.6.12...
Configuring vault-0.3.0.3...
Installed mime-types-0.1.0.3
Configuring pureMD5-2.1.2.1...
Installed haskeline-0.7.1.2
Building vault-0.3.0.3...
Building pureMD5-2.1.2.1...
Configuring skein-1.0.9...
Installed semigroups-0.12.2
Building skein-1.0.9...
Configuring cookie-0.4.0.1...
Installed QuickCheck-2.7.3
Configuring cipher-aes-0.2.7...
Installed vault-0.3.0.3
Building cookie-0.4.0.1...
Configuring haskell-src-exts-1.14.0.1...
Installed uniplate-1.6.12
Building cipher-aes-0.2.7...
Configuring test-framework-hunit-0.3.0.1...
Installed pureMD5-2.1.2.1
Installed blaze-html-0.7.0.1
Configuring resourcet-1.1.1...
Configuring void-0.6.1...
Installed skein-1.0.9
Configuring language-ecmascript-0.15.2...
Installed cookie-0.4.0.1
Installed cipher-aes-0.2.7
Building test-framework-hunit-0.3.0.1...
Building haskell-src-exts-1.14.0.1...
Building void-0.6.1...
Building resourcet-1.1.1...
Installed test-framework-hunit-0.3.0.1
Building language-ecmascript-0.15.2...
Installed void-0.6.1
Installed resourcet-1.1.1
Configuring conduit-1.1.0...
Building conduit-1.1.0...
Installed attoparsec-0.11.1.0
Configuring css-text-0.1.2.1...
Configuring email-validate-2.0.1...
Configuring http-date-0.0.4...
Building http-date-0.0.4...
Building css-text-0.1.2.1...
Building email-validate-2.0.1...
Installed conduit-1.1.0
Configuring attoparsec-conduit-1.1.0...
Configuring blaze-builder-conduit-1.1.0...
Building attoparsec-conduit-1.1.0...
Building blaze-builder-conduit-1.1.0...
Installed http-date-0.0.4
Configuring conduit-extra-1.1.0...
Configuring monad-logger-0.3.4.1...
Installed attoparsec-conduit-1.1.0
Configuring network-conduit-1.1.0...
Installed blaze-builder-conduit-1.1.0
Configuring zlib-conduit-1.1.0...
Installed email-validate-2.0.1
Building conduit-extra-1.1.0...
Installed css-text-0.1.2.1
Configuring xss-sanitize-0.3.5.2...
Building monad-logger-0.3.4.1...
Building network-conduit-1.1.0...
Building zlib-conduit-1.1.0...
Building xss-sanitize-0.3.5.2...
Installed network-conduit-1.1.0
Installed zlib-conduit-1.1.0
Installed monad-logger-0.3.4.1
Installed vector-0.10.9.1
Configuring aeson-0.7.0.2...
Configuring crypto-random-0.0.7...
Configuring resource-pool-0.2.1.1...
Configuring yesod-routes-1.2.0.6...
Installed conduit-extra-1.1.0
Configuring cryptohash-conduit-0.1.1...
Building aeson-0.7.0.2...
Building crypto-random-0.0.7...
Building resource-pool-0.2.1.1...
Building yesod-routes-1.2.0.6...
Building cryptohash-conduit-0.1.1...
Configuring wai-2.1.0.1...
Installed cryptohash-conduit-0.1.1
Installed resource-pool-0.2.1.1
Installed crypto-random-0.0.7
Configuring cprng-aes-0.5.2...
Building wai-2.1.0.1...
Building cprng-aes-0.5.2...
Installed yesod-routes-1.2.0.6
Installed wai-2.1.0.1
Configuring wai-logger-2.1.1...
Configuring warp-2.1.3.3...
Installed cprng-aes-0.5.2
Configuring clientsession-0.9.0.3...
Building wai-logger-2.1.1...
Building warp-2.1.3.3...
Building clientsession-0.9.0.3...
Installed clientsession-0.9.0.3
Installed wai-logger-2.1.1
Configuring wai-extra-2.1.1.1...
Building wai-extra-2.1.1.1...
Failed to install language-ecmascript-0.15.2
Last 10 lines of the build log ( /home/willem/dev/spikes/haskell/yesod-fay/.cabal-sandbox/logs/language-ecmascript-0.15.2.log ):
[ 2 of 13] Compiling Language.ECMAScript3.Parser.Type ( src/Language/ECMAScript3/Parser/Type.hs, dist/dist-sandbox-41dac409/build/Language/ECMAScript3/Parser/Type.o )
[ 3 of 13] Compiling Language.ECMAScript3.Lexer ( src/Language/ECMAScript3/Lexer.hs, dist/dist-sandbox-41dac409/build/Language/ECMAScript3/Lexer.o )
[ 4 of 13] Compiling Language.ECMAScript3.Syntax ( src/Language/ECMAScript3/Syntax.hs, dist/dist-sandbox-41dac409/build/Language/ECMAScript3/Syntax.o )
[ 5 of 13] Compiling Language.ECMAScript3.PrettyPrint ( src/Language/ECMAScript3/PrettyPrint.hs, dist/dist-sandbox-41dac409/build/Language/ECMAScript3/PrettyPrint.o )
[ 6 of 13] Compiling Language.ECMAScript3.Syntax.Annotations ( src/Language/ECMAScript3/Syntax/Annotations.hs, dist/dist-sandbox-41dac409/build/Language/ECMAScript3/Syntax/Annotations.o )
[ 7 of 13] Compiling Language.ECMAScript3.Parser ( src/Language/ECMAScript3/Parser.hs, dist/dist-sandbox-41dac409/build/Language/ECMAScript3/Parser.o )
[ 8 of 13] Compiling Language.ECMAScript3.Syntax.Arbitrary ( src/Language/ECMAScript3/Syntax/Arbitrary.hs, dist/dist-sandbox-41dac409/build/Language/ECMAScript3/Syntax/Arbitrary.o )

src/Language/ECMAScript3/Syntax/Arbitrary.hs:8:32:
    Module `Test.QuickCheck' does not export `Prop'
Installed warp-2.1.3.3
Installed xss-sanitize-0.3.5.2
Installed wai-extra-2.1.1.1
Configuring wai-app-static-2.0.1...
Building wai-app-static-2.0.1...
Installed aeson-0.7.0.2
Configuring persistent-1.3.0.6...
Building persistent-1.3.0.6...
Installed wai-app-static-2.0.1
Configuring shakespeare-2.0.0.1...
Building shakespeare-2.0.0.1...
Installed persistent-1.3.0.6
Configuring persistent-template-1.3.1.3...
Building persistent-template-1.3.1.3...
Installed shakespeare-2.0.0.1
Configuring hamlet-1.2.0...
Configuring shakespeare-css-1.1.0...
Configuring shakespeare-i18n-1.1.0...
Configuring shakespeare-js-1.3.0...
Building shakespeare-js-1.3.0...
Installed persistent-template-1.3.1.3
Building shakespeare-i18n-1.1.0...
Building hamlet-1.2.0...
Building shakespeare-css-1.1.0...
Installed shakespeare-js-1.3.0
Installed shakespeare-i18n-1.1.0
Installed shakespeare-css-1.1.0
Installed hamlet-1.2.0
Configuring yesod-core-1.2.11...
Building yesod-core-1.2.11...
Installed yesod-core-1.2.11
Configuring yesod-persistent-1.2.2.2...
Building yesod-persistent-1.2.2.2...
Installed yesod-persistent-1.2.2.2
Configuring yesod-form-1.3.8.1...
Building yesod-form-1.3.8.1...
Installed haskell-src-exts-1.14.0.1
Configuring test-framework-th-0.2.4...
Building test-framework-th-0.2.4...
Installed test-framework-th-0.2.4
Installed yesod-form-1.3.8.1
cabal: Error: some packages failed to install:
fay-0.17.0.0 depends on language-ecmascript-0.15.2 which failed to install.
hjsmin-0.1.4.6 depends on language-javascript-0.5.11 which failed to install.
language-ecmascript-0.15.2 failed during the building phase. The exception
was:
ExitFailure 1
language-javascript-0.5.11 failed during the building phase. The exception
was:
ExitFailure 1
yesod-static-1.2.2.4 depends on language-javascript-0.5.11 which failed to
install.

Michael Snoyman

unread,
Apr 7, 2014, 7:40:56 AM4/7/14
to yeso...@googlegroups.com
Do you have any idea why it's trying to install fay-0.17.0.0? There's no upper bound in the scaffolded cabal file, and there are more recent versions of fay available.


--
You received this message because you are subscribed to the Google Groups "Yesod Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Willem van den Ende

unread,
Apr 7, 2014, 9:56:32 AM4/7/14
to yeso...@googlegroups.com, mic...@snoyman.com
Good question, It made me wonder as well. I've tried making sure I've got a clean environment once more (scripts pasted below). 

I'm now getting another error that is telling me that something is very wrong:

fay-0.17.0.0 depends on language-ecmascript-0.15.2 which failed to install.
haskeline-0.7.1.2 failed during the configure step. The exception was:
user error (The package 'haskeline' requires Cabal library version -any &&
>=1.16 but no suitable version is installed.)

Haskeline complaines about not finding a suitable cabal library, but cabal reports:
cabal-install version 1.18.0.3
using version 1.18.1.3 of the Cabal library

So sometimes the correct version of the Cabal library can't be found ??? I searched around for similar error messages, found some cabal issues from the past, but have not been enlightened so far...

/home/willem/.cabal/bin/cabal . 

ghc is  ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.1 

installed with the haskell platform on ubuntu 12.04.

I accidentally also installed the Cabal library in the sandbox, but that makes no difference... I made a few scripts to keep me sane, and explain to the list a bit more of what my config looks like.

inspired by https://www.fpcomplete.com/user/simonmichael/how-to-cabal-install#reset I made two bash functions to reinstall yesod-bin in my global environment, and a script to clean out a sandbox. My ghc-pkg-reset is a bit more extreme, it only leaves the cabal executable, so that I'm sure that I have the latest yesod executable. Maybe I should go a bit further, and remove and reinstall cabal entirely, but I like the one line config change I made to run the compile jobs in parallel (I'll try that after sending this mail and see what it gives).

# ghc-pkg-reset
# Removes all installed GHC/cabal packages, including binaries
# Use this to get out of dependency hell and start over, at the cost of some rebuilding time.
function ghc-pkg-reset-all() {
    read -p 'erasing all your user ghc and cabal packages - are you sure (y/n) ? ' ans
    test x$ans == xy && ( \
        echo 'erasing directories under ~/.ghc'; rm -rf `find ~/.ghc -maxdepth 1 -type d`; \
        echo 'erasing ~/.cabal/lib'; rm -rf ~/.cabal/lib; \
        echo 'erasing ~/.cabal/packages'; rm -rf ~/.cabal/packages; \
        echo 'erasing ~/.cabal/share'; rm -rf ~/.cabal/share; \
        echo 'removing all binaries but cabal' ; mv ~/.cabal/bin/cabal /tmp ; rm ~/.cabal/bin/*; mv /tmp/cabal ~/.cabal/bin/cabal
        cabal update
       )
}

function yesod-reinstall() {
  ghc-pkg-reset-all
  cabal install alex happy
  cabal install yesod-bin
}

cat ~/bin/cabal-clean-sandbox
#!/bin/bash
rm -r .cabal-sandbox
rm cabal.sandbox.config
cabal sandbox init
cabal install --only-dependencies
cabal build

Adam Bergmark

unread,
Apr 7, 2014, 10:33:06 AM4/7/14
to yeso...@googlegroups.com, mic...@snoyman.com
First of all I'd try to constrain everything to the latest versions --constraint='fay >= 0.19' should give you a better error if it really can't use that version, or maybe it will just work with this.

Willem van den Ende

unread,
Apr 7, 2014, 10:35:42 AM4/7/14
to yeso...@googlegroups.com, mic...@snoyman.com
Still no idea why it chooses fay-0.17. I decided to update cabal (gently at first) on another box on which I had gotten the scaffold to work (with the exception of QuickCheck, so I disabled the tests... I figured I'd get the dependencies right once I decided to do more with yesod-fay...).

So there the scaffold installs its dependencies, but fails on loading the fay file inside the scaffold. I just generated a new project and used the compilation command printed at the end of yesod init:

cabal sandbox init && cabal install --enable-tests . yesod-platform yesod-bin --max-backjumps=-1 --reorder-goals && yesod devel

Loading package persistent-postgresql-1.3.0.5 ... linking ... done.
[ 3 of 10] Compiling Settings.Development ( Settings/Development.hs, dist/dist-sandbox-ca6b4f3b/build/Settings/Development.o )
[ 4 of 10] Compiling Settings         ( Settings.hs, dist/dist-sandbox-ca6b4f3b/build/Settings.o )
[ 5 of 10] Compiling Settings.StaticFiles ( Settings/StaticFiles.hs, dist/dist-sandbox-ca6b4f3b/build/Settings/StaticFiles.o )
[ 6 of 10] Compiling Foundation       ( Foundation.hs, dist/dist-sandbox-ca6b4f3b/build/Foundation.o )
[ 7 of 10] Compiling Import           ( Import.hs, dist/dist-sandbox-ca6b4f3b/build/Import.o )
[ 8 of 10] Compiling Handler.Fay      ( Handler/Fay.hs, dist/dist-sandbox-ca6b4f3b/build/Handler/Fay.o )
[ 9 of 10] Compiling Handler.Home     ( Handler/Home.hs, dist/dist-sandbox-ca6b4f3b/build/Handler/Home.o )

Handler/Home.hs:23:11:
    Exception when trying to run compile-time code:
      unable to find (existing) package's share dir: fay-base
tried: /home/willem/dev/spikes/haskell/yesod-pgfay-test/.cabal-sandbox/share/x86_64-linux-ghc-7.6.3/fay-base-0.19
/home/willem/dev/spikes/haskell/yesod-pgfay-test/.cabal-sandbox/share/x86_64-linux-ghc-7.6.3/fay-base-0.19/src

but none of them seem to have Haskell files in them.
If you are using a sandbox you need to specify the HASKELL_PACKAGE_SANDBOX environment variable or use --package-conf.
      Code: fayFile' (Language.Haskell.TH.Syntax.ConE 'StaticR) "Home"
    In a stmt of a 'do' block: $(fayFile' (ConE 'StaticR) "Home")
    In the second argument of `($)', namely
      `do { aDomId <- newIdent;
            setTitle "Welcome To Yesod!";
            $(widgetFile "homepage");
            $(fayFile' (ConE 'StaticR) "Home") }'

    In a stmt of a 'do' block:
      defaultLayout
      $ do { aDomId <- newIdent;
             setTitle "Welcome To Yesod!";
             $(widgetFile "homepage");
             $(fayFile' (ConE 'StaticR) "Home") }

It seems to pick up the cabal sandbox allright, so the environment variable is not necessary?

I can see I have a newer ghc there:

$ which ghc
/usr/local/bin/ghc
willem@w1lem:~/dev/spikes/haskell/yesod-pgfay-test$ ghc version
target `version' is not a module name or a source file
willem@w1lem:~/dev/spikes/haskell/yesod-pgfay-test$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3

at some point I'll figure it out, and be able to build this...

Willem van den Ende

unread,
Apr 7, 2014, 11:17:40 AM4/7/14
to yeso...@googlegroups.com
Thanks, good suggestion. I tried that as well. Specifying fay >= 0.18 did give me fay 0.19.0.2, just got other dependency errors, cabal did not even start compiling.

It's getting better, at least I can now compile (on one machine) yesod-fay with fay-0.19.1.2. So now it's just the scaffold that can't find its files apparently.

Sample output for fay >=0.19, after generating the project from scratch, trying to build it, then change the fay dependency to >= 0.19 :

willem@angel:~/dev/spikes/haskell/yesod-fay-test$ cabal install --only-dependencies
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: aeson-0.7.0.2/installed-ea4... (user goal)
trying: yesod-fay-test-0.0.0 (user goal)
trying: fay-0.19.1.2 (dependency of yesod-fay-test-0.0.0)
next goal: haskell-packages (dependency of fay-0.19.1.2)
rejecting: haskell-packages-0.2.3.4, 0.2.3.3 (conflict: aeson =>
mtl==2.0.1.0/installed-db1..., haskell-packages => mtl>=2.1)
rejecting: haskell-packages-0.2.3.2 (conflict: fay =>
haskell-packages==0.2.3.1 || >0.2.3.2 && <0.3)
rejecting: haskell-packages-0.2.3.1 (conflict:
aeson==0.7.0.2/installed-ea4..., haskell-packages => aeson==0.6.*)
rejecting: haskell-packages-0.2.3, 0.2.2, 0.2.1, 0.2, 0.1 (conflict: fay =>
haskell-packages==0.2.3.1 || >0.2.3.2 && <0.3)
Backjump limit reached (change with --max-backjumps).

Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unregistering the offending packages or
recreating the sandbox.

Maybe I should go through the other dependencies and move them up as well. But where to start? (and on my other machine it mysteriously works...).

deleting the sandbox, recreating it again and running  cabal install --enable-tests . yesod-platform yesod-bin --max-backjumps=-1 --reorder-goals && yesod devel

gives:

willem@angel:~/dev/spikes/haskell/yesod-fay-test$ cabal install --enable-tests . yesod-platform yesod-bin --max-backjumps=-1 --reorder-goals && yesod devel
Resolving dependencies...
In order, the following would be installed:
Diff-0.3.0 (new package)
HUnit-1.2.5.2 (new version)
SHA-1.6.4 -decoderinterface (new package)
ansi-terminal-0.6.1.1 (new package)
ansi-wl-pprint-0.6.7.1 (new package)
asn1-types-0.2.3 (new package)
base-unicode-symbols-0.2.2.4 (new package)
base16-bytestring-0.1.1.6 (new package)
base64-bytestring-1.0.0.1 (new package)
byteable-0.1.1 (new package)
byteorder-1.0.4 (new package)
cereal-0.4.0.1 (new package)
crypto-pubkey-types-0.4.2.2 (new package)
cryptohash-0.11.4 (new package)
data-default-class-0.0.1 (new package)
data-default-instances-base-0.0.1 (new package)
data-default-instances-containers-0.0.1 (new package)
data-default-instances-old-locale-0.0.1 (new package)
dlist-0.7.0.1 (new package)
data-default-instances-dlist-0.0.1 (new package)
data-default-0.5.3 (new package)
entropy-0.2.2.4 (new package)
file-embed-0.0.6 (new package)
ghc-paths-0.1.0.9 (new package)
haskell-lexer-1.0 (new package)
hinotify-0.3.6 (new package)
hostname-1.0 (new package)
hspec-expectations-0.5.0.1 (new package)
monad-loops-0.4.2 (new package)
nats-0.1.2 (new package)
network-info-0.2.0.3 (new package)
postgresql-libpq-0.9.0.0 (new package)
pretty-show-1.6.7 (new package)
primitive-0.5.2.1 (new package)
pwstore-fast-2.4.1 (new package)
safe-0.3.4 (new package)
securemem-0.1.3 (new package)
crypto-cipher-types-0.0.9 (new package)
cipher-aes-0.2.7 (new package)
cipher-rc4-0.1.4 (new package)
setenv-0.1.1.1 (new package)
silently-1.2.4.1 (new package)
split-0.2.2 (new package)
stm-2.4.3 (new version)
async-2.0.1.5 (new package)
stm-chans-3.0.0.2 (new package)
stringsearch-0.3.6.5 (new package)
tagged-0.7.1 (new package)
tar-0.4.0.1 (new package)
text-1.0.0.1 (latest: 1.1.0.1) (new version)
blaze-builder-0.3.3.2 (new package)
blaze-markup-0.6.0.0 (new package)
blaze-html-0.7.0.1 (new package)
cookie-0.4.0.1 (new package)
fast-logger-2.1.5 (new package)
hashable-1.2.1.0 (new package)
case-insensitive-1.2.0.0 (new package)
http-types-0.8.4 (new package)
mime-mail-0.4.5.1 (new package)
mime-types-0.1.0.3 (new package)
path-pieces-0.1.3.1 (new package)
polyparse-1.9 (new package)
cpphs-1.18.4 (new package)
haskell-src-exts-1.14.0.1 (new package)
hse-cpp-0.1 (new package)
scientific-0.2.0.2 (new package)
attoparsec-0.11.2.1 (new package)
css-text-0.1.2.1 (new package)
email-validate-2.0.1 (new package)
http-date-0.0.4 (new package)
system-filepath-0.4.10 (new package)
system-fileio-0.3.12 (new package)
fsnotify-0.0.11 (new package)
tagsoup-0.13.1 (new package)
text-stream-decode-0.1.0.5 (new package)
tf-random-0.4 (new package)
QuickCheck-2.7.3 (new version)
quickcheck-io-0.1.0 (latest: 0.1.1) (new package)
transformers-0.3.0.0 (new version)
crypto-api-0.13 (new package)
hspec-1.9.1 (latest: 1.9.2) (new package)
mmorph-1.0.2 (new package)
mtl-2.1.3.1 (new version)
MonadRandom-0.1.13 (new package)
asn1-encoding-0.8.1.3 (new package)
asn1-parse-0.8.1 (new package)
exceptions-0.5 (new package)
optparse-applicative-0.8.0.1 (new package)
parsec-3.1.5 (new version)
network-2.4.2.2 (new version)
pem-0.2.1 (new package)
pureMD5-2.1.2.1 (new package)
regex-base-0.93.2 (reinstall) changes: mtl-2.0.1.0 -> 2.1.3.1
regex-posix-0.95.2 (new version)
language-haskell-extract-0.2.4 (new package)
simple-sendfile-0.2.13 (new package)
skein-1.0.9 (new package)
socks-0.5.4 (new package)
streaming-commons-0.1.0.2 (new package)
transformers-base-0.4.1 (new package)
monad-control-0.3.2.3 (new package)
lifted-base-0.2.2.1 (new package)
resourcet-1.1.0 (latest: 1.1.1) (new package)
transformers-compat-0.1.1.1 (new package)
contravariant-0.4.4 (new package)
distributive-0.4.3.1 (new package)
traverse-with-class-0.1.1.1 (new package)
type-eq-0.4.2 (new package)
unix-compat-0.4.1.1 (new package)
unix-time-0.2.2 (new package)
unordered-containers-0.2.3.3 (new package)
semigroups-0.12.2 (new package)
comonad-4.0.1 (new package)
semigroupoids-4.0.1 (new package)
data-lens-2.10.4 (new package)
data-lens-template-2.1.8 (new package)
either-4.1.1 (new package)
uniplate-1.6.12 (new package)
language-ecmascript-0.15.2 (latest: 0.16.1) (new package)
utf8-light-0.4.2 (new package)
utf8-string-0.3.7 -bytestring-in-base (new package)
language-javascript-0.5.9 (latest: 0.5.12) (new package)
hjsmin-0.1.4.6 (new package)
publicsuffixlist-0.1 (new package)
http-client-0.3.0.2 (new package)
uuid-1.3.3 (new package)
vault-0.3.0.3 (new package)
vector-0.10.9.1 (new package)
aeson-0.7.0.2 +blaze-builder (new package)
blaze-textual-0.2.0.9 (new package)
crypto-random-0.0.7 (new package)
cprng-aes-0.5.2 (new package)
clientsession-0.9.0.3 (new package)
crypto-numbers-0.2.3 (new package)
crypto-pubkey-0.2.4 (new package)
haskell-packages-0.2.3.4 (new package)
haskell-names-0.3.3 (new package)
postgresql-simple-0.4.2.1 (new package)
resource-pool-0.2.1.1 (new package)
sourcemap-0.1.3.0 (new package)
void-0.6.1 (new package)
conduit-1.1.0 (new package)
attoparsec-conduit-1.1.0 (new package)
blaze-builder-conduit-1.1.0 (new package)
conduit-extra-1.1.0 (new package)
cryptohash-conduit-0.1.1 (new package)
monad-logger-0.3.4.1 (new package)
network-conduit-1.1.0 (new package)
persistent-1.3.0.6 (new package)
esqueleto-1.3.9 (new package)
persistent-postgresql-1.3.0.5 (new package)
persistent-template-1.3.1.3 (new package)
project-template-0.1.4.1 (new package)
wai-2.1.0.1 (new package)
wai-logger-2.1.1 (new package)
wai-test-2.0.1.1 (new package)
warp-2.1.3.3 (new package)
word8-0.0.4 (new package)
http-reverse-proxy-0.3.1.4 (latest: 0.3.1.5) (new package)
x509-1.4.11 (new package)
x509-store-1.4.4 (new package)
x509-system-1.4.2 (new package)
x509-validation-1.5.0 (new package)
tls-1.2.6 (new package)
connection-0.2.0 (new package)
http-client-tls-0.2.1.1 (new package)
http-conduit-2.1.0 (new package)
warp-tls-2.0.3.2 (new package)
xml-1.3.13 (new package)
test-framework-0.8.0.3 (new package)
test-framework-hunit-0.3.0.1 (new package)
test-framework-th-0.2.4 (new package)
fay-0.19.1.2 (new package)
xml-types-0.3.4 (new package)
xml-conduit-1.2.0.1 (new package)
tagstream-conduit-0.5.5.1 (new package)
authenticate-1.3.2.8 (new package)
html-conduit-1.1.0.4 (new package)
xss-sanitize-0.3.5.2 (new package)
yaml-0.8.8.1 (new package)
yesod-routes-1.2.0.6 (new package)
zlib-conduit-1.1.0 (new package)
wai-extra-2.1.1.1 (new package)
wai-app-static-2.0.1 (new package)
shakespeare-2.0.0.1 (new package)
hamlet-1.2.0 (new package)
shakespeare-css-1.1.0 (new package)
shakespeare-i18n-1.1.0 (new package)
shakespeare-js-1.3.0 (new package)
shakespeare-text-1.1.0 (new package)
yesod-bin-1.2.8 (new package)
yesod-core-1.2.11 (new package)
yesod-persistent-1.2.2.2 (new package)
yesod-form-1.3.8.1 (new package)
yesod-auth-1.3.0.2 (new package)
yesod-1.2.5.2 (new package)
yesod-static-1.2.2.4 (new package)
yesod-fay-0.5.0.1 (new package)
yesod-test-1.2.1.2 (new package)
yesod-fay-test-0.0.0 *test (new package)
yesod-platform-1.2.9.1 (new package)
cabal: The following packages are likely to be broken by the reinstalls:
regex-posix-0.95.1
regex-compat-0.95.1
Use --force-reinstalls if you want to install anyway.

doing it with --force-reinstalls is then more interesting (only the tail, it is long):
fay-0.19.1.2 depends on language-ecmascript-0.15.2 which failed to install.
haskell-names-0.3.3 depends on type-eq-0.4.2 which failed to install.

language-ecmascript-0.15.2 failed during the building phase. The exception
was:
ExitFailure 1
type-eq-0.4.2 failed during the configure step. The exception was:

ExitFailure 1
yesod-fay-0.5.0.1 depends on language-ecmascript-0.15.2 which failed to
install.
yesod-fay-test-0.0.0 depends on language-ecmascript-0.15.2 which failed to
install.

and now it gets interesting, on the machine where yesod-fay built succesfully, I got:
Installed language-ecmascript-0.16.1

going to try that and see if it helps. still strange cabal on the other machine installs higher versions automatically. Tempted to install a newer ghc on the broken machine, but I don't think that is it. I'll keep trying to understand how cabal does this, otherwise I'll be staring at this every time I try to update yesod I'm afraid.

Willem van den Ende

unread,
Apr 7, 2014, 11:30:28 AM4/7/14
to yeso...@googlegroups.com, mic...@snoyman.com
From there on, it only gets scarier ;). Specified fay >=0.19 and then ecmascript>0.16 and got, amongst other things this:

Last 10 lines of the build log ( /home/willem/dev/spikes/haskell/yesod-fay/.cabal-sandbox/logs/traverse-with-class-0.1.1.1.log ):
Loading package containers-0.4.2.1 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.

Data/Generics/Traversable/Instances.hs:21:1:ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.1 for x86_64-unknown-linux):
    Can't happen: pprExp (CompExp [])

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

tempted to install a newer ghc like on the this machine as well. (that leaves the missing haskell files in the scaffold, but that might be fixable...).


On Monday, April 7, 2014 3:33:06 PM UTC+1, Adam Bergmark wrote:

Adam Bergmark

unread,
Apr 7, 2014, 11:33:20 AM4/7/14
to yeso...@googlegroups.com
Handler/Home.hs:23:11:
>    Exception when trying to run compile-time code:
>      unable to find (existing) package's share dir: fay-base
> tried: /home/willem/dev/spikes/haskell/yesod-pgfay-test/.cabal-sandbox/share/x86_64-linux-ghc-7.6.3/fay-base-0.19
> /home/willem/dev/spikes/haskell/yesod-pgfay-test/.cabal-sandbox/share/x86_64-linux-ghc-7.6.3/fay-base-0.19/src

This is because you are running fay from a sandbox, Fay has an option `configPackageConf` that should be set to your sandbox's package config file. See https://github.com/faylang/fay/wiki/Installing-and-running#sandboxes
yesod-fay doesn't currently have an option to pass this through to fay, but it may work to just set the HASKELL_PACKAGE_SANDBOX env variable, or add this option to yesod-fay so it's passed through properly.

Willem van den Ende

unread,
Apr 7, 2014, 11:42:37 AM4/7/14
to yeso...@googlegroups.com
Thanks, I'll try that out.
...

Willem van den Ende

unread,
Apr 7, 2014, 2:05:27 PM4/7/14
to yeso...@googlegroups.com
that did the trick :). Thanks!

For other newbies passing by later: the HASKELL_PACKAGE_SANDBOX needs the conf.d directory, not the cabal.sandbox.conf. For some reason (as indicated in the fay installing and running sandboxes page) you need to cabal install fay-base by hand as well. I'll see if adding it to the projects' cabal file helps (it should, right?).

export HASKELL_PACKAGE_SANDBOX=.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/
cabal build (complains about missing fay-base)
cabal install fay-base
cabal build
cabal test

Everything compiles (the test fails because I still need to make a new postgres database, but that's trivial :) ).

I'll try the other machine with a newer ghc. should work as well. Thanks :)
...

Adam Bergmark

unread,
Apr 7, 2014, 3:18:00 PM4/7/14
to yeso...@googlegroups.com
You can't add fay-base to the cabal file since its module names conflict with base. You can however add some other fay package (such as fay-text) as a depnedency which will force fay-base to be installed.


--

Willem van den Ende

unread,
Apr 7, 2014, 5:52:16 PM4/7/14
to yeso...@googlegroups.com
Thanks, added fay-text to the projects cabal file (looks useful in itself as well, to not have String everywhere). I'll look into yesod-fay's and see if it can pass configPackageConf on (I have no clue, but should be a good learning experience...).
...
Reply all
Reply to author
Forward
0 new messages