Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"stack build" encounter errors #6

Open
luckypoem opened this issue Dec 26, 2016 · 4 comments
Open

"stack build" encounter errors #6

luckypoem opened this issue Dec 26, 2016 · 4 comments

Comments

@luckypoem
Copy link

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.

@yogsototh
Copy link
Owner

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.

@luckypoem
Copy link
Author

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

@luckypoem
Copy link
Author

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.

@yogsototh
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants