From 6225ac8a2224507e4ad5df27a39d261e149c5c33 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 30 Sep 2024 07:16:09 -1000 Subject: [PATCH] imp!: support ghc 9.10 / base 4.20 When built with ghc 9.10.1, hledger error messages are displayed with an extra newline following them. https://gitlab.haskell.org/ghc/ghc/-/issues/25116 --- hledger-lib/package.yaml | 2 +- hledger-ui/Hledger/UI/UIUtils.hs | 4 +-- hledger-ui/package.yaml | 4 +-- hledger-web/package.yaml | 2 +- hledger/package.yaml | 2 +- stack9.10.yaml | 53 ++++++++++++++++++++++++++++++++ 6 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 stack9.10.yaml diff --git a/hledger-lib/package.yaml b/hledger-lib/package.yaml index a5fb95d54..ff4c4bdc2 100644 --- a/hledger-lib/package.yaml +++ b/hledger-lib/package.yaml @@ -39,7 +39,7 @@ extra-source-files: #data-files: dependencies: -- base >=4.14 && <4.20 +- base >=4.14 && <4.21 - base-compat - aeson >=1 && <2.3 - aeson-pretty diff --git a/hledger-ui/Hledger/UI/UIUtils.hs b/hledger-ui/Hledger/UI/UIUtils.hs index 25af4cbe4..285239fbb 100644 --- a/hledger-ui/Hledger/UI/UIUtils.hs +++ b/hledger-ui/Hledger/UI/UIUtils.hs @@ -379,7 +379,7 @@ withBorderAttr attr = updateAttrMap (applyAttrMappings [(attrName "border", attr -- | Scroll a list's viewport so that the selected item is centered in the -- middle of the display area. -scrollSelectionToMiddle :: List Name item -> EventM Name UIState () +scrollSelectionToMiddle :: Brick.Widgets.List.List Name item -> EventM Name UIState () scrollSelectionToMiddle list = do case list^.listSelectedL of Nothing -> return () @@ -429,7 +429,7 @@ reportSpecSetFutureAndForecast fcast rspec = -- Vertically scroll the named list's viewport with the given number of non-empty items -- by the given positive or negative number of items (usually 1 or -1). -- The selection will be moved when necessary to keep it visible and allow the scroll. -listScrollPushingSelection :: Name -> Int -> Int -> EventM Name (List Name item) (GenericList Name Vector item) +listScrollPushingSelection :: Name -> Int -> Int -> EventM Name (Brick.Widgets.List.List Name item) (GenericList Name Vector item) listScrollPushingSelection name listheight scrollamt = do list <- get viewportScroll name `vScrollBy` scrollamt diff --git a/hledger-ui/package.yaml b/hledger-ui/package.yaml index 6aa276750..b7ca44267 100644 --- a/hledger-ui/package.yaml +++ b/hledger-ui/package.yaml @@ -53,7 +53,7 @@ ghc-options: - -Wno-unused-do-bind dependencies: -- base >=4.14 && <4.20 +- base >=4.14 && <4.21 when: - condition: (flag(ghcdebug)) @@ -125,7 +125,7 @@ executables: source-dirs: app main: hledger-ui.hs dependencies: - - base >=4.14 && <4.20 + - base >=4.14 && <4.21 - hledger-ui when: - condition: flag(threaded) diff --git a/hledger-web/package.yaml b/hledger-web/package.yaml index 760373300..56a61fd27 100644 --- a/hledger-web/package.yaml +++ b/hledger-web/package.yaml @@ -86,7 +86,7 @@ when: - ghc-debug-stub >=0.6.0.0 && <0.7 dependencies: -- base >=4.14 && <4.20 +- base >=4.14 && <4.21 library: source-dirs: . diff --git a/hledger/package.yaml b/hledger/package.yaml index 7c80d1378..becd774e8 100644 --- a/hledger/package.yaml +++ b/hledger/package.yaml @@ -115,7 +115,7 @@ ghc-options: - -optP-Wno-nonportable-include-path dependencies: -- base >=4.14 && <4.20 +- base >=4.14 && <4.21 - hledger-lib >=1.40.99 && <1.41 - aeson >=1 && <2.3 - ansi-terminal >=0.9 diff --git a/stack9.10.yaml b/stack9.10.yaml new file mode 100644 index 000000000..3b1d0d83e --- /dev/null +++ b/stack9.10.yaml @@ -0,0 +1,53 @@ +# stack build plan using GHC 9.10.1 +# https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.10 +# https://downloads.haskell.org/ghc/9.10.1/docs/users_guide/9.10.1-notes.html + +resolver: nightly-2024-09-26 +compiler: ghc-9.10.1 +notify-if-ghc-untested: false +notify-if-cabal-untested: false + +packages: +- hledger-lib +- hledger +- hledger-ui +- hledger-web + +extra-deps: +# for hledger-lib +- Cabal-3.12.0.0 +- Cabal-syntax-3.12.0.0 +- directory-1.3.8.3@rev:3 +- filepath-1.4.300.2 +#- filepath-1.5.3.0 # not accepted for hledger-lib for some reason +- ghc-boot-9.10.1@rev:1 +- process-1.6.24.0 +- unix-2.8.5.1 +# for hledger +- haskeline-0.8.2.1 +# for dev builds, needed only when the ghcdebug flag is enabled: +- ghc-debug-convention-0.6.0.0 +- ghc-debug-stub-0.6.0.0 + +nix: + pure: false + packages: [perl gmp ncurses zlib] + +# ghc-options: +# "$locals": -Wno-x-partial +# "$locals": -fplugin Debug.Breakpoint + +# # for precise profiling, per https://www.tweag.io/posts/2020-01-30-haskell-profiling.html: +# # apply-ghc-options: everything +# # rebuild-ghc-options: true +# # stack build --profile --ghc-options="-fno-prof-auto" + +# # tell GHC to write hie files, eg for weeder. Rumoured to be slow. +# # ghc-options: +# # "$locals": -fwrite-ide-info + +# # ghc-options: +# # "$locals": -ddump-timings +# # "$targets": -Werror +# # "$everything": -O2 +# # some-package: -DSOME_CPP_FLAG