yogsototh / yblog

Hakyll powered blog for yannesposito.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"stack build" encounter errors

luckypoem opened this issue · comments

hi.

root@AR:/usr/local/yblog# stack build
it shows:
...
-- While building package wai-app-static-3.1.6.1 using:
/root/.stack/setup-exe-cache/i386-linux/Cabal-simple_mPHDZzAJ_1.24.0.0_ghc-8.0.1 --builddir=.stack-work/dist/i386-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/logs/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/Cabal-1.24.0.0/build/WaiAppStatic/Types.o )
[2 of 9] Compiling Util             ( Util.hs, .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/Util.o )
[3 of 9] Compiling WaiAppStatic.Listing ( WaiAppStatic/Listing.hs, .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/WaiAppStatic/Listing.o )

/tmp/stack25346/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/stack25346/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.Filesystem ( WaiAppStatic/Storage/Filesystem.hs, .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/WaiAppStatic/Storage/Filesystem.o )
[5 of 9] Compiling WaiAppStatic.Storage.Embedded.Runtime ( WaiAppStatic/Storage/Embedded/Runtime.hs, .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/WaiAppStatic/Storage/Embedded/Runtime.o )
[6 of 9] Compiling WaiAppStatic.Storage.Embedded.TH ( WaiAppStatic/Storage/Embedded/TH.hs, .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/WaiAppStatic/Storage/Embedded/TH.o )

/tmp/stack25346/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/Cabal-1.24.0.0/build/WaiAppStatic/Storage/Embedded.o )
[8 of 9] Compiling Network.Wai.Application.Static ( Network/Wai/Application/Static.hs, .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/Network/Wai/Application/Static.o )
<command line>: can't load .so/.DLL for: /root/.stack/snapshots/i386-linux/lts-7.1/8.0.1/lib/i386-linux-ghc-8.0.1/random-1.1-54KmMHXjttlERYcr1mvsAe/libHSrandom-1.1-54KmMHXjttlERYcr1mvsAe-ghc8.0.1.so (/root/.stack/snapshots/i386-linux/lts-7.1/8.0.1/lib/i386-linux-ghc-8.0.1/random-1.1-54KmMHXjttlERYcr1mvsAe/libHSrandom-1.1-54KmMHXjttlERYcr1mvsAe-ghc8.0.1.so: undefined symbol: timezm1zi6zi0zi1_DataziTimeziClockziCTimespec_getCTimespec1_closure)

root@AR:/usr/local/yblog#

i ran "stack install wai-app-static",also i encounter the above error.
how to fix it?
thank u very much.

You should try to delete ~/.stack/snapshots but in the end it is either a stack bug or maybe you just need to install a dependency with apt-get, I just can't get which one. Perhaps you should try to change the verbosity of stack during the installation to have a better message.

Delete the contents of ~/.stack/snapshots/,then it's ok

hi.
actually there is still other issues.

root@AR:/usr/local/yblog# stack build
yblog-1.0: build (exe)
Preprocessing executable 'yblog' for yblog-1.0...
[5 of 5] Compiling Main ( site.hs, .stack-work/dist/i386-linux/Cabal -1.24.0.0/build/yblog/yblog-tmp/Main.o )

/usr/local/yblog/site.hs:144:9: error:
* Couldn't match type Item String' with [Char]'
Expected type: Compiler (Item String) -> Compiler (Compiler String)
Actual type: Compiler String -> Compiler (Compiler String)
* In the second argument of (>>=)', namely applyFilter postFilters'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
return
$ renderPandoc (fmap (preFilters (toFilePath identifier)) body) }
>>= applyFilter postFilters'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
return
$ renderPandoc (fmap (preFilters (toFilePath identifier)) body) }
>>= applyFilter postFilters
>>= loadAndApplyTemplate "templates/default.html" yContext'

/usr/local/yblog/site.hs:145:9: error:
* Couldn't match type Compiler String' with Item String'
Expected type: Compiler String -> Compiler (Item String)
Actual type: Item String -> Compiler (Item String)
* In the second argument of (>>=)', namely loadAndApplyTemplate "templates/default.html" yContext'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
return
$ renderPandoc (fmap (preFilters (toFilePath identifier)) body) }
>>= applyFilter postFilters
>>= loadAndApplyTemplate "templates/default.html" yContext'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
return
$ renderPandoc (fmap (preFilters (toFilePath identifier)) body) }
>>= applyFilter postFilters
>>= loadAndApplyTemplate "templates/default.html" yContext
>>= loadAndApplyTemplate "templates/boilerplate.html" yContext'

/usr/local/yblog/site.hs:157:9: error:
* Couldn't match type Item String' with [Char]'
Expected type: Compiler (Item String) -> Compiler (Compiler String)
Actual type: Compiler String -> Compiler (Compiler String)
* In the second argument of (>>=)', namely applyFilter postFilters'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
return
$ renderPandoc (fmap (preFilters (toFilePath identifier)) body) }
>>= applyFilter postFilters'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
return
$ renderPandoc (fmap (preFilters (toFilePath identifier)) body) }
>>= applyFilter postFilters
>>= loadAndApplyTemplate "templates/default.html" yContext'

/usr/local/yblog/site.hs:158:9: error:
* Couldn't match type Compiler String' with Item String'
Expected type: Compiler String -> Compiler (Item String)
Actual type: Item String -> Compiler (Item String)
* In the second argument of (>>=)', namely loadAndApplyTemplate "templates/default.html" yContext'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
return
$ renderPandoc (fmap (preFilters (toFilePath identifier)) body) }
>>= applyFilter postFilters
>>= loadAndApplyTemplate "templates/default.html" yContext'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
return
$ renderPandoc (fmap (preFilters (toFilePath identifier)) body) }
>>= applyFilter postFilters
>>= loadAndApplyTemplate "templates/default.html" yContext
>>= loadAndApplyTemplate "templates/boilerplate.html" yContext'

/usr/local/yblog/site.hs:176:9: error:
* Couldn't match type Item String' with [Char]'
Expected type: Compiler (Item String) -> Compiler (Compiler String)
Actual type: Compiler String -> Compiler (Compiler String)
* In the second argument of (>>=)', namely applyFilter postFilters'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
prefilteredText <- return
$ (fmap (preFilters (toFilePath identifier)) bo dy);
return $ renderPandoc prefilteredText }
>>= applyFilter postFilters'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
prefilteredText <- return
$ (fmap (preFilters (toFilePath identifier)) bo dy);
return $ renderPandoc prefilteredText }
>>= applyFilter postFilters
>>= saveSnapshot "content"'

/usr/local/yblog/site.hs:177:9: error:
* Couldn't match type Compiler String' with Item String'
Expected type: Compiler String -> Compiler (Item String)
Actual type: Item String -> Compiler (Item String)
* In the second argument of (>>=)', namely saveSnapshot "content"'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
prefilteredText <- return
$ (fmap (preFilters (toFilePath identifier)) bo dy);
return $ renderPandoc prefilteredText }
>>= applyFilter postFilters
>>= saveSnapshot "content"'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
prefilteredText <- return
$ (fmap (preFilters (toFilePath identifier)) bo dy);
return $ renderPandoc prefilteredText }
>>= applyFilter postFilters
>>= saveSnapshot "content"
>>= loadAndApplyTemplate "templates/post.html" yContext'

/usr/local/yblog/site.hs:191:9: error:
* Couldn't match type Item String' with [Char]'
Expected type: Compiler (Item String) -> Compiler (Compiler String)
Actual type: Compiler String -> Compiler (Compiler String)
* In the second argument of (>>=)', namely applyFilter postFilters'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
return
$ renderPandoc (fmap (preFilters (toFilePath identifier)) body) }
>>= applyFilter postFilters'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
return
$ renderPandoc (fmap (preFilters (toFilePath identifier)) body) }
>>= applyFilter postFilters
>>= loadAndApplyTemplate "templates/archive.html" archiveCtx'

/usr/local/yblog/site.hs:192:9: error:
* Couldn't match type Compiler String' with Item String'
Expected type: Compiler String -> Compiler (Item String)
Actual type: Item String -> Compiler (Item String)
* In the second argument of (>>=)', namely loadAndApplyTemplate "templates/archive.html" archiveCtx'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
return
$ renderPandoc (fmap (preFilters (toFilePath identifier)) body) }
>>= applyFilter postFilters
>>= loadAndApplyTemplate "templates/archive.html" archiveCtx'
In the first argument of (>>=)', namely do { body <- getResourceBody;
identifier <- getUnderlying;
return
$ renderPandoc (fmap (preFilters (toFilePath identifier)) body) }
>>= applyFilter postFilters
>>= loadAndApplyTemplate "templates/archive.html" archiveCtx
>>= loadAndApplyTemplate "templates/default.html" archiveCtx'

-- While building package yblog-1.0 using:
/root/.stack/setup-exe-cache/i386-linux/Cabal-simple_mPHDZzAJ_1.24.0.0_ghc -8.0.1 --builddir=.stack-work/dist/i386-linux/Cabal-1.24.0.0 build exe:yblog --g hc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
root@AR:/usr/local/yblog#

how to fix them??
thank u very much.

This is very strange, I can compile on a Mac. Can you try to use:

stack --no-system-ghc build

If you encounter this kind of error again, it can be a nice bug use case for the stack team.