我运行stack install wai-app-static,会遇到如下的错误。
root@AR:/usr/local# stack install wai-app-static
wai-app-static-3.1.6.1: configure
wai-app-static-3.1.6.1: build
-- While building package wai-app-static-3.1.6.1 using:
/root/.stack/setup-exe-cache/i386-linux/Cabal-simple_mPHDZzA
J_1.24.0.0_ghc-8.0.1 --builddir=.stack-work/dist/i3 86-linux/Cabal-1.24.0.0 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: /usr/local/yblog/.stack-work/l ogs/wai-app-static-3.1.6.1.log
Configuring wai-app-static-3.1.6.1...
Building wai-app-static-3.1.6.1...
Preprocessing library wai-app-static-3.1.6.1...
[1 of 9] Compiling WaiAppStatic.Types ( WaiAppStatic/Types.hs, .stack-work/dist/i386-linux/Ca bal-1.24.0.0/build/WaiAppStati c/Types.o )
[2 of 9] Compiling Util ( Util.hs, .stack-work/dist/i386-linux/Ca bal-1.24.0.0/build/Util.o )
[3 of 9] Compiling WaiAppStatic.Listing ( WaiAppStatic/Listing.hs, .stack-work/dist/i386-linux/Ca bal-1.24.0.0/build/WaiAppStati c/Listing.o )
/tmp/stack21583/wai-app-static -3.1.6.1/WaiAppStatic/Listing. hs:67:34: warning: [-Wname-shadowing]
This binding for ‘pieces’ shadows the existing binding
bound at WaiAppStatic/Listing.hs:27:16
/tmp/stack21583/wai-app-static -3.1.6.1/WaiAppStatic/Listing. hs:120:24: warning: [-Wunused-local-binds]
Defined but not used: ‘isFile’
[4 of 9] Compiling WaiAppStatic.Storage.Filesyste m ( WaiAppStatic/Storage/Filesyste m.hs, .stack-work/dist/i386-linux/Ca bal-1.24.0.0/build/WaiAppStati c/Storage/Filesystem.o )
[5 of 9] Compiling WaiAppStatic.Storage.Embedded. Runtime ( WaiAppStatic/Storage/Embedded/ Runtime.hs, .stack-work/dist/i386-linux/Ca bal-1.24.0.0/build/WaiAppStati c/Storage/Embedded/Runtime.o )
[6 of 9] Compiling WaiAppStatic.Storage.Embedded. TH ( WaiAppStatic/Storage/Embedded/ TH.hs, .stack-work/dist/i386-linux/Ca bal-1.24.0.0/build/WaiAppStati c/Storage/Embedded/TH.o )
/tmp/stack21583/wai-app-static -3.1.6.1/WaiAppStatic/Storage/ Embedded/TH.hs:10:1: warning: [-Wunused-imports]
The import of ‘Control.Applicative’ is redundant
except perhaps to import instances from ‘Control.Applicative’
To import instances alone, use: import Control.Applicative()
[7 of 9] Compiling WaiAppStatic.Storage.Embedded ( WaiAppStatic/Storage/Embedded. hs, .stack-work/dist/i386-linux/Ca bal-1.24.0.0/build/WaiAppStati c/Storage/Embedded.o )
[8 of 9] Compiling Network.Wai.Application.Static ( Network/Wai/Application/Static .hs, .stack-work/dist/i386-linux/Ca bal-1.24.0.0/build/Network/Wai /Application/Static.o )
<command line>: can't load .so/.DLL for: /root/.stack/snapshots/i386-li nux/lts-7.1/8.0.1/lib/i386-lin ux-ghc-8.0.1/random-1.1-54KmMH XjttlERYcr1mvsAe/libHSrandom-1 .1-54KmMHXjttlERYcr1mvsAe-ghc8 .0.1.so (/root/.stack/snapshots/i386-l inux/lts-7.1/8.0.1/lib/i386-li nux-ghc-8.0.1/random-1.1-54KmM HXjttlERYcr1mvsAe/libHSrandom- 1.1-54KmMHXjttlERYcr1mvsAe-ghc 8.0.1.so: undefined symbol: timezm1zi6zi0zi1_DataziTimeziC lockziCTimespec_getCTimespec1_ closure)
root@AR:/usr/local#
root@AR:/usr/local# stack install wai-app-static
wai-app-static-3.1.6.1: configure
wai-app-static-3.1.6.1: build
-- While building package wai-app-static-3.1.6.1 using:
/root/.stack/setup-exe-cache/i386-linux/Cabal-simple_mPHDZzA
Process exited with code: ExitFailure 1
Logs have been written to: /usr/local/yblog/.stack-work/l
Configuring wai-app-static-3.1.6.1...
Building wai-app-static-3.1.6.1...
Preprocessing library wai-app-static-3.1.6.1...
[1 of 9] Compiling WaiAppStatic.Types ( WaiAppStatic/Types.hs, .stack-work/dist/i386-linux/Ca
[2 of 9] Compiling Util ( Util.hs, .stack-work/dist/i386-linux/Ca
[3 of 9] Compiling WaiAppStatic.Listing ( WaiAppStatic/Listing.hs, .stack-work/dist/i386-linux/Ca
/tmp/stack21583/wai-app-static
This binding for ‘pieces’ shadows the existing binding
bound at WaiAppStatic/Listing.hs:27:16
/tmp/stack21583/wai-app-static
Defined but not used: ‘isFile’
[4 of 9] Compiling WaiAppStatic.Storage.Filesyste
[5 of 9] Compiling WaiAppStatic.Storage.Embedded.
[6 of 9] Compiling WaiAppStatic.Storage.Embedded.
/tmp/stack21583/wai-app-static
The import of ‘Control.Applicative’ is redundant
except perhaps to import instances from ‘Control.Applicative’
To import instances alone, use: import Control.Applicative()
[7 of 9] Compiling WaiAppStatic.Storage.Embedded ( WaiAppStatic/Storage/Embedded.
[8 of 9] Compiling Network.Wai.Application.Static ( Network/Wai/Application/Static
<command line>: can't load .so/.DLL for: /root/.stack/snapshots/i386-li
root@AR:/usr/local#
解决办法:
很简单:
rm -rf /root/.stack/snapshots/i386-linux/*
( rm -rf /root/.stack/snapshots/x86_64-linux/*)
再次运行stack install wai-app-static就不会遇错了。