simonmichael/hledger

`stack8.10.yaml`, build failure `NonEmpty` does not export `singleton`

Closed this issue · 3 comments

When checking the builds with each of the stack projects, with each stack*.yaml, I see that one of them doesn't build:

$ stack build --test --no-run-tests --bench --no-run-benchmarks --stack-yaml=stack8.10.yaml
         
hledger-lib> Test running disabled by --no-run-tests flag.
hledger    > configure (lib + exe + test)
hledger    > Configuring hledger-1.33.99...
hledger    > build (lib + exe + test) with ghc-8.10.7
hledger    > Preprocessing library for hledger-1.33.99..
hledger    > Building library for hledger-1.33.99..
hledger    > [ 4 of 38] Compiling Hledger.Cli.CliOptions
hledger    >         
hledger    > /home/philderbeast/dev/src/updo/hledger-upstream/hledger/Hledger/Cli/CliOptions.hs:85:80: error:
hledger    >     Module ‘Data.List.NonEmpty’ does not export ‘singleton’
hledger    >    |    
hledger    > 85 | import qualified Data.List.NonEmpty as NE (NonEmpty, fromList, head, nonEmpty, singleton)
hledger    >    |                                                                                ^^^^^^^^^
hledger    >         
Progress 2/6         

Error: [S-7282]
       Stack failed to execute the build plan.
       
       While executing the build plan, Stack encountered the error:
       
       [S-7011]
       While building package hledger-1.33.99 (scroll up to its section to see the error) using:
       ~/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_6HauvNHV_3.2.1.0_ghc-8.10.7 --verbose=1 --builddir=.stack-work/dist/x86_64-linux/ghc-8.10.7 build lib:hledger exe:hledger test:unittest --ghc-options " -fdiagnostics-color=always"
       Process exited with code: ExitFailure 1
$ git rev-parse HEAD
176a45b12a6c2c165b9f51ff8ab883d47a546a21

$ stack --version
Version 2.15.5, Git revision 5649cc6b2522f51f0fc5543154b0fff868f9af31 x86_64 hpack-0.36.0

Thanks for the report!

I see Data.List.NonEmpty.singleton was added in ghc 9.0. The cheapest fix would be to drop support for ghc 8.10. How would you feel about that ?

I have fixed it, and set up a github workflow to test with our oldest supported GHC version when needed.

Fixed it in master, that is. Preventing compilation failure for people installing hledger 1.33 from Hackage with cabal and ghc 8.10, requires a bugfix release, or waiting for the major release due next month, or adding a hackage revision on the 1.33 packages disallowing ghc 8.10 temporarily. I did the latter.