commercialhaskell / stack

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

Custom BuildType fails with ghc-resolver. #1574

Closed mageshb closed 8 years ago

mageshb commented 8 years ago

We got an the error while building executable-hash pkg with ghc resolver. We tested this in stack 0.1.10.1 and 1.0.0. In our setup, all the package mentioned in the extra-deps are taken from lts-3.5. We are able build the same package when the resolver is set to lts-3.5. Also when buildtype is set to Simple, we were able to build with ghc resolver

Following stack.yaml can be added to unpacked executable-hash package to reproduce the following error System/Executable/Hash/Internal.hs:9:18: Could not find module ‘Crypto.Hash.SHA1’ Use -v to see a list of the files searched for.

System/Executable/Hash/Internal.hs:11:18: Could not find module ‘Data.FileEmbed’ Use -v to see a list of the files searched for.

stack.yaml

flags:
  text:
    integer-simple: false
  time-locale-compat:
    old-locale: false
packages:
- '.'
extra-deps:
 - byteable-0.1.1
 - cryptohash-0.11.6
 - executable-path-0.0.3
 - file-embed-0.0.9
 - text-1.2.1.3
 - old-locale-1.0.0.7
 - time-locale-compat-0.1.1.0

resolver: ghc-7.10.2
luigy commented 8 years ago

when building custom setup file it doesnt get passed the same package-dbs available to a regular pkg build, but this can be overwritten by adding this section to your stack.yaml

explicit-setup-deps:
  executable-hash: true 
mgsloan commented 8 years ago

Yup, @luigy's solution should do it. This is an unfortunate result of:

Re-open if still an issue.

mageshb commented 8 years ago

It is working fine after I added the suggested change. Thank you