commercialhaskell / stack

The Haskell Tool Stack
http://haskellstack.org
BSD 3-Clause "New" or "Revised" License
3.99k stars 845 forks source link

Did I do something wrong, or is there a bug? #120

Closed meteficha closed 9 years ago

meteficha commented 9 years ago

This is a newbie issue :). Just tried stack on my https://github.com/yesodweb/serversession WIP. Here's the last of a series of tries of stack building:

$ stack build
Installing dependencies: adjunctions-4.2.1, aeson-0.8.0.2, attoparsec-0.12.1.6, attoparsec-enumerator-0.3.4, bifunctors-4.2.1, blaze-builder-enumerator-0.2.1.0, blaze-html-0.8.0.2, blaze-markup-0.7.0.2, comonad-4.2.6, conduit-1.2.4.2, conduit-extra-1.1.9, configurator-0.3.0.0, contravariant-1.3.1.1, cookie-0.4.1.5, either-4.3.4, errors-1.4.7, free-4.11, hedis-0.6.5, heist-0.14.1, http-date-0.0.6.1, http-types-0.8.6, kan-extensions-4.2.2, lens-4.9.1, monad-logger-0.3.13.1, persistent-2.1.5, persistent-template-2.1.3.3, profunctors-4.4.1, semigroupoids-4.3, semigroups-0.16.2.2, shakespeare-2.0.5, snap-0.14.0.4, snap-core-0.9.7.0, snap-server-0.9.5.1, streaming-commons-0.1.12.1, unordered-containers-0.2.5.1, vault-0.3.0.4, void-0.7, wai-3.0.2.3, wai-extra-3.0.7.1, wai-logger-2.2.4, warp-3.0.13.1, xmlhtml-0.2.3.4, yesod-core-1.4.9.1
All dependencies unpacked
cookie-0.4.1.5: configure
attoparsec-0.12.1.6: configure
cookie-0.4.1.5: build
http-types-0.8.6: configure
attoparsec-0.12.1.6: build
cookie-0.4.1.5: build: ERROR
Stdout was:
Building cookie-0.4.1.5...
Preprocessing library cookie-0.4.1.5...
[1 of 1] Compiling Web.Cookie       ( Web/Cookie.hs, dist/build/Web/Cookie.o )

Stderr was:

/tmp/stack-unpack1264/cookie-0.4.1.5/Setup.lhs:4:3: Warning:
    Module ‘System.Cmd’ is deprecated: Use "System.Process" instead

Web/Cookie.hs:38:1: Warning:
    The import of ‘Data.Monoid’ is redundant
      except perhaps to import instances from ‘Data.Monoid’
    To import instances alone, use: import Data.Monoid()

Web/Cookie.hs:88:18: Warning:
    In the use of ‘S.breakByte’ (imported from Data.ByteString):
    Deprecated: "It is an internal function and should never have been exported. Use 'break (== x)' instead. (There are rewrite rules that handle this special case of 'break'.)"

Web/Cookie.hs:200:21: Warning:
    In the use of ‘parseTime’
    (imported from Data.Time, but defined in time-1.5.0.1:Data.Time.Format.Parse):
    Deprecated: "use "parseTimeM True" instead"

Web/Cookie.hs:54:8:
    Could not find module ‘Data.Default.Class’
    Perhaps you haven't installed the profiling libraries for package ‘data-default-class-0.0.1@datad_9ouboI9uirTF3xjV57lONw’?
    Use -v to see a list of the files searched for.

stack: Error when running Shake build system:
* /tmp/stack-unpack1264/cookie-0.4.1.5/dist/stack.gen
Process exited with ExitFailure 1: /usr/bin/runghc-7.10.1 -package=Cabal-1.22.2.0 -clear-package-db -global-package-db /tmp/stack-unpack1264/cookie-0.4.1.5/Setup.lhs build

Supposing stack's builds are reproducible, just clone the repo and try building it. I've tested at commit yesodweb/serversession@dc34513.

I'm using the nightly because stack didn't want to use my GHC 7.10.1 against lts-2.10.

NathanHowell commented 9 years ago

Are different ways (profiling, etc) supported as different targets? That seems to be a major shortcoming in cabal-install and it would be great to get it fixed here. On May 29, 2015 11:45 AM, "Felipe Lessa" notifications@github.com wrote:

This is a newbie issue :). Just tried stack on my https://github.com/yesodweb/serversession WIP. Here's the last of a series of tries of stack building:

$ stack build Installing dependencies: adjunctions-4.2.1, aeson-0.8.0.2, attoparsec-0.12.1.6, attoparsec-enumerator-0.3.4, bifunctors-4.2.1, blaze-builder-enumerator-0.2.1.0, blaze-html-0.8.0.2, blaze-markup-0.7.0.2, comonad-4.2.6, conduit-1.2.4.2, conduit-extra-1.1.9, configurator-0.3.0.0, contravariant-1.3.1.1, cookie-0.4.1.5, either-4.3.4, errors-1.4.7, free-4.11, hedis-0.6.5, heist-0.14.1, http-date-0.0.6.1, http-types-0.8.6, kan-extensions-4.2.2, lens-4.9.1, monad-logger-0.3.13.1, persistent-2.1.5, persistent-template-2.1.3.3, profunctors-4.4.1, semigroupoids-4.3, semigroups-0.16.2.2, shakespeare-2.0.5, snap-0.14.0.4, snap-core-0.9.7.0, snap-server-0.9.5.1, streaming-commons-0.1.12.1, unordered-containers-0.2.5.1, vault-0.3.0.4, void-0.7, wai-3.0.2.3, wai-extra-3.0.7.1, wai-logger-2.2.4, warp-3.0.13.1, xmlhtml-0.2.3.4, yesod-core-1.4.9.1 All dependencies unpacked cookie-0.4.1.5: configure attoparsec-0.12.1.6: configure cookie-0.4.1.5: build http-types-0.8.6: configure attoparsec-0.12.1.6: build cookie-0.4.1.5: build: ERROR Stdout was: Building cookie-0.4.1.5... Preprocessing library cookie-0.4.1.5... [1 of 1] Compiling Web.Cookie ( Web/Cookie.hs, dist/build/Web/Cookie.o )

Stderr was:

/tmp/stack-unpack1264/cookie-0.4.1.5/Setup.lhs:4:3: Warning: Module ‘System.Cmd’ is deprecated: Use "System.Process" instead

Web/Cookie.hs:38:1: Warning: The import of ‘Data.Monoid’ is redundant except perhaps to import instances from ‘Data.Monoid’ To import instances alone, use: import Data.Monoid()

Web/Cookie.hs:88:18: Warning: In the use of ‘S.breakByte’ (imported from Data.ByteString): Deprecated: "It is an internal function and should never have been exported. Use 'break (== x)' instead. (There are rewrite rules that handle this special case of 'break'.)"

Web/Cookie.hs:200:21: Warning: In the use of ‘parseTime’ (imported from Data.Time, but defined in time-1.5.0.1:Data.Time.Format.Parse): Deprecated: "use "parseTimeM True" instead"

Web/Cookie.hs:54:8: Could not find module ‘Data.Default.Class’ Perhaps you haven't installed the profiling libraries for package ‘data-default-class-0.0.1@datad_9ouboI9uirTF3xjV57lONw’? Use -v to see a list of the files searched for.

stack: Error when running Shake build system:

  • /tmp/stack-unpack1264/cookie-0.4.1.5/dist/stack.gen Process exited with ExitFailure 1: /usr/bin/runghc-7.10.1 -package=Cabal-1.22.2.0 -clear-package-db -global-package-db /tmp/stack-unpack1264/cookie-0.4.1.5/Setup.lhs build

Supposing stack's builds are reproducible, just clone the repo and try building it. I've tested at commit yesodweb/serversession@dc34513 https://github.com/yesodweb/serversession/commit/dc34513.

I'm using the nightly because stack didn't want to use my GHC 7.10.1 against lts-2.10.

— Reply to this email directly or view it on GitHub https://github.com/fpco/stack/issues/120.

DanBurton commented 9 years ago

I'm using the nightly because stack didn't want to use my GHC 7.10.1 against lts-2.10.

Correct. lts-2.10 is intended for ghc-7.8 only, while the nightlies for the past few weeks are intended for ghc-7.10 only (in preparation for lts-3, which will be ghc-7.10 only). Stack can install and use ghc-7.8.4 for you if you want. Just have resolver: lts-2.10 in your stack.yaml, and use the stack setup command. It installs it in an unobtrusive location, (by default, $HOME/.stack/ghc/ghc-7.8.4/) so it shouldn't get in the way.

I'll see if I can reproduce with 7.10 and nightly though.

DanBurton commented 9 years ago

Generally if it doesn't "just work" or give a useful error message about what you did wrong, I'd call it a bug. Stack is meant to be very easy to use with little to no special knowledge about it.

DanBurton commented 9 years ago

I'm getting a FlexibleContexts error trying to compile wai-session-0.3.1 against ghc-7.10.

meteficha commented 9 years ago

Hmmm, sorry about that, I completely forgot I had to patch wai-session locally, cf. https://github.com/singpolyma/wai-session/pull/7. The build was bound to fail anyway :(.

meteficha commented 9 years ago

I don't suppose stack currently has support for overriding a package locally like cabal sandbox, right?

DanBurton commented 9 years ago

I'm not quite sure what the intended "override package locally" workflow is. What I did just now was I modified my local copy of wai-session in .stack-work/unpacked/wai-session-0.3.1/ (same fix as your PR on that repo). After that, everything built for me just fine.

meteficha commented 9 years ago

I'm thinking about cabal sandbox add-source --oneshot. Editing a file from .stack-work looks too hackish for me.

So cookie didn't give you any troubles? Did you use the same stack.yaml, only patching wai-session?

DanBurton commented 9 years ago

I used the same stack.yaml, except I changed the nightly from the 29th to the 28th, since I already had a lot of packages in yesterday's nightly on my machine. I've changed it back to the 29th now, and am trying the build again, but that'll take some time.

Can you do a stack exec -- ghc-pkg list data-default-class to see which database that package is in? Stack should be installing the profiling version of it, since it's in the stackage snapshot.

meteficha commented 9 years ago

I've just wiped ~/.stack/snapshots and tried stack build again, sorry. If the error occurs again, I'll run that command.

meteficha commented 9 years ago

Thankfully, the same problem happened again. Full stack build after wiping ~/.stack/snapshots:

$ stack build 
Installing dependencies: BoundedChan-1.0.3.0, HUnit-1.2.5.2, MonadCatchIO-transformers-0.3.1.3, MonadRandom-0.3.0.2, QuickCheck-2.8.1, StateVar-1.1.0.0, adjunctions-4.2.1, aeson-0.8.0.2, alex-3.1.4, ansi-terminal-0.6.2.1, appar-0.1.4, attoparsec-0.12.1.6, attoparsec-enumerator-0.3.4, auto-update-0.1.2.1, base64-bytestring-1.0.0.1, bifunctors-4.2.1, blaze-builder-0.4.0.1, blaze-builder-enumerator-0.2.1.0, blaze-html-0.8.0.2, blaze-markup-0.7.0.2, byteable-0.1.1, byteorder-1.0.4, bytestring-builder-0.10.6.0.0, bytestring-lexing-0.4.3.2, bytestring-mmap-0.2.2, case-insensitive-1.2.0.4, cereal-0.4.1.1, cipher-aes-0.2.10, clientsession-0.9.1.1, comonad-4.2.6, conduit-1.2.4.2, conduit-extra-1.1.9, configurator-0.3.0.0, contravariant-1.3.1.1, cookie-0.4.1.5, cprng-aes-0.6.1, crypto-api-0.13.2, crypto-cipher-types-0.0.9, crypto-random-0.0.9, cryptohash-0.11.6, directory-tree-0.12.0, distributive-0.4.4, easy-file-0.2.1, either-4.3.4, entropy-0.3.6, enumerator-0.4.20, errors-1.4.7, exceptions-0.8.0.2, fast-logger-2.3.1, free-4.11, hashable-1.2.3.2, hedis-0.6.5, heist-0.14.1, http-date-0.0.6.1, http-types-0.8.6, iproute-1.4.0, kan-extensions-4.2.2, lens-4.9.1, lifted-base-0.2.3.6, logict-0.6.0.2, map-syntax-0.2, mmorph-1.0.4, monad-control-1.0.0.4, monad-logger-0.3.13.1, monad-loops-0.4.2.1, monads-tf-0.1.0.2, mwc-random-0.13.3.2, nats-1, network-2.6.1.0, parallel-3.2.0.6, path-pieces-0.2.0, persistent-2.1.5, persistent-template-2.1.3.3, prelude-extras-0.4, profunctors-4.4.1, pwstore-fast-2.4.4, reflection-1.5.2.1, regex-base-0.93.2, regex-posix-0.95.2, resource-pool-0.2.3.2, resourcet-1.1.5, safe-0.3.9, safecopy-0.8.5, scientific-0.3.3.8, securemem-0.1.7, semigroupoids-4.3, semigroups-0.16.2.2, setenv-0.1.1.3, shakespeare-2.0.5, silently-1.2.4.1, simple-sendfile-0.2.20, skein-1.0.9.3, snap-0.14.0.4, snap-core-0.9.7.0, snap-server-0.9.5.1, stm-2.4.4, stm-chans-3.0.0.3, streaming-commons-0.1.12.1, stringsearch-0.3.6.6, syb-0.4.4, tagged-0.8.0.1, text-1.2.1.1, tf-random-0.5, transformers-base-0.4.4, transformers-compat-0.4.0.4, unix-compat-0.4.1.4, unix-time-0.3.5, unordered-containers-0.2.5.1, vault-0.3.0.4, vector-algorithms-0.7, void-0.7, wai-3.0.2.3, wai-extra-3.0.7.1, wai-logger-2.2.4, warp-3.0.13.1, word8-0.1.2, xmlhtml-0.2.3.4, yesod-core-1.4.9.1, zlib-0.5.4.2, zlib-bindings-0.1.1.5, zlib-enum-0.2.3.1
All dependencies unpacked
auto-update-0.1.2.1: configure
logict-0.6.0.2: configure
auto-update-0.1.2.1: build
regex-base-0.93.2: configure
logict-0.6.0.2: build
auto-update-0.1.2.1: install
zlib-0.5.4.2: configure
regex-base-0.93.2: build
monad-loops-0.4.2.1: configure
zlib-0.5.4.2: build
syb-0.4.4: configure
appar-0.1.4: configure
logict-0.6.0.2: install
monad-loops-0.4.2.1: build
regex-base-0.93.2: install
network-2.6.1.0: configure
syb-0.4.4: build
monad-loops-0.4.2.1: install
appar-0.1.4: build
zlib-0.5.4.2: install
bytestring-builder-0.10.6.0.0: configure
network-2.6.1.0: build
appar-0.1.4: install
directory-tree-0.12.0: configure
bytestring-builder-0.10.6.0.0: build
bytestring-builder-0.10.6.0.0: install
mmorph-1.0.4: configure
directory-tree-0.12.0: build
syb-0.4.4: install
cereal-0.4.1.1: configure
mmorph-1.0.4: build
ansi-terminal-0.6.2.1: configure
parallel-3.2.0.6: configure
directory-tree-0.12.0: install
cereal-0.4.1.1: build
mmorph-1.0.4: install
ansi-terminal-0.6.2.1: build
HUnit-1.2.5.2: configure
silently-1.2.4.1: configure
mwc-random-0.13.3.2: configure
BoundedChan-1.0.3.0: configure
parallel-3.2.0.6: build
ansi-terminal-0.6.2.1: install
byteable-0.1.1: configure
parallel-3.2.0.6: install
silently-1.2.4.1: build
prelude-extras-0.4: configure
easy-file-0.2.1: configure
silently-1.2.4.1: install
BoundedChan-1.0.3.0: build
tf-random-0.5: configure
network-2.6.1.0: install
HUnit-1.2.5.2: build
word8-0.1.2: configure
BoundedChan-1.0.3.0: install
byteable-0.1.1: build
setenv-0.1.1.3: configure
byteable-0.1.1: install
easy-file-0.2.1: build
setenv-0.1.1.3: build
setenv-0.1.1.3: install
HUnit-1.2.5.2: install
unix-compat-0.4.1.4: configure
tf-random-0.5: build
cereal-0.4.1.1: install
prelude-extras-0.4: build
word8-0.1.2: build
easy-file-0.2.1: install
mwc-random-0.13.3.2: build
word8-0.1.2: install
base64-bytestring-1.0.0.1: configure
entropy-0.3.6: configure
prelude-extras-0.4: install
unix-compat-0.4.1.4: build
bytestring-mmap-0.2.2: configure
tf-random-0.5: install
base64-bytestring-1.0.0.1: build
bytestring-lexing-0.4.3.2: configure
unix-compat-0.4.1.4: install
entropy-0.3.6: build
bytestring-mmap-0.2.2: build
base64-bytestring-1.0.0.1: install
byteorder-1.0.4: configure
bytestring-lexing-0.4.3.2: build
entropy-0.3.6: install
bytestring-mmap-0.2.2: install
reflection-1.5.2.1: configure
byteorder-1.0.4: build
stm-2.4.4: configure
transformers-compat-0.4.0.4: configure
byteorder-1.0.4: install
reflection-1.5.2.1: build
text-1.2.1.1: configure
unix-time-0.3.5: configure
reflection-1.5.2.1: install
stm-2.4.4: build
map-syntax-0.2: configure
safe-0.3.9: configure
nats-1: configure
stm-2.4.4: install
unix-time-0.3.5: build
transformers-compat-0.4.0.4: build
transformers-compat-0.4.0.4: install
text-1.2.1.1: build
unix-time-0.3.5: install
monads-tf-0.1.0.2: configure
stringsearch-0.3.6.6: configure
tagged-0.8.0.1: configure
nats-1: build
nats-1: install
regex-posix-0.95.2: configure
safe-0.3.9: build
bytestring-lexing-0.4.3.2: install
map-syntax-0.2: build
safe-0.3.9: install
zlib-bindings-0.1.1.5: configure
map-syntax-0.2: install
monads-tf-0.1.0.2: build
securemem-0.1.7: configure
cryptohash-0.11.6: configure
regex-posix-0.95.2: build
monads-tf-0.1.0.2: install
tagged-0.8.0.1: build
mwc-random-0.13.3.2: install
simple-sendfile-0.2.20: configure
QuickCheck-2.8.1: configure
iproute-1.4.0: configure
tagged-0.8.0.1: install
stringsearch-0.3.6.6: build
exceptions-0.8.0.2: configure
simple-sendfile-0.2.20: build
regex-posix-0.95.2: install
stm-chans-3.0.0.3: configure
zlib-bindings-0.1.1.5: build
simple-sendfile-0.2.20: install
MonadRandom-0.3.0.2: configure
transformers-base-0.4.4: configure
zlib-bindings-0.1.1.5: install
securemem-0.1.7: build
iproute-1.4.0: build
securemem-0.1.7: install
transformers-base-0.4.4: build
transformers-base-0.4.4: install
cryptohash-0.11.6: build
iproute-1.4.0: install
StateVar-1.1.0.0: configure
stringsearch-0.3.6.6: install
exceptions-0.8.0.2: build
MonadRandom-0.3.0.2: build
exceptions-0.8.0.2: install
crypto-api-0.13.2: configure
MonadRandom-0.3.0.2: install
stm-chans-3.0.0.3: build
QuickCheck-2.8.1: build
stm-chans-3.0.0.3: install
MonadCatchIO-transformers-0.3.1.3: configure
vector-algorithms-0.7: configure
cryptohash-0.11.6: install
crypto-random-0.0.9: configure
crypto-api-0.13.2: build
MonadCatchIO-transformers-0.3.1.3: build
MonadCatchIO-transformers-0.3.1.3: install
distributive-0.4.4: configure
monad-control-1.0.0.4: configure
pwstore-fast-2.4.4: configure
crypto-cipher-types-0.0.9: configure
vector-algorithms-0.7: build
crypto-api-0.13.2: install
StateVar-1.1.0.0: build
StateVar-1.1.0.0: install
crypto-random-0.0.9: build
QuickCheck-2.8.1: install
distributive-0.4.4: build
crypto-random-0.0.9: install
pwstore-fast-2.4.4: build
distributive-0.4.4: install
alex-3.1.4: configure
pwstore-fast-2.4.4: install
monad-control-1.0.0.4: build
crypto-cipher-types-0.0.9: build
monad-control-1.0.0.4: install
skein-1.0.9.3: configure
crypto-cipher-types-0.0.9: install
lifted-base-0.2.3.6: configure
alex-3.1.4: build
cipher-aes-0.2.10: configure
skein-1.0.9.3: build
skein-1.0.9.3: install
lifted-base-0.2.3.6: build
alex-3.1.4: install
cipher-aes-0.2.10: build
lifted-base-0.2.3.6: install
resourcet-1.1.5: configure
resourcet-1.1.5: build
cipher-aes-0.2.10: install
cprng-aes-0.6.1: configure
cprng-aes-0.6.1: build
resourcet-1.1.5: install
conduit-1.2.4.2: configure
cprng-aes-0.6.1: install
clientsession-0.9.1.1: configure
conduit-1.2.4.2: build
clientsession-0.9.1.1: build
clientsession-0.9.1.1: install
text-1.2.1.1: install
hashable-1.2.3.2: configure
path-pieces-0.2.0: configure
hashable-1.2.3.2: build
fast-logger-2.3.1: configure
safecopy-0.8.5: configure
blaze-builder-0.4.0.1: configure
hashable-1.2.3.2: install
fast-logger-2.3.1: build
enumerator-0.4.20: configure
path-pieces-0.2.0: build
conduit-1.2.4.2: install
resource-pool-0.2.3.2: configure
fast-logger-2.3.1: install
safecopy-0.8.5: build
case-insensitive-1.2.0.4: configure
path-pieces-0.2.0: install
resource-pool-0.2.3.2: build
unordered-containers-0.2.5.1: configure
scientific-0.3.3.8: configure
enumerator-0.4.20: build
resource-pool-0.2.3.2: install
case-insensitive-1.2.0.4: build
case-insensitive-1.2.0.4: install
blaze-builder-0.4.0.1: build
blaze-builder-0.4.0.1: install
blaze-markup-0.7.0.2: configure
safecopy-0.8.5: install
scientific-0.3.3.8: build
unordered-containers-0.2.5.1: build
enumerator-0.4.20: install
cookie-0.4.1.5: configure
vector-algorithms-0.7: install
http-types-0.8.6: configure
cookie-0.4.1.5: build
streaming-commons-0.1.12.1: configure
cookie-0.4.1.5: build: ERROR
Stdout was:
Building cookie-0.4.1.5...
Preprocessing library cookie-0.4.1.5...
[1 of 1] Compiling Web.Cookie       ( Web/Cookie.hs, dist/build/Web/Cookie.o )

Stderr was:

/tmp/stack-unpack5218/cookie-0.4.1.5/Setup.lhs:4:3: Warning:
    Module ‘System.Cmd’ is deprecated: Use "System.Process" instead

Web/Cookie.hs:38:1: Warning:
    The import of ‘Data.Monoid’ is redundant
      except perhaps to import instances from ‘Data.Monoid’
    To import instances alone, use: import Data.Monoid()

Web/Cookie.hs:88:18: Warning:
    In the use of ‘S.breakByte’ (imported from Data.ByteString):
    Deprecated: "It is an internal function and should never have been exported. Use 'break (== x)' instead. (There are rewrite rules that handle this special case of 'break'.)"

Web/Cookie.hs:200:21: Warning:
    In the use of ‘parseTime’
    (imported from Data.Time, but defined in time-1.5.0.1:Data.Time.Format.Parse):
    Deprecated: "use "parseTimeM True" instead"

Web/Cookie.hs:54:8:
    Could not find module ‘Data.Default.Class’
    Perhaps you haven't installed the profiling libraries for package ‘data-default-class-0.0.1@datad_9ouboI9uirTF3xjV57lONw’?
    Use -v to see a list of the files searched for.

stack: Error when running Shake build system:
* /tmp/stack-unpack5218/cookie-0.4.1.5/dist/stack.gen
Process exited with ExitFailure 1: /usr/bin/runghc-7.10.1 -package=Cabal-1.22.2.0 -clear-package-db -global-package-db /tmp/stack-unpack5218/cookie-0.4.1.5/Setup.lhs build

The result of the command you asked for:

$ stack exec -- ghc-pkg list data-default-class
/usr/lib/ghc-7.10.1/package.conf.d/
   data-default-class-0.0.1
/home/felipe/.stack/snapshots/x86_64-linux/nightly-2015-05-29/7.10.1/pkgdb/

So it is a stack bug after all!

DanBurton commented 9 years ago

Indeed. Stack should be putting it in that second database, $HOME/.stack/snapshots/x86_64-linux/nightly-2015-05-29/7.10.1/pkgdb/, not pulling it from the other one.

DanBurton commented 9 years ago

Things should start working if you are willing to ghc-pkg unregister data-default-class, as well as unregistering any other packages that get in the way. But this is a stack bug regardless.

meteficha commented 9 years ago

BTW, I never install packages globally from cabal, this is coming from an official Arch package:

$ pacman -Qo /usr/lib/ghc-7.10.1/site-local/data-default-class-0.0.1
/usr/lib/ghc-7.10.1/site-local/data-default-class-0.0.1/ is owned by haskell-data-default-class 0.0.1-6
$ pacman -Si haskell-data-default-class
Repository     : community
Name           : haskell-data-default-class
Version        : 0.0.1-6
Description    : A class for types with a default value
Architecture   : x86_64
URL            : http://hackage.haskell.org/package/data-default-class
Licenses       : custom:BSD3
Groups         : None
Provides       : None
Depends On     : ghc=7.10.1
Optional Deps  : None
Conflicts With : None
Replaces       : None
Download Size  :  25.79 KiB
Installed Size :  50.00 KiB
Packager       : Jelle van der Waa <jelle@vdwaa.nl>
Build Date     : Mon Mar 30 15:17:54 2015
Validated By   : MD5 Sum  SHA256 Sum  Signature

It was installed as a transitive dependency to xmonad. I think I'll wait for the fix before breaking my xmonad, though :).

DanBurton commented 9 years ago

A more palatable workaround: try adding data-default-class-0.0.1 to your extra-deps. This should force stack to install it to your project package database, which trumps the snapshot and global databases.

My nightly-2015-05-29 build finished successfully. I added the following to extra-deps, the first I did manually, and then the rest were suggested by stack since they depend on it.

  - data-default-class-0.0.1
  - cookie-0.4.1.5
  - data-default-0.5.3
  - 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
  - wai-extra-3.0.7.1
  - yesod-core-1.4.9.1

This also built successfully for me. (However, it didn't rebuild the project itself, which I believe is a separate bug.)

meteficha commented 9 years ago

Thanks for filling the other issues, @DanBurton.

I've added the lines you suggested (yesodweb/serversession@34f55d5), however I still can't build it:

$ stack build 
Downloading data-default-0.5.3
Downloading data-default-instances-base-0.0.1
Downloading data-default-instances-dlist-0.0.1
Downloading data-default-instances-containers-0.0.1
Downloading data-default-class-0.0.1
Downloading data-default-instances-old-locale-0.0.1
Installing dependencies: adjunctions-4.2.1, aeson-0.8.0.2, attoparsec-0.12.1.6, attoparsec-enumerator-0.3.4, bifunctors-4.2.1, blaze-builder-enumerator-0.2.1.0, blaze-html-0.8.0.2, blaze-markup-0.7.0.2, comonad-4.2.6, conduit-extra-1.1.9, configurator-0.3.0.0, contravariant-1.3.1.1, either-4.3.4, errors-1.4.7, free-4.11, hedis-0.6.5, heist-0.14.1, http-date-0.0.6.1, http-types-0.8.6, kan-extensions-4.2.2, lens-4.9.1, monad-logger-0.3.13.1, persistent-2.1.5, persistent-template-2.1.3.3, profunctors-4.4.1, scientific-0.3.3.8, semigroupoids-4.3, semigroups-0.16.2.2, shakespeare-2.0.5, snap-0.14.0.4, snap-core-0.9.7.0, snap-server-0.9.5.1, streaming-commons-0.1.12.1, unordered-containers-0.2.5.1, vault-0.3.0.4, void-0.7, wai-3.0.2.3, wai-logger-2.2.4, warp-3.0.13.1, xmlhtml-0.2.3.4
All dependencies unpacked
blaze-markup-0.7.0.2: configure
unordered-containers-0.2.5.1: configure
blaze-markup-0.7.0.2: build
scientific-0.3.3.8: configure
unordered-containers-0.2.5.1: build
streaming-commons-0.1.12.1: configure
scientific-0.3.3.8: build
http-types-0.8.6: configure
http-types-0.8.6: build
blaze-markup-0.7.0.2: install
streaming-commons-0.1.12.1: build
blaze-html-0.8.0.2: configure
http-types-0.8.6: install
blaze-html-0.8.0.2: build
scientific-0.3.3.8: install
attoparsec-0.12.1.6: configure
attoparsec-0.12.1.6: build
unordered-containers-0.2.5.1: install
semigroups-0.16.2.2: configure
vault-0.3.0.4: configure
semigroups-0.16.2.2: build
streaming-commons-0.1.12.1: install
vault-0.3.0.4: build
vault-0.3.0.4: install
blaze-builder-enumerator-0.2.1.0: configure
wai-3.0.2.3: configure
blaze-builder-enumerator-0.2.1.0: build
blaze-builder-enumerator-0.2.1.0: install
wai-3.0.2.3: build
wai-3.0.2.3: install
wai-logger-2.2.4: configure
semigroups-0.16.2.2: install
wai-logger-2.2.4: build
void-0.7: configure
void-0.7: build
void-0.7: install
contravariant-1.3.1.1: configure
wai-logger-2.2.4: install
contravariant-1.3.1.1: build
blaze-html-0.8.0.2: install
xmlhtml-0.2.3.4: configure
xmlhtml-0.2.3.4: build
contravariant-1.3.1.1: install
comonad-4.2.6: configure
comonad-4.2.6: build
xmlhtml-0.2.3.4: build: ERROR
Stdout was:
Building xmlhtml-0.2.3.4...
Preprocessing library xmlhtml-0.2.3.4...
[ 1 of 10] Compiling Text.XmlHtml.HTML.Meta ( src/Text/XmlHtml/HTML/Meta.hs, dist/build/Text/XmlHtml/HTML/Meta.o )
[ 2 of 10] Compiling Text.XmlHtml.Common ( src/Text/XmlHtml/Common.hs, dist/build/Text/XmlHtml/Common.o )
[ 3 of 10] Compiling Text.XmlHtml.TextParser ( src/Text/XmlHtml/TextParser.hs, dist/build/Text/XmlHtml/TextParser.o )

Stderr was:

src/Text/XmlHtml/HTML/Meta.hs:13:1: Warning:
    The import of ‘Data.Monoid’ is redundant
      except perhaps to import instances from ‘Data.Monoid’
    To import instances alone, use: import Data.Monoid()

src/Text/XmlHtml/TextParser.hs:74:48:
    Couldn't match expected type ‘text-1.2.0.4:Data.Text.Internal.Text’
                with actual type ‘Text’
    NB: ‘text-1.2.0.4:Data.Text.Internal.Text’
          is defined in ‘Data.Text.Internal’ in package ‘text-1.2.0.4’
        ‘Text’ is defined in ‘Data.Text.Internal’ in package ‘text-1.2.1.1’
    In the third argument of ‘P.parse’, namely ‘t’
    In the second argument of ‘inLeft’, namely ‘(P.parse p src t)’

stack: Error when running Shake build system:
* /tmp/stack-unpack25052/snap-0.14.0.4/dist/stack.gen
* /tmp/stack-unpack25052/snap-0.14.0.4/dist/setup-config
* /tmp/stack-unpack25052/xmlhtml-0.2.3.4/dist/stack.gen
Process exited with ExitFailure 1: /usr/bin/runghc-7.10.1 -package=Cabal-1.22.2.0 -clear-package-db -global-package-db /tmp/stack-unpack25052/xmlhtml-0.2.3.4/Setup.hs build
$ stack exec -- ghc-pkg list text
/usr/lib/ghc-7.10.1/package.conf.d/
   text-1.2.0.4
/home/felipe/.stack/snapshots/x86_64-linux/nightly-2015-05-29/7.10.1/pkgdb/
   text-1.2.1.1

Oh, boy :(.

DanBurton commented 9 years ago

Another other workaround: hide your ghc from the path, and then use stack setup to install ghc-7.10. That ghc will be configured with a different global database, which should again avoid this issue. From there you just have to figure out how to expose your existing ghc to serve xmonad's needs, while hiding it to serve stack's needs.

@snoyberg I think this issue is an argument in favor of not picking up the user's already-installed ghc unless the user explicitly asks for that.

meteficha commented 9 years ago

As someone who has no idea how to achieve what I'm saying, I'd prefer using the already-installed GHC while not using its packages (save from that list of packages that has to come from GHC). It's not fun downloading GHC again and wasting the disk space.

meteficha commented 9 years ago

I'm going to try lts-2.10 plus stack setup.

DanBurton commented 9 years ago

Oh my is right. Stack should not be allowing two versions of text in the same project.

I won't suggest adding text to the extra-deps, because at that point you'll need to add pretty much everything else to extra-deps.

As someone who has no idea how to achieve what I'm saying, I'd prefer using the already-installed GHC while not using its packages (save from that list of packages that has to come from GHC).

This is definitely supposed to be something that stack does for you automatically. To be clear, I'm only suggesting workarounds so that you can still try out stack as it exists today.

DanBurton commented 9 years ago

I would not recommend lts-2.10 plus stack setup. I tried it myself, and had to add a huge number of extra-deps, because something requires a newer time than is in the snapshot. Feel free to try though, if you don't mind.

DanBurton commented 9 years ago

Oh, that's not why I was stopped trying to use lts-2.10 with the serversession repo. It was because I ran into #123.

meteficha commented 9 years ago

Thanks for the heads-up, I think I'll wait some more before trying stack again against serversession.

meteficha commented 9 years ago

BTW, if you have already finished distilling this newbie issue into workable issues, feel free to close it.

DanBurton commented 9 years ago

Sounds good. I think I've gleaned all the relevant action items into issues.

DanBurton commented 9 years ago

This is valuable feedback. Thanks!