bravit / hid-examples

Examples to accompany the book "Haskell in Depth"
BSD 3-Clause "New" or "Revised" License
257 stars 93 forks source link

Doesn't build on Linux with Stack #17

Closed xodiqus closed 1 year ago

xodiqus commented 1 year ago

Trying to build: $ stack build

   Error: [S-7282]
   Stack failed to execute the build plan.

   While executing the build plan, Stack encountered the following errors:

   [S-7011]
   While building package streaming-utils-0.2.1.0 (scroll up to its section
   to see the error) using:
   /home/xodiqus/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_SvXsv1f__3.2.1.0_ghc-8.10.7 --verbose=1 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0 configure --with-ghc=/home/xodiqus/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7/bin/ghc-8.10.7 --with-ghc-pkg=/home/xodiqus/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7/bin/ghc-pkg-8.10.7 --user --package-db=clear --package-db=global --package-db=/home/xodiqus/.stack/snapshots/x86_64-linux-tinfo6/643cd9fed3fa515e293793015f5dec796a167f11c8c345f1bf81c2662ed90b39/8.10.7/pkgdb --libdir=/home/xodiqus/.stack/snapshots/x86_64-linux-tinfo6/643cd9fed3fa515e293793015f5dec796a167f11c8c345f1bf81c2662ed90b39/8.10.7/lib --bindir=/home/xodiqus/.stack/snapshots/x86_64-linux-tinfo6/643cd9fed3fa515e293793015f5dec796a167f11c8c345f1bf81c2662ed90b39/8.10.7/bin --datadir=/home/xodiqus/.stack/snapshots/x86_64-linux-tinfo6/643cd9fed3fa515e293793015f5dec796a167f11c8c345f1bf81c2662ed90b39/8.10.7/share --libexecdir=/home/xodiqus/.stack/snapshots/x86_64-linux-tinfo6/643cd9fed3fa515e293793015f5dec796a167f11c8c345f1bf81c2662ed90b39/8.10.7/libexec --sysconfdir=/home/xodiqus/.stack/snapshots/x86_64-linux-tinfo6/643cd9fed3fa515e293793015f5dec796a167f11c8c345f1bf81c2662ed90b39/8.10.7/etc --docdir=/home/xodiqus/.stack/snapshots/x86_64-linux-tinfo6/643cd9fed3fa515e293793015f5dec796a167f11c8c345f1bf81c2662ed90b39/8.10.7/doc/streaming-utils-0.2.1.0 --htmldir=/home/xodiqus/.stack/snapshots/x86_64-linux-tinfo6/643cd9fed3fa515e293793015f5dec796a167f11c8c345f1bf81c2662ed90b39/8.10.7/doc/streaming-utils-0.2.1.0 --haddockdir=/home/xodiqus/.stack/snapshots/x86_64-linux-tinfo6/643cd9fed3fa515e293793015f5dec796a167f11c8c345f1bf81c2662ed90b39/8.10.7/doc/streaming-utils-0.2.1.0 --dependency=aeson=aeson-1.5.6.0-DkwLMaMFAoKEbTeMR8x6ex --dependency=attoparsec=attoparsec-0.13.2.5-8izDPW0DwnMA1uBRNCYnOn --dependency=base=base-4.14.3.0 --dependency=bytestring=bytestring-0.10.12.0 --dependency=http-client=http-client-0.6.4.1-L2WcCX1S6G93IdjWhCRWqB --dependency=http-client-tls=http-client-tls-0.3.5.3-HTIy4TwCUHGEAIs303kndw --dependency=json-stream=json-stream-0.4.2.4-GP7H9k6ydGpFhkWpAV7fhV --dependency=mtl=mtl-2.2.2 --dependency=network=network-3.1.1.1-3xFSBe7XCrO7SWRn35NgL3 --dependency=network-simple=network-simple-0.4.5-H8Jo56Izwck74qgHRp8fkL --dependency=pipes=pipes-4.3.16-Ae9yuHIGpRS6XXQM8QsguE --dependency=resourcet=resourcet-1.2.4.3-EZpbKEiS8a8G4IXFok6D1M --dependency=streaming=streaming-0.2.3.1-CtrX5s6nvJ7aJwf6Heg8A --dependency=streaming-bytestring=streaming-bytestring-0.2.1-I9SmIejUQYt8JNbBT9Ypd9 --dependency=streaming-commons=streaming-commons-0.2.2.3-AQIpgNlfUfQ17AfvJCMo3o --dependency=transformers=transformers-0.5.6.2 --exact-configuration --ghc-option=-fhide-source-paths
   Process exited with code: ExitFailure 1 

What am I doing wrong? Thanks for any help.

Stack: Version 2.9.3, Git revision 6cf638947a863f49857f9cfbf72a38a48b183e7e x86_64 hpack-0.35.1 Ubuntu: 22.04.

Vjust commented 1 year ago

Does not build with ghc 9.x It’s a typical issue with books/authors. This is a reflection of the code quality in the book, that it is so un-portable.

bravit commented 1 year ago

Hi @xodiqus and @Vjust! I've updated all the examples. Both stack and cabal builds with recent GHC versions should work now.