sdiehl / write-you-a-haskell

Building a modern functional compiler from first principles. (http://dev.stephendiehl.com/fun/)
MIT License
3.34k stars 256 forks source link

Can't be built with hPutBuf: resource vanished (Broken pipe) #64

Closed TorosFanny closed 9 years ago

TorosFanny commented 9 years ago

My platform: Ubuntu: 14.04 GHC: 7.8.4 cabal: 1.22.0.0 pandoc: 1.13.2 And all haskell related packages are installed with nix package manager.

When I tried to build the project, pandoc reported that pandoc: Error running filter includes.hs fd:4: hPutBuf: resource vanished (Broken pipe) make: *** [000_introduction.html] Error 83

sdiehl commented 9 years ago

Try:

$ cabal exec sh
$ make
sdiehl commented 9 years ago

Ensure that the pandoc on your path is the pandoc from the sandbox or the Nix environment. Seems to be a older version taking precedence.

TorosFanny commented 9 years ago
qs@BF:~/Programs/write-you-a-haskell$ cabal exec sh
$ make
pandoc -c css/style.css --filter includes.hs --template template.html -s -f markdown -t html --standalone --toc --toc-depth=2 --mathjax="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --highlight-style pygments -o 000_introduction.html 000_introduction.md
pandoc: Error running filter includes.hs
fd:4: hPutBuf: resource vanished (Broken pipe)
make: *** [000_introduction.html] Error 83
$ which pandoc
/home/qs/.nix-profile/bin/pandoc

I tried that. But it doesn't work.

sdiehl commented 9 years ago

Can you compile the filter?

$ cabal exec sh
$ ghc --make includes.hs
[1 of 1] Compiling Main             ( includes.hs, includes.o )
Linking includes ...
sdiehl commented 9 years ago

Travis is verifying the build on Ubuntu 12.04 at Pandoc 1.9.1 and I tested it on Ubuntu 14.04 at Pandoc 1.13.2. So not sure where the discrepancy is with your local build.

TorosFanny commented 9 years ago

Thanks, when I tried ghc --make includes.hs, it reported unable to find Text.Pandoc. Then I installed haskell-pandoc-ghc7.8.4-1.13.1-shared in nix, and build again with success.

I have no idea what's the role of includes.hs, but I wonder why didn't nix install haskell-pandoc-ghc automatically, since it's a dependence, and why pandoc didn't mention the failure was due to a lack of dependence?