cdepillabout / pretty-simple

pretty-printer for Haskell data types that have a Show instance
https://hackage.haskell.org/package/pretty-simple
BSD 3-Clause "New" or "Revised" License
243 stars 29 forks source link

Fix build with GHC-7.10.3 #55

Closed sjakobi closed 4 years ago

sjakobi commented 4 years ago

Previously I would see the following build failure:

$ cabal-3.0 build -w ghc-7.10.3
Resolving dependencies...
Build profile: -w ghc-7.10.3 -O1
In order, the following will be built (use -v for more details):
 - pretty-simple-3.1.0.0 (lib:pretty-simple) (first run)
Warning: pretty-simple.cabal: Ignoring unknown section type: custom-setup
Configuring pretty-simple-3.1.0.0...
setup: At least the following dependencies are missing:
aeson -any, bytestring -any, optparse-applicative -any

https://github.com/haskell/cabal/issues/3881 seems related but I don't fully understand the issue.

cdepillabout commented 4 years ago

@sjakobi Thanks for this fix.

pretty-simple isn't officially supported on GHC < 8.0, but this is a very simple change, so I'll merge it in!

In case anyone else runs into this, here is the error you get when trying to build with ghc-7.10.3 (and cabal-install 3.0.0.0):

$ cabal new-build
Resolving dependencies...
Build profile: -w ghc-7.10.3 -O1
In order, the following will be built (use -v for more details):
 - ansi-terminal-0.10.2 (lib) (requires download & build)
 - cabal-doctest-1.0.8 (lib) (requires download & build)
 - pretty-simple-3.1.1.0 (lib:pretty-simple) (first run)
Downloading  ansi-terminal-0.10.2
Downloaded   ansi-terminal-0.10.2
Downloading  cabal-doctest-1.0.8
Starting     ansi-terminal-0.10.2 (lib)
Downloaded   cabal-doctest-1.0.8
Starting     cabal-doctest-1.0.8 (lib)
Building     ansi-terminal-0.10.2 (lib)
Building     cabal-doctest-1.0.8 (lib)
Installing   cabal-doctest-1.0.8 (lib)
Completed    cabal-doctest-1.0.8 (lib)
Installing   ansi-terminal-0.10.2 (lib)
Completed    ansi-terminal-0.10.2 (lib)
[1 of 1] Compiling Main             ( /home/illabout/git/pretty-simple/dist-newstyle/build/x86_64-linux/ghc-7.10.3/pretty-simple-3.1.1.0/setup/setup.hs, /home/illabout/git/pretty-simple/dist-newstyle/build/x86_64-linux/ghc-7.10.3/pretty-simple-3.1.1.0/setup/Main.o ) [Distribution.Extra.Doctest changed]
Linking /home/illabout/git/pretty-simple/dist-newstyle/build/x86_64-linux/ghc-7.10.3/pretty-simple-3.1.1.0/setup/setup ...
Warning: pretty-simple.cabal: Ignoring unknown section type: custom-setup
Configuring pretty-simple-3.1.1.0...
setup: At least the following dependencies are missing:
aeson -any, bytestring -any, optparse-applicative -any
sjakobi commented 4 years ago

pretty-simple isn't officially supported on GHC < 8.0

Oh, I wasn't aware! The bound on base seemed to indicate that GHC-7.10 is supported.

I'm using pPrintNoColor in dhall, which does support GHC-7.10. It would be nice if pretty-simple would continue to work for that!

cdepillabout commented 4 years ago

@sjakobi I rebased this on top of master (5f5af768) and merged into master (8930d26a5).

Thanks! Released to Hackage:

http://hackage.haskell.org/package/pretty-simple-3.1.1.0

sjakobi commented 4 years ago

Thank you! :)

cdepillabout commented 4 years ago

The bound on base seemed to indicate that GHC-7.10 is supported.

Ah, thanks. Maybe I should bump the bound at some point.

Although I guess pretty-simple is, well... simple enough that supporting old GHCs isn't too much work.