From 8f499cec4148da2295f214bac44fe6a2ed8eea55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Tue, 30 Mar 2021 10:58:50 +0800 Subject: [PATCH 01/10] Shuffle around TH lines, since ghc-9 seems to have stricter staging rules --- lsp-types/lsp-types.cabal | 2 +- lsp-types/src/Language/LSP/Types/Method.hs | 3 ++- lsp-types/src/Language/LSP/Types/TextDocument.hs | 4 ++-- lsp-types/src/Language/LSP/Types/WatchedFiles.hs | 5 ++--- lsp/lsp.cabal | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lsp-types/lsp-types.cabal b/lsp-types/lsp-types.cabal index 36a383c3e..550207436 100644 --- a/lsp-types/lsp-types.cabal +++ b/lsp-types/lsp-types.cabal @@ -69,7 +69,7 @@ library , Language.LSP.Types.WorkspaceSymbol -- other-extensions: ghc-options: -Wall - build-depends: base >= 4.11 && < 4.15 + build-depends: base >= 4.11 && < 4.16 , aeson >=1.2.2.0 , binary , bytestring diff --git a/lsp-types/src/Language/LSP/Types/Method.hs b/lsp-types/src/Language/LSP/Types/Method.hs index 89462f5a4..90897283c 100644 --- a/lsp-types/src/Language/LSP/Types/Method.hs +++ b/lsp-types/src/Language/LSP/Types/Method.hs @@ -312,7 +312,6 @@ instance A.FromJSON SomeServerMethod where parseJSON _ = fail "SomeServerMethod" -- instance FromJSON (SMethod m) -makeSingletonFromJSON 'SomeMethod ''SMethod -- --------------------------------------------------------------------- -- TO JSON @@ -396,3 +395,5 @@ instance A.ToJSON (SMethod m) where toJSON SCancelRequest = A.String "$/cancelRequest" -- Custom toJSON (SCustomMethod m) = A.String m + +makeSingletonFromJSON 'SomeMethod ''SMethod diff --git a/lsp-types/src/Language/LSP/Types/TextDocument.hs b/lsp-types/src/Language/LSP/Types/TextDocument.hs index 465377a7a..b3d7d051b 100644 --- a/lsp-types/src/Language/LSP/Types/TextDocument.hs +++ b/lsp-types/src/Language/LSP/Types/TextDocument.hs @@ -84,6 +84,7 @@ data SaveOptions = { -- | The client is supposed to include the content on save. _includeText :: Maybe Bool } deriving (Show, Read, Eq) +deriveJSON lspOptions ''SaveOptions -- ------------------------------------- @@ -107,7 +108,7 @@ instance FromJSON TextDocumentSyncKind where parseJSON (Number 1) = pure TdSyncFull parseJSON (Number 2) = pure TdSyncIncremental parseJSON _ = fail "TextDocumentSyncKind" - + data TextDocumentSyncOptions = TextDocumentSyncOptions { -- | Open and close notifications are sent to the server. If omitted open @@ -234,7 +235,6 @@ deriveJSON lspOptions ''WillSaveTextDocumentParams -- ------------------------------------- -deriveJSON lspOptions ''SaveOptions makeExtendingDatatype "TextDocumentSaveRegistrationOptions" [''TextDocumentRegistrationOptions] diff --git a/lsp-types/src/Language/LSP/Types/WatchedFiles.hs b/lsp-types/src/Language/LSP/Types/WatchedFiles.hs index 74d265266..38a16bf6d 100644 --- a/lsp-types/src/Language/LSP/Types/WatchedFiles.hs +++ b/lsp-types/src/Language/LSP/Types/WatchedFiles.hs @@ -2,7 +2,7 @@ {-# LANGUAGE DuplicateRecordFields #-} module Language.LSP.Types.WatchedFiles where - + import Data.Aeson import Data.Aeson.TH import Data.Bits @@ -71,9 +71,8 @@ instance FromJSON WatchKind where | otherwise = fail "WatchKind" parseJSON _ = fail "WatchKind" -deriveJSON lspOptions ''DidChangeWatchedFilesRegistrationOptions deriveJSON lspOptions ''FileSystemWatcher - +deriveJSON lspOptions ''DidChangeWatchedFilesRegistrationOptions -- | The file event type. data FileChangeType = FcCreated -- ^ The file got created. | FcChanged -- ^ The file got changed. diff --git a/lsp/lsp.cabal b/lsp/lsp.cabal index fc32418ab..acde98280 100644 --- a/lsp/lsp.cabal +++ b/lsp/lsp.cabal @@ -31,7 +31,7 @@ library , Language.LSP.Server.Control , Language.LSP.Server.Processing ghc-options: -Wall - build-depends: base >= 4.11 && < 4.15 + build-depends: base >= 4.11 && < 4.16 , async , aeson >=1.0.0.0 , attoparsec From 02dc1267d474a18b90ce04d947cc3f7e912f12f7 Mon Sep 17 00:00:00 2001 From: jneira Date: Wed, 10 Feb 2021 13:29:04 +0100 Subject: [PATCH 02/10] Bump up base upper bound --- lsp-test/func-test/func-test.cabal | 2 +- lsp/lsp.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lsp-test/func-test/func-test.cabal b/lsp-test/func-test/func-test.cabal index 9a6004a08..6de8229ee 100644 --- a/lsp-test/func-test/func-test.cabal +++ b/lsp-test/func-test/func-test.cabal @@ -6,7 +6,7 @@ build-type: Simple test-suite func-test main-is: FuncTest.hs type: exitcode-stdio-1.0 - build-depends: base <4.15 + build-depends: base <4.16 , lsp-test , lsp , data-default diff --git a/lsp/lsp.cabal b/lsp/lsp.cabal index acde98280..9869cfd8f 100644 --- a/lsp/lsp.cabal +++ b/lsp/lsp.cabal @@ -69,7 +69,7 @@ executable lsp-demo-reactor-server default-language: Haskell2010 ghc-options: -Wall -Wno-unticked-promoted-constructors - build-depends: base >= 4.11 && < 4.15 + build-depends: base >= 4.11 && < 4.16 , aeson , bytestring , containers From 349994be8453a2cfbbfeb89fe05232dc5354f052 Mon Sep 17 00:00:00 2001 From: jneira Date: Wed, 10 Feb 2021 13:29:32 +0100 Subject: [PATCH 03/10] Add allow-newer to find a build plan --- cabal.project | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/cabal.project b/cabal.project index e56cd6fdf..c51bc7e0d 100644 --- a/cabal.project +++ b/cabal.project @@ -14,4 +14,24 @@ haddock-quickjump: True constraints: some == 1.0.1, dependent-sum == 0.7.1.0 -max-backjumps: 10000 \ No newline at end of file +max-backjumps: 10000 + +allow-newer: + lens:template-haskell, + parallel:base, + hashable:base, + async:base, + quickcheck-instances:base, + time-compat:base, + these:base, + assoc:base, + cryptohash-sha1:base, + cryptohash-md5:base, + split:base, + constraints-extras:base, + constraints-extras:template-haskell, + dependent-sum:some, + hslogger:base, + entropy:Cabal, + lens:Cabal + From dd285bd8a63119279a718cc2a7da66daa74e9c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Tue, 30 Mar 2021 12:09:25 +0800 Subject: [PATCH 04/10] Bump forgotten base constraints --- lsp-test/lsp-test.cabal | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lsp-test/lsp-test.cabal b/lsp-test/lsp-test.cabal index 900340a74..3b8ada544 100644 --- a/lsp-test/lsp-test.cabal +++ b/lsp-test/lsp-test.cabal @@ -5,7 +5,7 @@ description: A test framework for writing tests against . @Language.LSP.Test@ launches your server as a subprocess and allows you to simulate a session - down to the wire. + down to the wire. To see examples of it in action, check out , and . @@ -98,7 +98,7 @@ test-suite func-test main-is: FuncTest.hs hs-source-dirs: func-test type: exitcode-stdio-1.0 - build-depends: base <4.15 + build-depends: base <4.16 , lsp-test , lsp , data-default @@ -109,7 +109,7 @@ test-suite func-test , async default-language: Haskell2010 -test-suite example +test-suite example main-is: Test.hs hs-source-dirs: example type: exitcode-stdio-1.0 @@ -123,7 +123,7 @@ benchmark simple-bench main-is: SimpleBench.hs hs-source-dirs: bench type: exitcode-stdio-1.0 - build-depends: base <4.15 + build-depends: base <4.16 , lsp-test , lsp , process From b24be2717a1457181ff910ed309cf1e600b48e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Tue, 30 Mar 2021 12:12:12 +0800 Subject: [PATCH 05/10] Add ghc-9.0.1 to github workflows --- .github/workflows/haskell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 35220f924..cf25c2a68 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - ghc: ['8.10.4', '8.8.3', '8.6.5', '8.4.4'] + ghc: ['9.0.1', '8.10.4', '8.8.3', '8.6.5', '8.4.4'] os: [ubuntu-latest, macOS-latest, windows-latest] exclude: - os: windows-latest From 42386370d84fd053f1227ca5ec0c4bda9725afd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Tue, 30 Mar 2021 13:31:12 +0800 Subject: [PATCH 06/10] github actions: Use cabal 3.4 --- .github/workflows/haskell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index cf25c2a68..edf77668f 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -20,7 +20,7 @@ jobs: - uses: haskell/actions/setup@v1 with: ghc-version: ${{ matrix.ghc }} - cabal-version: '3.2' + cabal-version: '3.4' - name: Cache uses: actions/cache@v1 From 42e366259528d5afe783d6265228794a278e349c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Tue, 30 Mar 2021 15:02:35 +0800 Subject: [PATCH 07/10] Add the required upstream patches to cabal.project These should be removed once the fixes are merged --- cabal.project | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cabal.project b/cabal.project index c51bc7e0d..81f6c16f0 100644 --- a/cabal.project +++ b/cabal.project @@ -35,3 +35,16 @@ allow-newer: entropy:Cabal, lens:Cabal +-- Required for ghc-9.0.1 support +source-repository-package + type: git + location: https://github.com/anka-213/th-extras + tag: 57a97b4df128eb7b360e8ab9c5759392de8d1659 +-- https://github.com/mokus0/th-extras/pull/8 + +source-repository-package + type: git + location: https://github.com/anka-213/dependent-sum + tag: 8cf4c7fbc3bfa2be475a17bb7c94a1e1e9a830b5 + subdir: dependent-sum-template +-- https://github.com/obsidiansystems/dependent-sum/pull/57 From 3a03634b70fd3339e210f94337910ceae0aba95a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Tue, 30 Mar 2021 15:30:22 +0800 Subject: [PATCH 08/10] Remove unneeded "allow-newer" --- cabal.project | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/cabal.project b/cabal.project index 81f6c16f0..25fe40144 100644 --- a/cabal.project +++ b/cabal.project @@ -18,22 +18,10 @@ max-backjumps: 10000 allow-newer: lens:template-haskell, - parallel:base, - hashable:base, - async:base, - quickcheck-instances:base, - time-compat:base, - these:base, - assoc:base, cryptohash-sha1:base, cryptohash-md5:base, - split:base, - constraints-extras:base, - constraints-extras:template-haskell, - dependent-sum:some, hslogger:base, entropy:Cabal, - lens:Cabal -- Required for ghc-9.0.1 support source-repository-package From 84a1fea67c802c1381e3c52cf7cb2c4598ff5d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Wed, 31 Mar 2021 15:54:22 +0800 Subject: [PATCH 09/10] Run cabal update on ci --- .github/workflows/haskell.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index edf77668f..828f12ec8 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -34,6 +34,8 @@ jobs: ${{ runner.os }}-build- ${{ runner.os }}- + - name: Cabal update + run: cabal update - name: Build run: cabal build all - name: Test From e96383ab19534128f12acc70a69fbc15d4f298cc Mon Sep 17 00:00:00 2001 From: jneira Date: Wed, 2 Jun 2021 23:09:52 +0200 Subject: [PATCH 10/10] Remove unnecessary constraints --- cabal.project | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cabal.project b/cabal.project index 25fe40144..aa854048e 100644 --- a/cabal.project +++ b/cabal.project @@ -11,11 +11,6 @@ benchmarks: True test-show-details: direct haddock-quickjump: True -constraints: some == 1.0.1, - dependent-sum == 0.7.1.0 - -max-backjumps: 10000 - allow-newer: lens:template-haskell, cryptohash-sha1:base,