build fail of commercialhaskell.com with stack build on mac os x sierra
Hi,
git clone (commit dfe55e97ed86567aafca2e5f3c19096e2a4cb50f - Sep 20th 2016) of commercialhaskell.com from github:
```
https://github.com/commercialhaskell/commercialhaskell.com.git
```
follow instructions from that repo exactly for os x (stacksetup installed ghc-7.10.2, but i have seen similar issue with 8):
```
$ brew install icu4c
Add the following to your ~/.stack/stack.yaml:
extra-include-dirs:
- /usr/local/opt/icu4c/include
extra-lib-dirs:
- /usr/local/opt/icu4c/lib
Now:
$ stack build
```
Hit one minor issue in build process with icu4c, resolving with following stack build:
```
stack build --extra-lib-dirs=/usr/local/opt/icu4c/lib --extra-include-dirs=/usr/local/opt/icu4c/include
```
reach build of yesod-auth, with a failure:
```
yesod-auth-1.4.6: configure
yesod-auth-1.4.6: build
texmath-0.8.2.2: copy/register
Progress: 35/38
-- While building package yesod-auth-1.4.6 using:
/Users/stephen/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.22.4.0-ghc-7.10.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: /Users/stephen/Documents/github/commercialhaskell.com/.stack-work/logs/yesod-auth-1.4.6.log
Configuring yesod-auth-1.4.6...
Building yesod-auth-1.4.6...
Preprocessing library yesod-auth-1.4.6...
[ 1 of 11] Compiling Yesod.PasswordStore ( Yesod/PasswordStore.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Yesod/PasswordStore.o )
/private/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/stack49268/yesod-auth-1.4.6/Yesod/PasswordStore.hs:166:31: Warning:
Defaulting the following constraint(s) to type ‘Integer’
(Integral b0)
arising from a use of ‘^’ at Yesod/PasswordStore.hs:166:31
(Num b0)
arising from the literal ‘32’ at Yesod/PasswordStore.hs:166:32-33
In the first argument of ‘(-)’, namely ‘2 ^ 32’
In the first argument of ‘(*)’, namely ‘(2 ^ 32 - 1)’
In the second argument of ‘(>)’, namely ‘(2 ^ 32 - 1) * hLen’
/private/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/stack49268/yesod-auth-1.4.6/Yesod/PasswordStore.hs:419:1: Warning:
Defined but not used: ‘toStrict’
/private/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/stack49268/yesod-auth-1.4.6/Yesod/PasswordStore.hs:422:1: Warning:
Defined but not used: ‘fromStrict’
[ 2 of 11] Compiling Yesod.Auth.Message ( Yesod/Auth/Message.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Yesod/Auth/Message.o )
/private/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/stack49268/yesod-auth-1.4.6/Yesod/Auth/Message.hs:22: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()
[ 3 of 11] Compiling Yesod.Auth.Routes ( Yesod/Auth/Routes.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Yesod/Auth/Routes.o )
[ 4 of 11] Compiling Yesod.Auth ( Yesod/Auth.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Yesod/Auth.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.10.2 for x86_64-apple-darwin):
Loading temp shared object failed: dlopen(/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/ghc64990_0/libghc_21.dylib, 5): no suitable image found. Did find:
/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/ghc64990_0/libghc_21.dylib: malformed mach-o: load commands size (34176) > 32768
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
So reporting.... I've seen the same error attempting to brew install haskell-stack on sierra betas 3 and 4, but on those occasions, an issue with libghc_44.dylib causing the problem.
```
[ 4 of 87] Compiling System.Process.Read ( src/System/Process/Read.hs, dist/dist-sandbox-558713ad/build/System/Process/Read.o )
ghc: panic! (the 'impossible' happened)
(GHC version 8.0.1 for x86_64-apple-darwin):
Loading temp shared object failed: dlopen(/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/ghc67839_0/libghc_44.dylib, 5): no suitable image found. Did find:
/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/ghc67839_0/libghc_44.dylib: malformed mach-o: load commands size (40560) > 32768
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
stack version:
```
Version 1.1.2, Git revision cebe10e845fed4420b6224d97dcabf20477bbd4b (3646 commits) x86_64 hpack-0.14.0
```
stack exec env returns:
```
stack exec env
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.tEAdTiAWFI/Render
GHC_PACKAGE_PATH=/Users/stephen/Documents/github/commercialhaskell.com/.stack-work/install/x86_64-osx/lts-3.0/7.10.2/pkgdb:/Users/stephen/.stack/snapshots/x86_64-osx/lts-3.0/7.10.2/pkgdb:/Users/stephen/.stack/programs/x86_64-osx/ghc-7.10.2/lib/ghc-7.10.2/package.conf.d
HASKELL_DIST_DIR=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0
HASKELL_PACKAGE_SANDBOX=/Users/stephen/.stack/snapshots/x86_64-osx/lts-3.0/7.10.2/pkgdb
HASKELL_PACKAGE_SANDBOXES=/Users/stephen/Documents/github/commercialhaskell.com/.stack-work/install/x86_64-osx/lts-3.0/7.10.2/pkgdb:/Users/stephen/.stack/snapshots/x86_64-osx/lts-3.0/7.10.2/pkgdb:
HOME=/Users/stephen
LANG=en_IE.UTF-8
LOGNAME=stephen
NAME=Stephen Barrett
OLDPWD=/Users/stephen/Documents/github
PATH=/Users/stephen/Documents/github/commercialhaskell.com/.stack-work/install/x86_64-osx/lts-3.0/7.10.2/bin:/Users/stephen/.stack/snapshots/x86_64-osx/lts-3.0/7.10.2/bin:/Users/stephen/.stack/programs/x86_64-osx/ghc-7.10.2/bin:/Users/stephen/Library/Haskell/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
PWD=/Users/stephen/Documents/github/commercialhaskell.com
SECURITYSESSIONID=186a6
SHELL=/bin/bash
SHLVL=1
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.RTM6V8Lo2y/Listeners
STACK_EXE=/Library/Haskell/ghc-8.0.1-x86_64/bin/stack
TERM=xterm-256color
TERM_PROGRAM=Apple_Terminal
TERM_PROGRAM_VERSION=377
TERM_SESSION_ID=020844C9-1E8A-410E-8892-43DC0C5A8C0B
TMPDIR=/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/
USER=stephen
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
_=/usr/local/bin/stack
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x6C
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------- |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | Unknown/Multiple |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"build fail of commercialhaskell.com with stack build on mac os x sierra beta 4","status":"New","operating_system":"Unknown/Multiple","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Hi,\r\n\r\ngit clone (commit dfe55e97ed86567aafca2e5f3c19096e2a4cb50f - Sep 20th 2016) of commercialhaskell.com from github: \r\n\r\n{{{\r\nhttps://github.com/commercialhaskell/commercialhaskell.com.git\r\n}}}\r\n\r\nfollow instructions from that repo exactly for os x (stacksetup installed ghc-7.10.2, but i have seen similar issue with 8):\r\n\r\n{{{\r\n$ brew install icu4c\r\nAdd the following to your ~/.stack/stack.yaml:\r\n\r\n extra-include-dirs:\r\n - /usr/local/opt/icu4c/include\r\n extra-lib-dirs:\r\n - /usr/local/opt/icu4c/lib\r\nNow:\r\n\r\n $ stack build\r\n}}}\r\n\r\nHit one minor issue in build process with icu4c, resolving with following stack build:\r\n\r\n{{{\r\nstack build --extra-lib-dirs=/usr/local/opt/icu4c/lib --extra-include-dirs=/usr/local/opt/icu4c/include\r\n}}}\r\n\r\nreach build of yesod-auth, with a failure:\r\n\r\n\r\n{{{\r\n\r\nyesod-auth-1.4.6: configure\r\nyesod-auth-1.4.6: build\r\ntexmath-0.8.2.2: copy/register\r\nProgress: 35/38\r\n-- While building package yesod-auth-1.4.6 using:\r\n /Users/stephen/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.22.4.0-ghc-7.10.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0 build --ghc-options \" -ddump-hi -ddump-to-file\"\r\n Process exited with code: ExitFailure 1\r\n Logs have been written to: /Users/stephen/Documents/github/commercialhaskell.com/.stack-work/logs/yesod-auth-1.4.6.log\r\n\r\n Configuring yesod-auth-1.4.6...\r\n Building yesod-auth-1.4.6...\r\n Preprocessing library yesod-auth-1.4.6...\r\n [ 1 of 11] Compiling Yesod.PasswordStore ( Yesod/PasswordStore.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Yesod/PasswordStore.o )\r\n \r\n /private/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/stack49268/yesod-auth-1.4.6/Yesod/PasswordStore.hs:166:31: Warning:\r\n Defaulting the following constraint(s) to type ‘Integer’\r\n (Integral b0)\r\n arising from a use of ‘^’ at Yesod/PasswordStore.hs:166:31\r\n (Num b0)\r\n arising from the literal ‘32’ at Yesod/PasswordStore.hs:166:32-33\r\n In the first argument of ‘(-)’, namely ‘2 ^ 32’\r\n In the first argument of ‘(*)’, namely ‘(2 ^ 32 - 1)’\r\n In the second argument of ‘(>)’, namely ‘(2 ^ 32 - 1) * hLen’\r\n \r\n /private/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/stack49268/yesod-auth-1.4.6/Yesod/PasswordStore.hs:419:1: Warning:\r\n Defined but not used: ‘toStrict’\r\n \r\n /private/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/stack49268/yesod-auth-1.4.6/Yesod/PasswordStore.hs:422:1: Warning:\r\n Defined but not used: ‘fromStrict’\r\n [ 2 of 11] Compiling Yesod.Auth.Message ( Yesod/Auth/Message.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Yesod/Auth/Message.o )\r\n \r\n /private/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/stack49268/yesod-auth-1.4.6/Yesod/Auth/Message.hs:22:1: Warning:\r\n The import of ‘Data.Monoid’ is redundant\r\n except perhaps to import instances from ‘Data.Monoid’\r\n To import instances alone, use: import Data.Monoid()\r\n [ 3 of 11] Compiling Yesod.Auth.Routes ( Yesod/Auth/Routes.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Yesod/Auth/Routes.o )\r\n [ 4 of 11] Compiling Yesod.Auth ( Yesod/Auth.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Yesod/Auth.o )\r\n ghc: panic! (the 'impossible' happened)\r\n (GHC version 7.10.2 for x86_64-apple-darwin):\r\n \tLoading temp shared object failed: dlopen(/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/ghc64990_0/libghc_21.dylib, 5): no suitable image found. Did find:\r\n \t/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/ghc64990_0/libghc_21.dylib: malformed mach-o: load commands size (34176) > 32768\r\n \r\n Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\n}}}\r\n\r\nSo reporting.... I've seen the same error attempting to brew install haskell-stack on sierra betas 3 and 4, but on those occasions, an issue with libghc_44.dylib causing the problem. \r\n\r\n{{{\r\n[ 4 of 87] Compiling System.Process.Read ( src/System/Process/Read.hs, dist/dist-sandbox-558713ad/build/System/Process/Read.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.0.1 for x86_64-apple-darwin):\r\n\tLoading temp shared object failed: dlopen(/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/ghc67839_0/libghc_44.dylib, 5): no suitable image found. Did find:\r\n\t/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/ghc67839_0/libghc_44.dylib: malformed mach-o: load commands size (40560) > 32768\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n}}}\r\n\r\nstack version:\r\n{{{\r\nVersion 1.1.2, Git revision cebe10e845fed4420b6224d97dcabf20477bbd4b (3646 commits) x86_64 hpack-0.14.0\r\n}}}\r\n\r\nstack exec env returns:\r\n{{{\r\nstack exec env\r\nApple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.tEAdTiAWFI/Render\r\nGHC_PACKAGE_PATH=/Users/stephen/Documents/github/commercialhaskell.com/.stack-work/install/x86_64-osx/lts-3.0/7.10.2/pkgdb:/Users/stephen/.stack/snapshots/x86_64-osx/lts-3.0/7.10.2/pkgdb:/Users/stephen/.stack/programs/x86_64-osx/ghc-7.10.2/lib/ghc-7.10.2/package.conf.d\r\nHASKELL_DIST_DIR=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0\r\nHASKELL_PACKAGE_SANDBOX=/Users/stephen/.stack/snapshots/x86_64-osx/lts-3.0/7.10.2/pkgdb\r\nHASKELL_PACKAGE_SANDBOXES=/Users/stephen/Documents/github/commercialhaskell.com/.stack-work/install/x86_64-osx/lts-3.0/7.10.2/pkgdb:/Users/stephen/.stack/snapshots/x86_64-osx/lts-3.0/7.10.2/pkgdb:\r\nHOME=/Users/stephen\r\nLANG=en_IE.UTF-8\r\nLOGNAME=stephen\r\nNAME=Stephen Barrett\r\nOLDPWD=/Users/stephen/Documents/github\r\nPATH=/Users/stephen/Documents/github/commercialhaskell.com/.stack-work/install/x86_64-osx/lts-3.0/7.10.2/bin:/Users/stephen/.stack/snapshots/x86_64-osx/lts-3.0/7.10.2/bin:/Users/stephen/.stack/programs/x86_64-osx/ghc-7.10.2/bin:/Users/stephen/Library/Haskell/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin\r\nPWD=/Users/stephen/Documents/github/commercialhaskell.com\r\nSECURITYSESSIONID=186a6\r\nSHELL=/bin/bash\r\nSHLVL=1\r\nSSH_AUTH_SOCK=/private/tmp/com.apple.launchd.RTM6V8Lo2y/Listeners\r\nSTACK_EXE=/Library/Haskell/ghc-8.0.1-x86_64/bin/stack\r\nTERM=xterm-256color\r\nTERM_PROGRAM=Apple_Terminal\r\nTERM_PROGRAM_VERSION=377\r\nTERM_SESSION_ID=020844C9-1E8A-410E-8892-43DC0C5A8C0B\r\nTMPDIR=/var/folders/3k/ycnfbqgx33n7qdytkl9ryx7m0000gn/T/\r\nUSER=stephen\r\nXPC_FLAGS=0x0\r\nXPC_SERVICE_NAME=0\r\n_=/usr/local/bin/stack\r\n__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x6C\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->
issue