digestive-functors cabal version problems

62 views
Skip to first unread message

Alex Greif

unread,
Jun 2, 2015, 3:41:48 PM6/2/15
to snap_fr...@googlegroups.com
Hi,

I am begnning with snap, and are confronted with cabal hell.

I want to add digestive-functors, digestive-functors-snap, digestive-functors-heist, to the cabal file, but cannot figure out with which version,
I always get dependency errors.

Can please anybody tell me which version of the DF packageg fits to the following scaffolded versions?

 Build-depends:
    bytestring                >= 0.9.1   && < 0.11,
    heist                     >= 0.14    && < 0.15,
    MonadCatchIO-transformers >= 0.2.1   && < 0.4,
    mtl                       >= 2       && < 3,
    snap                      >= 0.13    && < 0.15,
    snap-core                 >= 0.9     && < 0.10,
    snap-server               >= 0.9     && < 0.10,
    snap-loader-static        >= 0.9     && < 0.10,
    text                      >= 0.11    && < 1.3,
    time                      >= 1.1     && < 1.6,
    xmlhtml                   >= 0.1     && < 0.3


$ cabal -V
cabal-install version 1.18.0.5
using version 1.18.1.4 of the Cabal library

$ ghc -V
The Glorious Glasgow Haskell Compilation System, version 7.8.3

thanks,
Alex.

MightyByte

unread,
Jun 2, 2015, 3:52:22 PM6/2/15
to snap_fr...@googlegroups.com
Hi there. First of all, it looks like you are using an old version of
Cabal and cabal-install. The older versions are MUCH more prone to
these issues than the newer ones. So as a first step, I would suggest
that you upgrade by doing "cabal update && cabal install
cabal-install". After you do this, do "cabal -V" again to verify that
you are using the newer version. Then try the install again with the
new version of cabal-install and see if it works. If you are still
having problems, then paste build messages and the list of currently
installed packages and give us a link and we will be better able to
help. To list the currently installed packages do "cabal sandbox
hc-pkg list" if you are using a sandbox or "ghc-pkg list" if not.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Snap Framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to snap_framewor...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Adam Bergmark

unread,
Jun 2, 2015, 6:16:45 PM6/2/15
to snap_fr...@googlegroups.com
For the record, here's a working install plan I get by default on GHC-7.8 in an empty sandbox:

V~/r/t/snap> cabal install --dry-run -v2 snap digestive-functors-snap digestive-functors-heist
Found no modified add-source deps.
Reading available packages...
Choosing modular solver.
Resolving dependencies...
In order, the following would be installed:
HUnit-1.2.5.2 (via: snap-core-0.9.7.0) (new package)
base-orphans-0.3.2 (via: semigroupoids-5.0.0.2) (new package)
base64-bytestring-1.0.0.1 (via: clientsession-0.9.1.1 pwstore-fast-2.4.4) (new package)
byteable-0.1.1 (via: cprng-aes-0.6.1 cipher-aes-0.2.10 crypto-cipher-types-0.0.9 securemem-0.1.9 pwstore-fast-2.4.4 cryptohash-0.11.6) (new package)
bytestring-builder-0.10.6.0.0 (via: blaze-builder-enumerator-0.2.1.0) (new package)
bytestring-mmap-0.2.2 (via: snap-core-0.9.7.0) (new package)
cereal-0.4.1.1 (via: snap-0.14.0.4 clientsession-0.9.1.1 skein-1.0.9.3 crypto-api-0.13.2) (new package)
cryptohash-0.11.6 (via: pwstore-fast-2.4.4) (new package)
directory-tree-0.12.0 (via: snap-0.14.0.4 heist-0.14.1) (new package)
dlist-0.7.1.1 (via: snap-0.14.0.4 heist-0.14.1 aeson-0.8.1.1) (new package)
entropy-0.3.6 (via: clientsession-0.9.1.1 crypto-api-0.13.2) (new package)
extensible-exceptions-0.1.1.4 (via: MonadCatchIO-transformers-0.3.1.3) (new package)
memory-0.7 (via: securemem-0.1.9) (new package)
network-2.6.2.0 (via: snap-server-0.9.5.1 streaming-commons-0.1.12.1) (new package)
parallel-3.2.0.6 (via: lens-4.11) (new package)
prelude-extras-0.4 (via: free-4.12.1) (new package)
random-1.1 (via: snap-core-0.9.7.0 streaming-commons-0.1.12.1 heist-0.14.1 MonadRandom-0.4 pwstore-fast-2.4.4) (new package)
pwstore-fast-2.4.4 (via: snap-0.14.0.4) (new package)
reflection-1.5.2.1 (via: lens-4.11) (new package)
safe-0.3.9 (via: errors-1.4.7) (new package)
securemem-0.1.9 (via: crypto-random-0.0.9 cipher-aes-0.2.10 crypto-cipher-types-0.0.9) (new package)
crypto-cipher-types-0.0.9 (via: cipher-aes-0.2.10) (new package)
cipher-aes-0.2.10 (via: clientsession-0.9.1.1 cprng-aes-0.6.1) (new package)
setenv-0.1.1.3 (via: clientsession-0.9.1.1) (new package)
stm-2.4.4 (via: snap-0.14.0.4 streaming-commons-0.1.12.1 monad-control-1.0.0.4 transformers-base-0.4.4 exceptions-0.8.0.2 StateVar-1.1.0.0) (new package)
syb-0.4.4 (latest: 0.5.1) (via: snap-0.14.0.4 aeson-0.8.1.1) (new package)
tagged-0.8.0.1 (via: lens-4.11 kan-extensions-4.2.2 adjunctions-4.2.1 semigroupoids-5.0.0.2 profunctors-5.1.1 comonad-4.2.6 clientsession-0.9.1.1 bifunctors-5 distributive-0.4.4 skein-1.0.9.3 crypto-api-0.13.2) (new package)
text-1.2.1.1 -integer-simple (via: snap-0.14.0.4 snap-server-0.9.5.1 digestive-functors-snap-0.6.1.3 snap-core-0.9.7.0 streaming-commons-0.1.12.1 digestive-functors-heist-0.8.6.2 heist-0.14.1 xmlhtml-0.2.3.4 lens-4.11 aeson-0.8.1.1 semigroups-0.16.2.2 configurator-0.3.0.0 parsec-3.1.9 digestive-functors-0.8.0.0 attoparsec-enumerator-0.3.4 enumerator-0.4.20 attoparsec-0.13.0.0 scientific-0.3.3.8 case-insensitive-1.2.0.4 hashable-1.2.3.2 blaze-html-0.8.0.2 blaze-markup-0.7.0.2 blaze-builder-0.4.0.1) (new package)
blaze-builder-0.4.0.1 (via: snap-server-0.9.5.1 snap-core-0.9.7.0 blaze-builder-enumerator-0.2.1.0 streaming-commons-0.1.12.1 digestive-functors-heist-0.8.6.2 heist-0.14.1 xmlhtml-0.2.3.4 blaze-html-0.8.0.2 blaze-markup-0.7.0.2) (new package)
blaze-markup-0.7.0.2 (via: xmlhtml-0.2.3.4 blaze-html-0.8.0.2) (new package)
blaze-html-0.8.0.2 (via: heist-0.14.1 xmlhtml-0.2.3.4) (new package)
hashable-1.2.3.2 (via: snap-0.14.0.4 snap-core-0.9.7.0 heist-0.14.1 lens-4.11 void-0.7 aeson-0.8.1.1 semigroups-0.16.2.2 configurator-0.3.0.0 unordered-containers-0.2.5.1 scientific-0.3.3.8 nats-1 case-insensitive-1.2.0.4) (new package)
case-insensitive-1.2.0.4 (via: snap-server-0.9.5.1 snap-core-0.9.7.0) (new package)
nats-1 (via: semigroups-0.16.2.2) (new package)
scientific-0.3.3.8 (via: aeson-0.8.1.1 attoparsec-0.13.0.0) (new package)
transformers-0.4.3.0 (via: snap-0.14.0.4 zlib-enum-0.2.3.1 blaze-builder-enumerator-0.2.1.0 streaming-commons-0.1.12.1 heist-0.14.1 lens-4.11 kan-extensions-4.2.2 errors-1.4.7 either-4.4.1 adjunctions-4.2.1 free-4.12.1 semigroupoids-5.0.0.2 profunctors-5.1.1 comonad-4.2.6 contravariant-1.3.1.1 aeson-0.8.1.1 monad-control-1.0.0.4 transformers-base-0.4.4 exceptions-0.8.0.2 distributive-0.4.4 MonadRandom-0.4 transformers-compat-0.4.0.4 primitive-0.6 mtl-2.2.1 MonadCatchIO-transformers-0.3.1.3 monads-tf-0.1.0.2 mmorph-1.0.4 enumerator-0.4.20 crypto-api-0.13.2 attoparsec-0.13.0.0 StateVar-1.1.0.0) (new package)
StateVar-1.1.0.0 (via: contravariant-1.3.1.1) (new package)
attoparsec-0.13.0.0 (via: snap-0.14.0.4 snap-server-0.9.5.1 snap-core-0.9.7.0 heist-0.14.1 aeson-0.8.1.1 configurator-0.3.0.0 attoparsec-enumerator-0.3.4) (new package)
crypto-api-0.13.2 (via: clientsession-0.9.1.1 skein-1.0.9.3) (new package)
enumerator-0.4.20 (via: snap-server-0.9.5.1 snap-core-0.9.7.0 zlib-enum-0.2.3.1 blaze-builder-enumerator-0.2.1.0 attoparsec-enumerator-0.3.4) (new package)
attoparsec-enumerator-0.3.4 (via: snap-server-0.9.5.1 snap-core-0.9.7.0) (new package)
mmorph-1.0.4 (via: either-4.4.1) (new package)
monads-tf-0.1.0.2 (via: MonadCatchIO-transformers-0.3.1.3) (new package)
MonadCatchIO-transformers-0.3.1.3 (via: snap-0.14.0.4 snap-server-0.9.5.1 snap-core-0.9.7.0 heist-0.14.1) (new package)
mtl-2.2.1 (via: snap-0.14.0.4 snap-server-0.9.5.1 digestive-functors-snap-0.6.1.3 snap-core-0.9.7.0 digestive-functors-heist-0.8.6.2 heist-0.14.1 lens-4.11 kan-extensions-4.2.2 either-4.4.1 adjunctions-4.2.1 free-4.12.1 vector-algorithms-0.7 aeson-0.8.1.1 exceptions-0.8.0.2 MonadRandom-0.4 regex-base-0.93.2 parsec-3.1.9 map-syntax-0.2 logict-0.6.0.2 digestive-functors-0.8.0.0) (new package)
digestive-functors-0.8.0.0 (via: digestive-functors-snap-0.6.1.3 digestive-functors-heist-0.8.6.2) (new package)
logict-0.6.0.2 (via: snap-0.14.0.4) (new package)
map-syntax-0.2 (via: heist-0.14.1) (new package)
parsec-3.1.9 (via: xmlhtml-0.2.3.4) (new package)
primitive-0.6 (via: vector-algorithms-0.7 mwc-random-0.13.3.2 vector-0.10.12.3) (new package)
regex-base-0.93.2 (via: regex-posix-0.95.2) (new package)
regex-posix-0.95.2 (via: snap-0.14.0.4 snap-core-0.9.7.0) (new package)
skein-1.0.9.3 (via: clientsession-0.9.1.1) (new package)
transformers-compat-0.4.0.4 (via: lens-4.11 semigroupoids-5.0.0.2 comonad-4.2.6 contravariant-1.3.1.1 monad-control-1.0.0.4 transformers-base-0.4.4 exceptions-0.8.0.2 distributive-0.4.4 MonadRandom-0.4) (new package)
MonadRandom-0.4 (via: either-4.4.1) (new package)
distributive-0.4.4 (via: lens-4.11 kan-extensions-4.2.2 adjunctions-4.2.1 free-4.12.1 semigroupoids-5.0.0.2 profunctors-5.1.1 comonad-4.2.6) (new package)
exceptions-0.8.0.2 (via: lens-4.11 either-4.4.1 free-4.12.1) (new package)
transformers-base-0.4.4 (via: either-4.4.1 monad-control-1.0.0.4) (new package)
monad-control-1.0.0.4 (via: either-4.4.1) (new package)
unix-compat-0.4.1.4 (via: snap-server-0.9.5.1 snap-core-0.9.7.0 configurator-0.3.0.0) (new package)
unordered-containers-0.2.5.1 (via: snap-0.14.0.4 snap-core-0.9.7.0 heist-0.14.1 xmlhtml-0.2.3.4 lens-4.11 aeson-0.8.1.1 semigroups-0.16.2.2 configurator-0.3.0.0) (new package)
configurator-0.3.0.0 (via: snap-0.14.0.4) (new package)
semigroups-0.16.2.2 (via: lens-4.11 either-4.4.1 adjunctions-4.2.1 free-4.12.1 semigroupoids-5.0.0.2 comonad-4.2.6 contravariant-1.3.1.1 void-0.7 bifunctors-5) (new package)
bifunctors-5 (via: lens-4.11 either-4.4.1 free-4.12.1 semigroupoids-5.0.0.2) (new package)
vector-0.10.12.3 (via: snap-0.14.0.4 snap-core-0.9.7.0 heist-0.14.1 lens-4.11 vector-algorithms-0.7 mwc-random-0.13.3.2 crypto-random-0.0.9 aeson-0.8.1.1) (new package)
aeson-0.8.1.1 (latest: 0.9.0.1) +old-locale (via: snap-0.14.0.4 heist-0.14.1) (new package)
crypto-random-0.0.9 (via: clientsession-0.9.1.1 cprng-aes-0.6.1) (new package)
cprng-aes-0.6.1 (via: clientsession-0.9.1.1) (new package)
clientsession-0.9.1.1 (via: snap-0.14.0.4) (new package)
mwc-random-0.13.3.2 (via: snap-0.14.0.4 vector-algorithms-0.7) (new package)
vector-algorithms-0.7 (via: snap-0.14.0.4) (new package)
void-0.7 (via: lens-4.11 adjunctions-4.2.1 contravariant-1.3.1.1) (new package)
contravariant-1.3.1.1 (via: lens-4.11 kan-extensions-4.2.2 adjunctions-4.2.1 semigroupoids-5.0.0.2 comonad-4.2.6) (new package)
comonad-4.2.6 (via: snap-0.14.0.4 lens-4.11 kan-extensions-4.2.2 adjunctions-4.2.1 free-4.12.1 semigroupoids-5.0.0.2 profunctors-5.1.1) (new package)
profunctors-5.1.1 (via: lens-4.11 either-4.4.1 adjunctions-4.2.1 free-4.12.1) (new package)
semigroupoids-5.0.0.2 (via: lens-4.11 kan-extensions-4.2.2 either-4.4.1 adjunctions-4.2.1 free-4.12.1) (new package)
free-4.12.1 (via: lens-4.11 kan-extensions-4.2.2 either-4.4.1 adjunctions-4.2.1) (new package)
adjunctions-4.2.1 (via: kan-extensions-4.2.2) (new package)
either-4.4.1 (via: errors-1.4.7) (new package)
errors-1.4.7 (latest: 2.0.0) (via: snap-0.14.0.4 heist-0.14.1) (new package)
kan-extensions-4.2.2 (via: lens-4.11) (new package)
lens-4.11 (via: snap-0.14.0.4) (new package)
xmlhtml-0.2.3.4 (via: snap-0.14.0.4 digestive-functors-heist-0.8.6.2 heist-0.14.1) (new package)
heist-0.14.1 (via: snap-0.14.0.4 digestive-functors-heist-0.8.6.2) (new package)
digestive-functors-heist-0.8.6.2 (new package)
zlib-0.6.1.1 (via: zlib-bindings-0.1.1.5 streaming-commons-0.1.12.1) (new package)
streaming-commons-0.1.12.1 (via: blaze-builder-enumerator-0.2.1.0) (new package)
blaze-builder-enumerator-0.2.1.0 (via: snap-server-0.9.5.1 snap-core-0.9.7.0) (new package)
zlib-bindings-0.1.1.5 (via: zlib-enum-0.2.3.1) (new package)
zlib-enum-0.2.3.1 (via: snap-core-0.9.7.0) (new package)
snap-core-0.9.7.0 (via: snap-0.14.0.4 snap-server-0.9.5.1 digestive-functors-snap-0.6.1.3) (new package)
digestive-functors-snap-0.6.1.3 (new package)
snap-server-0.9.5.1 (via: snap-0.14.0.4) (new package)
snap-0.14.0.4 (new package)

Sönke Hahn

unread,
Jun 2, 2015, 10:23:28 PM6/2/15
to snap_fr...@googlegroups.com
On 06/03/2015 06:16 AM, Adam Bergmark wrote:
> V~/r/t/snap> cabal install --dry-run -v2 snap digestive-functors-snap
[snip]
> HUnit-1.2.5.2 (via: snap-core-0.9.7.0) (new package)
> base-orphans-0.3.2 (via: semigroupoids-5.0.0.2) (new package)
[...]

Sorry for hijacking this thread, but how do you get cabal to print the
"via" brackets? I assume those point to direct dependents?

I thought "-v2" would do the trick but it does not for me
(cabal-install-1.22.2.0).

Any idea?

Thanks,
Sönke

Adam Bergmark

unread,
Jun 3, 2015, 4:54:37 AM6/3/15
to snap_fr...@googlegroups.com
I think you need the absolute latest, cabal-install version 1.22.4.0

Alex Greif

unread,
Jun 3, 2015, 4:56:18 AM6/3/15
to snap_fr...@googlegroups.com
I upgraded cabal

$ cabal -V
cabal-install version 1.22.4.0
using version 1.22.3.0 of the Cabal library

then:
$ rm -rf ~/.ghc ~/.cabal
$ cabal update
$ mkdir snap3
$ cd snap3
$ wget https://www.stackage.org/lts/cabal.config
$ cabal sandbox init
$ cabal install  snap digestive-functors-snap digestive-functors-heist
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: digestive-functors-snap-0.6.1.3 (user goal)
next goal: digestive-functors (dependency of digestive-functors-snap-0.6.1.3)
rejecting: digestive-functors-0.8.0.0 (global constraint requires ==0.7.1.5)
rejecting: digestive-functors-0.7.1.5 (conflict: digestive-functors-snap =>
digestive-functors>=0.8 && <0.9)
rejecting: digestive-functors-0.7.1.4, 0.7.1.3, 0.7.1.2, 0.7.1.1, 0.7.1.0,
0.7.0.0, 0.6.2.0, 0.6.1.1, 0.6.1.0, 0.6.0.1, 0.6.0.0, 0.5.0.4, 0.5.0.3,
0.5.0.2, 0.5.0.1, 0.5.0.0, 0.4.1.2, 0.4.1.1, 0.4.1.0, 0.4.0.0, 0.3.2.1,
0.3.1.0, 0.3.0.2, 0.3.0.1, 0.3.0.0, 0.2.1.0, 0.2.0.1, 0.2.0.0, 0.1.0.2,
0.1.0.1, 0.1.0.0, 0.0.2.1, 0.0.2.0, 0.0.1 (global constraint requires
==0.7.1.5)
Dependency tree exhaustively searched.

Adam Bergmark

unread,
Jun 3, 2015, 5:05:16 AM6/3/15
to snap_fr...@googlegroups.com
You didn't mention you are using stackage LTS. It looks like digestive-functors-snap and -heist are not part of the LTS distribution so the versions of the LTS packages may not be compatible with them.

I just did a clean sandbox install without stackage.


Matthias Fischmann

unread,
Jun 3, 2015, 5:06:23 AM6/3/15
to snap_fr...@googlegroups.com

this is a bit hacky and ad hoc, but it could work:

1. wget https://raw.githubusercontent.com/liqd/thentos/master/cabal.config
2. cabal install --only-dep
3. rm cabal.config
4. cabal freeze

(of course, instead of our freeze file, you could also try stackage.)

I am using sandboxes all the time, so I'm not sure where cabal is
finding the freeze file cabal.config if you don't. I would try ./ and
then ~/.cabal/, and then ask the internet.

If you do not want to use a freeze file, you can use it as a basis for
adding constraints to your cabal file.


On Wed, Jun 03, 2015 at 01:56:17AM -0700, Alex Greif wrote:
> Date: Wed, 3 Jun 2015 01:56:17 -0700 (PDT)
> From: Alex Greif <alex....@gmail.com>
> To: snap_fr...@googlegroups.com
> Subject: [snap] Re: digestive-functors cabal version problems

Alex Greif

unread,
Jun 3, 2015, 5:23:51 AM6/3/15
to snap_fr...@googlegroups.com
sorry, I am quite new to cabal and have not yet a preferred workflow. So thats why using LTS is maybe a mistake, but I saw it somewhere.

are these the steps to get a new clean snap project with DF?


$ cabal update
$ mkdir snap3
$ cd snap3
$ cabal sandbox init
$ cabal install  snap digestive-functors-snap digestive-functors-heist


thanks,
Alex.

Adam Bergmark

unread,
Jun 3, 2015, 5:34:53 AM6/3/15
to snap_fr...@googlegroups.com
Yes that's exactly what I did. Afterwards you can run `cabal freeze` to pin the dependencies.

Using stackage is good but if you venture outside of the packages included in the distribution you may - as you noticed - have problems. At this point you may run into fewer problems if you upgrade to GHC 7.10 and use stackage nightly.

You may also want to ask Jasper (the maintainer) to include these packages in stackage, he has other packages on there already.

You can also see if a package (and which version) is included in LTS Haskell/Stackage nightly by checking the Distribution field on hackage e.g. http://hackage.haskell.org/package/fay is included in both.

HTH,
Adam

 

thanks,
Alex.

Alex Greif

unread,
Jun 3, 2015, 5:55:17 AM6/3/15
to snap_fr...@googlegroups.com
thanks for all your help, now I could install everything on a mac and also on OpenBSD 5.7

in One case on the Mac, at the end I had this:

...
Downloading digestive-functors-heist-0.8.6.2...
Configuring digestive-functors-heist-0.8.6.2...
Building digestive-functors-heist-0.8.6.2...
Installed digestive-functors-heist-0.8.6.2
Installed lens-4.11
Downloading snap-0.14.0.4...
Failed to install snap-0.14.0.4
Build log ( /Users/agreif/tmp/snap1/.cabal-sandbox/logs/snap-0.14.0.4.log ):
cabal: /Users/agreif/tmp/snap1/.cabal-sandbox/logs/snap-0.14.0.4.log: does not exist

installing another time everything went fine.... hmm, strange

Alex.

Adam Bergmark

unread,
Jun 3, 2015, 6:26:26 AM6/3/15
to snap_fr...@googlegroups.com
I've seen that before as well, have never been able to reproduce it though!

--

Sönke Hahn

unread,
Jun 3, 2015, 9:28:33 AM6/3/15
to snap_fr...@googlegroups.com
On 06/03/2015 04:54 PM, Adam Bergmark wrote:
> I think you need the absolute latest, cabal-install version 1.22.4.0

Yep, that does it, thanks!

>
> On Wed, Jun 3, 2015 at 4:23 AM, Sönke Hahn <soenk...@gmail.com
> <mailto:soenk...@gmail.com>> wrote:
>
> On 06/03/2015 06:16 AM, Adam Bergmark wrote:
> > V~/r/t/snap> cabal install --dry-run -v2 snap digestive-functors-snap
> [snip]
> > HUnit-1.2.5.2 (via: snap-core-0.9.7.0) (new package)
> > base-orphans-0.3.2 (via: semigroupoids-5.0.0.2) (new package)
> [...]
>
> Sorry for hijacking this thread, but how do you get cabal to print the
> "via" brackets? I assume those point to direct dependents?
>
> I thought "-v2" would do the trick but it does not for me
> (cabal-install-1.22.2.0).
>
> Any idea?
>
> Thanks,
> Sönke
>
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Snap Framework" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to snap_framewor...@googlegroups.com
> <mailto:snap_framework%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Snap Framework" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to snap_framewor...@googlegroups.com
> <mailto:snap_framewor...@googlegroups.com>.

Sönke Hahn

unread,
Jun 3, 2015, 9:32:08 AM6/3/15
to snap_fr...@googlegroups.com
That is what cabal outputs when downloading the snap package fails, e.g.
when your internet connection is down. (Which is obviously not a good
error message.)
> <mailto:snap_framewor...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Snap Framework" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to snap_framewor...@googlegroups.com
> <mailto:snap_framewor...@googlegroups.com>.

Alex Greif

unread,
Jun 3, 2015, 2:53:26 PM6/3/15
to snap_fr...@googlegroups.com
installation of snap and the digestive-functors packages in a sandbox was successful, but now I face the following error.

any ideas how to fix this?

$ cd snap2
$ cabal install

... works fine, and the .cabal-sandbox/bin/snap2 ist working.

but here is the problem:

$ cabal install -fdevelopment

Resolving dependencies...
cabal: Could not resolve dependencies:
trying: MonadCatchIO-transformers-0.3.1.3/installed-88c... (user goal)
trying: snap2-0.1 (user goal)
rejecting: snap2-0.1:-development (global constraint requires opposite flag
selection)
trying: snap2-0.1:+development
trying: snap-loader-dynamic-0.10.0.2 (dependency of snap2-0.1:+development)
trying: hint-0.4.2.3 (dependency of snap-loader-dynamic-0.10.0.2)
next goal: ghc (dependency of hint-0.4.2.3)
rejecting: ghc-7.8.3/installed-005... (conflict: MonadCatchIO-transformers =>
transformers==0.4.3.0/installed-4bf..., ghc =>
transformers==0.3.0.0/installed-16a...)
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.


thanks in advance,
Alex.

MightyByte

unread,
Jun 3, 2015, 2:56:00 PM6/3/15
to snap_fr...@googlegroups.com
There's a FAQ entry for development mode here.

http://snapframework.com/faq#how-do-i-run-my-app-in-development-mode

The issue is that if you are using -fdevelopment you have to do a
complete clean and rebuild first. Development mode adds additional
dependencies and you want them to be included when the solver is
initially figuring out a build plan.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Snap Framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to snap_framewor...@googlegroups.com.

Alex Greif

unread,
Jun 4, 2015, 12:52:03 AM6/4/15
to snap_fr...@googlegroups.com
Hi,
I get the problem after a new install with these steps:

$ mkdir
$ cd
$ cabal sandbox init
$ cabal install --force-reinstall snap digestive-functors-snap digestive-functors-heist
$ ./.cabal-sandbox/bin/snap init default
$ cabal install -fdevelopment

gets the problem on Mac and OpenBSD

agreif@itag-mac:~/tmp/snap2 $ cabal install -fdevelopment

MightyByte

unread,
Jun 4, 2015, 2:30:16 AM6/4/15
to snap_fr...@googlegroups.com
That's not quite right. You created a sandbox, then installed snap
and digestive functors (which installed a bunch of dependencies), then
tried to install your app with -fdevelopment. When you did the first
cabal install command, that fixed you to specific versions of snap,
digestive-functors, and all their dependencies. Then when you did the
second cabal install command it was trying to use the versions that
were already installed from the first cabal install command and those
versions conflicted with the different versions required when you use
-fdevelopment. You should do something like this instead.

mkdir foo
cd foo
snap init
cabal sandbox init
# edit foo.cabal and add the digestive-functors packages as dependencies
cabal install -fdevelopment

This works for me. There's a chance that cabal may hit the backjump
limit before it finds a solution. If that happens, change the last
command to:

cabal install -fdevelopment --constraint='transformers installed'

Alex Greif

unread,
Jun 4, 2015, 3:58:30 AM6/4/15
to snap_fr...@googlegroups.com
finally I got it working on OpenBSD, but only in two steps  (setting up sandbox twice)

$ mkdir foo
$ cd foo

# install snap alone to get the binary
$ cabal sandbox init
$ cabal install snap --force-reinstalls # force-reinstalls due to regex-compat-0.95.1 problem

$ .cabal-sandbox/bin/snap init
$ emacs foo.cabal
# add these lines
#     digestive-functors        >= 0.8     && < 0.9,
#     digestive-functors-snap   >= 0.6.0.0 && < 0.7.0.0,
#     digestive-functors-heist  >= 0.8     && < 0.9

# step 2 - install again
$ rm -rf .cabal-sandbox/
$ rm -rf .ghci
$ cabal sandbox init
$ cabal install -fdevelopment --constraint='transformers installed'


thanks, for your help,
cheers,
Alex.

MightyByte

unread,
Jun 4, 2015, 9:18:29 AM6/4/15
to snap_fr...@googlegroups.com
Great, glad you got it working and sorry it took so long. There are
two more points of note that will probably be useful to you.

1. When you install a package with "cabal install ...", if you are
running inside a sandbox it stores the generated binaries in
.cabal-sandbox/bin (as you have clearly figured out. But if you are
NOT running in a sandbox, then it stores the binaries in
$HOME/.cabal/bin. Since the snap package generates a binary
executable called "snap", you can avoid the need to do this two-stage
version by running "cabal install snap" when you are NOT inside a
sandbox. Then the "snap" binary will be at $HOME/.cabal/bin/snap and
you won't need to keep regenerating it when you create a new sandbox.
I had assumed you had already done this, which is why my instructions
did not mention this first stage.

The general rule of thumb is that you probably want to install all
your haskell binaries outside the sandbox so that you have them
permanently stored in $HOME/.cabal/bin and don't need to keep
rebuilding them every time you delete your sandbox. A few notable
packages for which you definitely want to do this are alex, happy, and
snap.

2. Instead of doing the two rm -rf commands that you have at the end,
you can simple do "cabal sandbox delete". :)

I wrote a couple of blog posts about cabal awhile back that cover some
of this as well as other tips about working with cabal. They would
probably be informative for you.

http://softwaresimply.blogspot.com/2012/11/a-practical-cabal-primer.html
http://softwaresimply.blogspot.com/2014/07/haskell-best-practices-for-avoiding.html

Alex Greif

unread,
Jun 4, 2015, 9:27:01 AM6/4/15
to snap_fr...@googlegroups.com
thanks for the long explanation, it clarified a lot.
Now Ialso understand why yesod suggests this in its quick start guide...

cabal
update # download package list cabal install alex happy yesod-bin # install build tools yesod init --bare # answer questions as prompted cabal sandbox init

Anyway, now I can continue with the snap tutorials and get a real grasp on it.

thanks,
Alex.

Alex Greif

unread,
Jun 18, 2015, 10:26:12 AM6/18/15
to snap_fr...@googlegroups.com
for completeness sake here is the sequence of shell commands:

# optional cleanup and update

$ rm -rf ~/.ghc ~/.cabal
$ cabal update
$ cabal install cabal-install

# install global packages
$ cabal install alex happy snap


$ mkdir foo
$ cd foo

$ cabal sandbox init
$ snap init

$ emacs foo.cabal
# add these dependencies

#     digestive-functors        >= 0.8     && < 0.9,
#     digestive-functors-snap   >= 0.6.0.0 && < 0.7.0.0,
#     digestive-functors-heist  >= 0.8     && < 0.9

$ cabal install -fdevelopment
# or in case of problems

$ cabal install -fdevelopment --constraint='transformers installed'


Alex.

MightyByte

unread,
Jun 18, 2015, 1:39:12 PM6/18/15
to snap_fr...@googlegroups.com
My one small comment is that you almost never need to delete ~/.cabal.
And doing that potentially removes important things, such as more
recent versions of the "cabal" binary. If your system package manager
gave you an old version of cabal-install and you had installed a newer
one with "cabal install cabal-install", then that binary will be put
in ~/.cabal/bin. The same goes for the alex, happy, and snap
binaries. So if you already have those things installed, you can skip
your third and fourth commands by not deleting ~/.cabal.

Very rarely I have encountered situations where I needed to clean out
~/.cabal. But when I do that, I usually delete everything except the
~/.cabal/bin directory so I don't have reinstall all those
executables.
Reply all
Reply to author
Forward
0 new messages