From 6fbf35a086b203e93cecd5dd66f713b5032ac121 Mon Sep 17 00:00:00 2001 From: Jinnah Ali-Clarke Date: Tue, 6 Aug 2024 11:38:17 -0400 Subject: [PATCH 1/9] remove unnecessary comment --- nix/mk-shell.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/nix/mk-shell.nix b/nix/mk-shell.nix index 61dfe68c..23fffce8 100644 --- a/nix/mk-shell.nix +++ b/nix/mk-shell.nix @@ -7,7 +7,6 @@ let workaround140774 = hpkg: with pkgs.haskell.lib; overrideCabal hpkg (drv: { enableSeparateBinOutput = false; }); - # It is still necessary to run `hpack --force` into packages home dirs haskell-language-server = pkgs.haskellPackages.haskell-language-server.override { hls-ormolu-plugin = pkgs.haskellPackages.hls-ormolu-plugin.override { From 24f0d2311b30a0bb4a990ad3a1ef98b664c19c11 Mon Sep 17 00:00:00 2001 From: Jinnah Ali-Clarke Date: Tue, 6 Aug 2024 12:28:48 -0400 Subject: [PATCH 2/9] update to nixpkgs release-24.05; hls now bundles all plugins internally --- nix/mk-shell.nix | 9 +-------- nix/sources.json | 8 ++++---- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/nix/mk-shell.nix b/nix/mk-shell.nix index 23fffce8..429a8943 100644 --- a/nix/mk-shell.nix +++ b/nix/mk-shell.nix @@ -7,13 +7,6 @@ let workaround140774 = hpkg: with pkgs.haskell.lib; overrideCabal hpkg (drv: { enableSeparateBinOutput = false; }); - haskell-language-server = - pkgs.haskellPackages.haskell-language-server.override { - hls-ormolu-plugin = pkgs.haskellPackages.hls-ormolu-plugin.override { - ormolu = (workaround140774 pkgs.haskellPackages.ormolu); - }; - }; - in pkgs.mkShell { buildInputs = [ (haskellPackages.ghcWithPackages (haskellPackages: @@ -75,7 +68,7 @@ in pkgs.mkShell { pkgs.cabal-install pkgs.cachix pkgs.gnumake - haskell-language-server + pkgs.haskellPackages.haskell-language-server pkgs.haskellPackages.hpack pkgs.pcre pkgs.postgresql # for nri-postgres diff --git a/nix/sources.json b/nix/sources.json index 2654d946..588c66ab 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -12,15 +12,15 @@ "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs": { - "branch": "release-23.11", + "branch": "release-24.05", "description": "Nix Packages collection", "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a149706fa833be1b3906eaae60230e0fbfdd067d", - "sha256": "1b3nywv7idiyq3j2vz5gr3vbfh3q4v4gw2qf7vpd5sb652f36g8x", + "rev": "59be168c1fcab339bab5fd482d93c995f470cbad", + "sha256": "0am4h3ck2as4lq7b37zlxah8zqm57scjl06y5xkk9islh3jvklmf", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/a149706fa833be1b3906eaae60230e0fbfdd067d.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/59be168c1fcab339bab5fd482d93c995f470cbad.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs-unstable": { From 4fc16bee71d3430d7a7f26dc8ea62ab2015cb854 Mon Sep 17 00:00:00 2001 From: Jinnah Ali-Clarke Date: Tue, 6 Aug 2024 17:53:13 -0400 Subject: [PATCH 3/9] refactor haskell overrides, pin hw-kafka-client@4.0.3 --- nix/common-haskell-overrides.nix | 39 ++++++++++++++++++++++++++++++++ shell-ghc-9-2.nix | 29 ++---------------------- shell-ghc-9-4.nix | 30 ++---------------------- 3 files changed, 43 insertions(+), 55 deletions(-) create mode 100644 nix/common-haskell-overrides.nix diff --git a/nix/common-haskell-overrides.nix b/nix/common-haskell-overrides.nix new file mode 100644 index 00000000..fd35508c --- /dev/null +++ b/nix/common-haskell-overrides.nix @@ -0,0 +1,39 @@ +{ sources, pkgs }: +self: super: + let + packageFromSources = name: self.callCabal2nix name sources."${name}" { }; + in { + # todo: resolve breaking changes in brick >= 0.72, also jailbreak + # to allow ghc 9.4.x + brick = + pkgs.haskell.lib.doJailbreak (self.callHackage "brick" "0.71.1" { }); + + # >= 5.39 has breaking changes for brick@0.71.1; pin to 5.38 (known-good) + vty = self.callHackage "vty" "5.38" { }; + + # latest master supports ghc 9.4.x + tasty-test-reporter = packageFromSources "tasty-test-reporter"; + + # latest master supports ghc 9.4.x + string-qq = packageFromSources "string-qq"; + + # jailbreak to allow text >= 2 + pretty-diff = pkgs.haskell.lib.doJailbreak super.pretty-diff; + + # servant-auth-server 0.4.8.0 is marked as broken in nixpkgs, so jailbreak + # (known good) 0.4.7.0 to make it work + servant-auth-server = pkgs.haskell.lib.doJailbreak + (self.callHackage "servant-auth-server" "0.4.7.0" { }); + + # required by servant-auth-server@0.4.7.0 + jose = pkgs.haskell.lib.dontCheck (self.callHackage "jose" "0.9" { }); + jose-jwt = self.callHackage "jose-jwt" "0.9.5" { }; + + # servant-auth@0.4.1.0 is known-good but now complains re: jose version + # (now needs >= 0.10 but we've already used it successfully with 0.9). we + # can bypass this issue with a jailbreak + servant-auth = pkgs.haskell.lib.doJailbreak (self.callHackage "servant-auth" "0.4.1.0" { }); + + # for now, pin hw-kafka-client to 4.0.3; nixpkgs@release-24.05 provides 5.3.0 + hw-kafka-client = self.callHackage "hw-kafka-client" "4.0.3" { }; + } \ No newline at end of file diff --git a/shell-ghc-9-2.nix b/shell-ghc-9-2.nix index 4505bf10..06f5cc47 100644 --- a/shell-ghc-9-2.nix +++ b/shell-ghc-9-2.nix @@ -1,33 +1,8 @@ let sources = import ./nix/sources.nix { }; - pkgs = import sources.nixpkgs { }; + commonHaskellOverrides = import ./nix/common-haskell-overrides.nix { inherit sources pkgs; }; in import nix/mk-shell.nix { pkgs = pkgs; - haskellPackages = pkgs.haskell.packages.ghc926.extend (self: super: - let - packageFromSources = name: self.callCabal2nix name sources."${name}" { }; - in { - # todo: resolve breaking changes in brick >= 0.72 - brick = self.callHackage "brick" "0.71.1" { }; - - # tasty-test-reporter is marked as broken, get the same version we use for - # ghc 9.4 - tasty-test-reporter = packageFromSources "tasty-test-reporter"; - - hspec = - pkgs.haskell.lib.doJailbreak (self.callHackage "hspec" "2.8.5" { }); - hspec-discover = self.callHackage "hspec-discover" "2.8.5" { }; - hspec-meta = self.callHackage "hspec-meta" "2.7.8" { }; - - # servant-auth-server 0.4.8.0 is marked as broken in nixpkgs, so jailbreak - # (known good) 0.4.7.0 to make it work - servant-auth-server = pkgs.haskell.lib.doJailbreak - (self.callHackage "servant-auth-server" "0.4.7.0" { }); - servant-auth = pkgs.haskell.lib.doJailbreak super.servant-auth; - - # required by servant-auth-server@0.4.7.0 - jose = pkgs.haskell.lib.dontCheck (self.callHackage "jose" "0.9" { }); - jose-jwt = self.callHackage "jose-jwt" "0.9.5" { }; - }); + haskellPackages = pkgs.haskell.packages.ghc928.extend commonHaskellOverrides; } diff --git a/shell-ghc-9-4.nix b/shell-ghc-9-4.nix index b4b58ec9..f69d59c1 100644 --- a/shell-ghc-9-4.nix +++ b/shell-ghc-9-4.nix @@ -1,34 +1,8 @@ let sources = import ./nix/sources.nix { }; - pkgs = import sources.nixpkgs { }; + commonHaskellOverrides = import ./nix/common-haskell-overrides.nix { inherit sources pkgs; }; in import nix/mk-shell.nix { pkgs = pkgs; - haskellPackages = pkgs.haskell.packages.ghc947.extend (self: super: - let - packageFromSources = name: self.callCabal2nix name sources."${name}" { }; - in { - # todo: resolve breaking changes in brick >= 0.72, also jailbreak - # to allow ghc 9.4.x - brick = - pkgs.haskell.lib.doJailbreak (self.callHackage "brick" "0.71.1" { }); - - # latest master supports ghc 9.4.x - tasty-test-reporter = packageFromSources "tasty-test-reporter"; - - # latest master supports ghc 9.4.x - string-qq = packageFromSources "string-qq"; - - # jailbreak to allow text >= 2 - pretty-diff = pkgs.haskell.lib.doJailbreak super.pretty-diff; - - # servant-auth-server 0.4.8.0 is marked as broken in nixpkgs, so jailbreak - # (known good) 0.4.7.0 to make it work - servant-auth-server = pkgs.haskell.lib.doJailbreak - (self.callHackage "servant-auth-server" "0.4.7.0" { }); - - # required by servant-auth-server@0.4.7.0 - jose = pkgs.haskell.lib.dontCheck (self.callHackage "jose" "0.9" { }); - jose-jwt = self.callHackage "jose-jwt" "0.9.5" { }; - }); + haskellPackages = pkgs.haskell.packages.ghc948.extend commonHaskellOverrides; } From 572e760997ae4342d818b66329ca3a594fd2b4f1 Mon Sep 17 00:00:00 2001 From: Jinnah Ali-Clarke Date: Tue, 6 Aug 2024 18:01:16 -0400 Subject: [PATCH 4/9] loosen constraints to allow `resourcet-1.3.x`, `megaparsec-9.5.x`, `hedgehog-1.4.x`, `servant-0.20.x` --- nri-postgresql/CHANGELOG.md | 4 ++++ nri-postgresql/nri-postgresql.cabal | 10 +++++----- nri-postgresql/package.yaml | 4 ++-- nri-prelude/CHANGELOG.md | 1 + nri-prelude/nri-prelude.cabal | 6 +++--- nri-prelude/package.yaml | 2 +- nri-redis/CHANGELOG.md | 4 ++++ nri-redis/nri-redis.cabal | 12 ++++++------ nri-redis/package.yaml | 6 +++--- nri-test-encoding/CHANGELOG.md | 4 ++++ nri-test-encoding/nri-test-encoding.cabal | 12 ++++++------ nri-test-encoding/package.yaml | 6 +++--- 12 files changed, 42 insertions(+), 29 deletions(-) diff --git a/nri-postgresql/CHANGELOG.md b/nri-postgresql/CHANGELOG.md index 2941a36a..e707433b 100644 --- a/nri-postgresql/CHANGELOG.md +++ b/nri-postgresql/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.2.0.1 + +- Allow `resourcet-1.3.x` + # 0.2.0.0 - Drop support for GHC 8.10.7 diff --git a/nri-postgresql/nri-postgresql.cabal b/nri-postgresql/nri-postgresql.cabal index 545c4680..8531637b 100644 --- a/nri-postgresql/nri-postgresql.cabal +++ b/nri-postgresql/nri-postgresql.cabal @@ -1,11 +1,11 @@ cabal-version: 1.18 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: nri-postgresql -version: 0.2.0.0 +version: 0.2.0.1 synopsis: Make queries against Postgresql. description: Please see the README at . category: Web @@ -18,7 +18,7 @@ license: BSD3 license-file: LICENSE build-type: Simple extra-source-files: - test/golden-results/observability-spec-postgres-reporting + test/golden-results/observability-spec-postgres-reporting-ghc-9 extra-doc-files: README.md LICENSE @@ -71,7 +71,7 @@ library , nri-prelude >=0.1.0.0 && <0.7 , postgresql-typed ==0.6.* , resource-pool >=0.2.0.0 && <0.5 - , resourcet >=1.2.0 && <1.3 + , resourcet >=1.2.0 && <1.4 , safe-exceptions >=0.1.7.0 && <1.3 , template-haskell >=2.15.0.0 && <2.20 , text >=1.2.3.1 && <2.1 @@ -129,7 +129,7 @@ test-suite tests , nri-prelude >=0.1.0.0 && <0.7 , postgresql-typed ==0.6.* , resource-pool >=0.2.0.0 && <0.5 - , resourcet >=1.2.0 && <1.3 + , resourcet >=1.2.0 && <1.4 , safe-exceptions >=0.1.7.0 && <1.3 , template-haskell >=2.15.0.0 && <2.20 , text >=1.2.3.1 && <2.1 diff --git a/nri-postgresql/package.yaml b/nri-postgresql/package.yaml index bcda916a..d98923f0 100644 --- a/nri-postgresql/package.yaml +++ b/nri-postgresql/package.yaml @@ -3,7 +3,7 @@ synopsis: Make queries against Postgresql. description: Please see the README at . homepage: https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-postgresql#readme author: NoRedInk -version: 0.2.0.0 +version: 0.2.0.1 maintainer: haskell-open-source@noredink.com copyright: 2023 NoRedInk Corp. github: NoRedInk/haskell-libraries/postgresql @@ -26,7 +26,7 @@ dependencies: - nri-prelude >= 0.1.0.0 && < 0.7 - postgresql-typed >= 0.6 && < 0.7 - resource-pool >= 0.2.0.0 && < 0.5 -- resourcet >= 1.2.0 && < 1.3 +- resourcet >= 1.2.0 && < 1.4 - safe-exceptions >= 0.1.7.0 && < 1.3 - template-haskell >= 2.15.0.0 && < 2.20 - text >= 1.2.3.1 && < 2.1 diff --git a/nri-prelude/CHANGELOG.md b/nri-prelude/CHANGELOG.md index f2c946f9..772e8c84 100644 --- a/nri-prelude/CHANGELOG.md +++ b/nri-prelude/CHANGELOG.md @@ -3,6 +3,7 @@ - Drop support for GHC 8.10.7 - Allow specifying where devlogs for log-explorer go through `NRI_DEV_LOG` environment variable. - Added `putText` and `putTextLn` functions for thread-safe console printing. +- Allow `hedgehog-1.4.x` # 0.6.1.2 diff --git a/nri-prelude/nri-prelude.cabal b/nri-prelude/nri-prelude.cabal index b8ce088c..de197991 100644 --- a/nri-prelude/nri-prelude.cabal +++ b/nri-prelude/nri-prelude.cabal @@ -1,6 +1,6 @@ cabal-version: 1.18 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack @@ -99,7 +99,7 @@ library , exceptions >=0.10.4 && <0.11 , filepath >=1.4.2.1 && <1.5 , ghc >=8.6.1 && <9.8 - , hedgehog >=1.0.2 && <1.3 + , hedgehog >=1.0.2 && <1.5 , junit-xml >=0.1.0.0 && <0.2.0.0 , lens >=4.16.1 && <5.3 , pretty-diff >=0.4.0.2 && <0.5 @@ -198,7 +198,7 @@ test-suite tests , exceptions >=0.10.4 && <0.11 , filepath >=1.4.2.1 && <1.5 , ghc >=8.6.1 && <9.8 - , hedgehog >=1.0.2 && <1.3 + , hedgehog >=1.0.2 && <1.5 , junit-xml >=0.1.0.0 && <0.2.0.0 , lens >=4.16.1 && <5.3 , pretty-diff >=0.4.0.2 && <0.5 diff --git a/nri-prelude/package.yaml b/nri-prelude/package.yaml index 9d7300ab..db41f5e5 100644 --- a/nri-prelude/package.yaml +++ b/nri-prelude/package.yaml @@ -29,7 +29,7 @@ library: - exceptions >= 0.10.4 && < 0.11 - filepath >= 1.4.2.1 && < 1.5 - ghc >= 8.6.1 && < 9.8 - - hedgehog >= 1.0.2 && < 1.3 + - hedgehog >= 1.0.2 && < 1.5 - junit-xml >= 0.1.0.0 && < 0.2.0.0 - lens >=4.16.1 && <5.3 - pretty-diff >= 0.4.0.2 && < 0.5 diff --git a/nri-redis/CHANGELOG.md b/nri-redis/CHANGELOG.md index 4dac31ac..f6b951fe 100644 --- a/nri-redis/CHANGELOG.md +++ b/nri-redis/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.2.0.1 + +- Allow `resourcet-1.3.x`, `megaparsec-9.5.x` + # 0.2.0.0 - Drop support for GHC 8.10.7 diff --git a/nri-redis/nri-redis.cabal b/nri-redis/nri-redis.cabal index a50fdfbb..ad55820e 100644 --- a/nri-redis/nri-redis.cabal +++ b/nri-redis/nri-redis.cabal @@ -1,11 +1,11 @@ cabal-version: 1.18 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: nri-redis -version: 0.2.0.0 +version: 0.2.0.1 synopsis: An intuitive hedis wrapper library. description: Please see the README at . category: Web @@ -72,13 +72,13 @@ library , cryptohash-sha1 >=0.11.101.0 && <0.12 , haskell-src-meta >=0.8.12 && <0.9 , hedis >=0.14.0 && <0.16 - , megaparsec >=9.2.2 && <9.4 + , megaparsec >=9.2.2 && <9.6 , modern-uri >=0.3.1.0 && <0.4 , nri-env-parser >=0.1.0.0 && <0.3 , nri-observability >=0.1.0 && <0.3 , nri-prelude >=0.1.0.0 && <0.7 , pcre-light >=0.4.1.0 && <0.4.2 - , resourcet >=1.2.0 && <1.3 + , resourcet >=1.2.0 && <1.4 , safe-exceptions >=0.1.7.0 && <1.3 , template-haskell >=2.16 && <3.0 , text >=1.2.3.1 && <2.1 @@ -137,13 +137,13 @@ test-suite tests , cryptohash-sha1 >=0.11.101.0 && <0.12 , haskell-src-meta >=0.8.12 && <0.9 , hedis >=0.14.0 && <0.16 - , megaparsec >=9.2.2 && <9.4 + , megaparsec >=9.2.2 && <9.6 , modern-uri >=0.3.1.0 && <0.4 , nri-env-parser >=0.1.0.0 && <0.3 , nri-observability >=0.1.0 && <0.3 , nri-prelude >=0.1.0.0 && <0.7 , pcre-light >=0.4.1.0 && <0.4.2 - , resourcet >=1.2.0 && <1.3 + , resourcet >=1.2.0 && <1.4 , safe-exceptions >=0.1.7.0 && <1.3 , template-haskell >=2.16 && <3.0 , text >=1.2.3.1 && <2.1 diff --git a/nri-redis/package.yaml b/nri-redis/package.yaml index b2da9535..78f46d4b 100644 --- a/nri-redis/package.yaml +++ b/nri-redis/package.yaml @@ -3,7 +3,7 @@ synopsis: An intuitive hedis wrapper library. description: Please see the README at . homepage: https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-redis#readme author: NoRedInk -version: 0.2.0.0 +version: 0.2.0.1 maintainer: haskell-open-source@noredink.com copyright: 2023 NoRedInk Corp. github: NoRedInk/haskell-libraries/nri-redis @@ -24,13 +24,13 @@ dependencies: - haskell-src-meta >= 0.8.12 && < 0.9 # hedis 14 introduces redis-cluster support - hedis >= 0.14.0 && < 0.16 - - megaparsec >= 9.2.2 && < 9.4 + - megaparsec >= 9.2.2 && < 9.6 - modern-uri >= 0.3.1.0 && < 0.4 - nri-env-parser >= 0.1.0.0 && < 0.3 - nri-observability >= 0.1.0 && < 0.3 - nri-prelude >= 0.1.0.0 && < 0.7 - pcre-light >= 0.4.1.0 && < 0.4.2 - - resourcet >= 1.2.0 && < 1.3 + - resourcet >= 1.2.0 && < 1.4 - safe-exceptions >= 0.1.7.0 && < 1.3 - text >= 1.2.3.1 && < 2.1 - template-haskell >= 2.16 && < 3.0 diff --git a/nri-test-encoding/CHANGELOG.md b/nri-test-encoding/CHANGELOG.md index f0aab624..815e482d 100644 --- a/nri-test-encoding/CHANGELOG.md +++ b/nri-test-encoding/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.2.0.1 + +- Allow `servant-0.20.x` + # 0.2.0.0 - Drop support for GHC 8.10.7 diff --git a/nri-test-encoding/nri-test-encoding.cabal b/nri-test-encoding/nri-test-encoding.cabal index ec6782c7..9ca496f7 100644 --- a/nri-test-encoding/nri-test-encoding.cabal +++ b/nri-test-encoding/nri-test-encoding.cabal @@ -1,11 +1,11 @@ cabal-version: 1.18 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: nri-test-encoding -version: 0.2.0.0 +version: 0.2.0.1 synopsis: A library to simplify writing golden tests for encoding types. description: Please see the README at . category: Testing @@ -60,9 +60,9 @@ library , filepath >=1.4.2.1 && <1.5 , nri-prelude >=0.1.0.0 && <0.7 , nri-redis >=0.1.0.0 && <0.3 - , servant >=0.16.2 && <0.20 + , servant >=0.16.2 && <0.21 , servant-auth-server >=0.4.5.1 && <0.5 - , servant-server >=0.16.2 && <0.20 + , servant-server >=0.16.2 && <0.21 , text >=1.2.3.1 && <2.1 default-language: Haskell2010 @@ -101,8 +101,8 @@ test-suite tests , filepath >=1.4.2.1 && <1.5 , nri-prelude >=0.1.0.0 && <0.7 , nri-redis >=0.1.0.0 && <0.3 - , servant >=0.16.2 && <0.20 + , servant >=0.16.2 && <0.21 , servant-auth-server >=0.4.5.1 && <0.5 - , servant-server >=0.16.2 && <0.20 + , servant-server >=0.16.2 && <0.21 , text >=1.2.3.1 && <2.1 default-language: Haskell2010 diff --git a/nri-test-encoding/package.yaml b/nri-test-encoding/package.yaml index b24638f3..28d85c3b 100644 --- a/nri-test-encoding/package.yaml +++ b/nri-test-encoding/package.yaml @@ -3,7 +3,7 @@ synopsis: A library to simplify writing golden tests for encoding types. description: Please see the README at . homepage: https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-test-encoding#readme author: NoRedInk -version: 0.2.0.0 +version: 0.2.0.1 maintainer: haskell-open-source@noredink.com copyright: 2023 NoRedInk Corp. github: NoRedInk/haskell-libraries/nri-test-encoding @@ -19,9 +19,9 @@ dependencies: - base >= 4.16.4.0 && < 4.18 - bytestring >= 0.10.8.2 && < 0.12 - filepath >= 1.4.2.1 && < 1.5 - - servant >= 0.16.2 && < 0.20 + - servant >= 0.16.2 && < 0.21 - servant-auth-server >= 0.4.5.1 && < 0.5 - - servant-server >= 0.16.2 && < 0.20 + - servant-server >= 0.16.2 && < 0.21 - text >= 1.2.3.1 && < 2.1 - nri-prelude >= 0.1.0.0 && < 0.7 - nri-redis >= 0.1.0.0 && < 0.3 From 9037e9590542e61d5b6c3229b1e1698e500755ed Mon Sep 17 00:00:00 2001 From: Jinnah Ali-Clarke Date: Tue, 6 Aug 2024 21:11:32 -0400 Subject: [PATCH 5/9] remove CPP directives that involve / rely on GHC < 9.2 --- nri-postgresql/src/Postgres/Enum.hs | 8 +- nri-postgresql/src/Postgres/QueryParser.hs | 1 - nri-prelude/src/NriPrelude/Plugin.hs | 80 +++++++++---------- .../NriPrelude/Plugin/GhcVersionDependent.hs | 65 +-------------- nri-redis/test/Helpers.hs | 10 +-- ...ability-spec-reporting-redis-counter-query | 51 ------------ ...y-spec-reporting-redis-counter-transaction | 51 ------------ ...ervability-spec-reporting-redis-hash-query | 51 ------------ ...lity-spec-reporting-redis-hash-transaction | 51 ------------ ...ervability-spec-reporting-redis-list-query | 51 ------------ ...lity-spec-reporting-redis-list-transaction | 51 ------------ .../observability-spec-reporting-redis-query | 51 ------------ ...rvability-spec-reporting-redis-transaction | 51 ------------ nri-test-encoding/test/Main.hs | 1 - 14 files changed, 46 insertions(+), 527 deletions(-) delete mode 100644 nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-counter-query delete mode 100644 nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-counter-transaction delete mode 100644 nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-hash-query delete mode 100644 nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-hash-transaction delete mode 100644 nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-list-query delete mode 100644 nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-list-transaction delete mode 100644 nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-query delete mode 100644 nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-transaction diff --git a/nri-postgresql/src/Postgres/Enum.hs b/nri-postgresql/src/Postgres/Enum.hs index 3a517d8e..e6d599a8 100644 --- a/nri-postgresql/src/Postgres/Enum.hs +++ b/nri-postgresql/src/Postgres/Enum.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-} -- | Provides a functionality for generating a bridge between a Haskell type and a Postgres enum type using Template Haskell. @@ -255,18 +254,13 @@ generatePGEnum hsTypeName databaseTypeName mapping = do -- Labeled -> "labeled" -- Blank -> "blank" -#if __GLASGOW_HASKELL__ >= 902 - let conP conName = TH.ConP conName [] [] -#else - let conP conName = TH.ConP conName [] -#endif let hsToPg = TH.CaseE (TH.VarE varX) ( mapping |> List.map ( \(conName, pgValue) -> - TH.Match (conP conName) (TH.NormalB <| TH.LitE <| TH.StringL <| Text.toList pgValue) [] + TH.Match (TH.ConP conName [] []) (TH.NormalB <| TH.LitE <| TH.StringL <| Text.toList pgValue) [] ) ) diff --git a/nri-postgresql/src/Postgres/QueryParser.hs b/nri-postgresql/src/Postgres/QueryParser.hs index f9f9c8af..f5cb0be6 100644 --- a/nri-postgresql/src/Postgres/QueryParser.hs +++ b/nri-postgresql/src/Postgres/QueryParser.hs @@ -14,7 +14,6 @@ import Control.Applicative import Control.Monad (void) import Data.Attoparsec.Text (Parser, anyChar, asciiCI, char, inClass, manyTill, skipSpace, space, takeWhile) import qualified Data.Attoparsec.Text as Attoparsec -import Data.Foldable (asum) import qualified List import qualified Maybe import qualified Text diff --git a/nri-prelude/src/NriPrelude/Plugin.hs b/nri-prelude/src/NriPrelude/Plugin.hs index 63ae1d9b..35ae4f2c 100644 --- a/nri-prelude/src/NriPrelude/Plugin.hs +++ b/nri-prelude/src/NriPrelude/Plugin.hs @@ -18,32 +18,16 @@ where -- Useful documentation -- - Elm's default imports: https://package.elm-lang.org/packages/elm/core/latest/ -- - GHC user guide on compiler plugins: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/extending_ghc.html#compiler-plugins --- - Module providing API for creating plugins: https://www.stackage.org/haddock/lts-17.4/ghc-lib-8.10.4.20210206/GhcPlugins.html +-- - Module providing API for creating plugins: https://www.stackage.org/haddock/lts-17.4/ghc-lib-8.10.4.20210206/GHC.Plugins.html import Data.Function ((&)) import qualified Data.List -#if __GLASGOW_HASKELL__ >= 900 -import qualified GHC.Plugins as GhcPlugins -#if __GLASGOW_HASKELL__ >= 902 -import qualified GHC.Hs as GhcPlugins (HsParsedModule (..)) -#endif -#else -import qualified GhcPlugins -#endif +import qualified GHC.Hs +import qualified GHC.Parser.Annotation +import qualified GHC.Plugins -import NriPrelude.Plugin.GhcVersionDependent - ( hsmodImports, - hsmodName, - ideclImplicit, - ideclName, - ideclQualified, - isQualified, - mkQualified, - noLoc, - simpleImportDecl, - withParsedResult - ) +import NriPrelude.Plugin.GhcVersionDependent (withParsedResult) import qualified Set import Prelude @@ -54,36 +38,36 @@ import Prelude -- then add the follwing ghc option to your cabal or package yaml file: -- -- > -fplugin=NriPrelude.Plugin -plugin :: GhcPlugins.Plugin +plugin :: GHC.Plugins.Plugin plugin = - GhcPlugins.defaultPlugin - { GhcPlugins.parsedResultAction = addImplicitImports, + GHC.Plugins.defaultPlugin + { GHC.Plugins.parsedResultAction = addImplicitImports, -- Let GHC know this plugin doesn't perform arbitrary IO. Given the same -- input file it will make the same changes. Without this GHC will -- recompile modules using this plugin every time which is expensive. - GhcPlugins.pluginRecompile = GhcPlugins.purePlugin + GHC.Plugins.pluginRecompile = GHC.Plugins.purePlugin } addImplicitImports :: - [GhcPlugins.CommandLineOption] -> - GhcPlugins.ModSummary -> + [GHC.Plugins.CommandLineOption] -> + GHC.Plugins.ModSummary -> #if __GLASGOW_HASKELL__ >= 904 - GhcPlugins.ParsedResult -> - GhcPlugins.Hsc GhcPlugins.ParsedResult + GHC.Plugins.ParsedResult -> + GHC.Plugins.Hsc GHC.Plugins.ParsedResult #else - GhcPlugins.HsParsedModule -> - GhcPlugins.Hsc GhcPlugins.HsParsedModule + GHC.Hs.HsParsedModule -> + GHC.Plugins.Hsc GHC.Hs.HsParsedModule #endif addImplicitImports _ _ parsed = Prelude.pure $ withParsedResult parsed $ \parsed' -> parsed' - { GhcPlugins.hpm_module = - fmap addImportsWhenNotPath (GhcPlugins.hpm_module parsed') + { GHC.Hs.hpm_module = + fmap addImportsWhenNotPath (GHC.Hs.hpm_module parsed') } where addImportsWhenNotPath hsModule = - case fmap unLocate (hsmodName hsModule) of + case fmap unLocate (GHC.Hs.hsmodName hsModule) of Nothing -> addImports hsModule Just modName -> if Data.List.isPrefixOf "Paths_" modName @@ -92,10 +76,10 @@ addImplicitImports _ _ parsed = addImports hsModule = hsModule - { hsmodImports = + { GHC.Hs.hsmodImports = -- Add default Elm-like imports when the user hasn't imported them -- explicitly yet, in order to avoid duplicate import warnings. - hsmodImports hsModule + GHC.Hs.hsmodImports hsModule ++ ( Set.diff extraImports (existingImports hsModule) & Set.toList & fmap @@ -108,22 +92,32 @@ addImplicitImports _ _ parsed = } existingImports hsModule = - hsmodImports hsModule + GHC.Hs.hsmodImports hsModule & fmap - ( \(GhcPlugins.L _ imp) -> - case (isQualified imp, unLocate (ideclName imp)) of + ( \(GHC.Plugins.L _ imp) -> + case (isQualified imp, unLocate (GHC.Hs.ideclName imp)) of (True, name) -> Qualified name (False, name) -> Unqualified name ) & Set.fromList - unLocate (GhcPlugins.L _ x) = GhcPlugins.moduleNameString x + unLocate (GHC.Plugins.L _ x) = GHC.Plugins.moduleNameString x unqualified name = - noLoc (simpleImportDecl (GhcPlugins.mkModuleName name)) - & fmap (\qual -> qual {ideclImplicit = True}) + GHC.Parser.Annotation.noLocA (GHC.Hs.simpleImportDecl (GHC.Plugins.mkModuleName name)) + & fmap (\qual -> qual {GHC.Hs.ideclImplicit = True}) qualified name = - fmap (\qual -> qual {ideclQualified = mkQualified}) (unqualified name) + fmap (\qual -> qual {GHC.Hs.ideclQualified = GHC.Hs.QualifiedPre}) (unqualified name) + +-- There's more than one way to do a qualified import. See: +-- https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/import_qualified_post.html + +isQualified :: GHC.Hs.ImportDecl pass -> Bool +isQualified imp = + case GHC.Hs.ideclQualified imp of + GHC.Hs.QualifiedPre -> True + GHC.Hs.QualifiedPost -> True + GHC.Hs.NotQualified -> False data Import = Unqualified String diff --git a/nri-prelude/src/NriPrelude/Plugin/GhcVersionDependent.hs b/nri-prelude/src/NriPrelude/Plugin/GhcVersionDependent.hs index d0c335cb..1e859e67 100644 --- a/nri-prelude/src/NriPrelude/Plugin/GhcVersionDependent.hs +++ b/nri-prelude/src/NriPrelude/Plugin/GhcVersionDependent.hs @@ -1,51 +1,18 @@ {-# LANGUAGE CPP #-} --- A couple of imports we need to write this module have been moved in GHC --- version 8.10. This module uses the CPP extension to import the right values --- dependent on the version of GHC. - -#if __GLASGOW_HASKELL__ >= 810 +-- Imports we need to write this module tend to move around in later +-- versions of GHC. This module uses the CPP extension to import the +-- right values dependent on the version of GHC. module NriPrelude.Plugin.GhcVersionDependent ( - module GHC.Hs, - isQualified, - mkQualified, - noLoc, withParsedResult ) where -import GHC.Hs -import Prelude +import GHC.Hs (HsParsedModule) #if __GLASGOW_HASKELL__ >= 904 import qualified GHC.Driver.Plugins #endif -#if __GLASGOW_HASKELL__ >= 902 -import qualified GHC.Parser.Annotation -#elif __GLASGOW_HASKELL__ >= 900 -import GHC.Types.SrcLoc (noLoc) -#else -import GhcPlugins (HsParsedModule) -import SrcLoc (noLoc) -#endif - -#if __GLASGOW_HASKELL__ >= 902 -noLoc :: a -> GHC.Parser.Annotation.LocatedAn an a -noLoc = noLocA -#endif - --- There's more than one way to do a qualified import. See: --- https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/import_qualified_post.html - -isQualified :: ImportDecl pass -> Bool -isQualified imp = - case ideclQualified imp of - QualifiedPre -> True - QualifiedPost -> True - NotQualified -> False - -mkQualified :: ImportDeclQualifiedStyle -mkQualified = QualifiedPre #if __GLASGOW_HASKELL__ >= 904 withParsedResult :: GHC.Driver.Plugins.ParsedResult -> (HsParsedModule -> HsParsedModule) -> GHC.Driver.Plugins.ParsedResult @@ -57,27 +24,3 @@ withParsedResult parsed f = withParsedResult :: HsParsedModule -> (HsParsedModule -> HsParsedModule) -> HsParsedModule withParsedResult parsed f = f parsed #endif - -#else -module NriPrelude.Plugin.GhcVersionDependent ( - module HsSyn, - isQualified, - mkQualified, - noLoc, - withParsedResult -) where - -import GhcPlugins (HsParsedModule, noLoc) -import HsSyn -import Prelude - -isQualified :: ImportDecl pass -> Bool -isQualified = ideclQualified - -mkQualified :: Bool -mkQualified = True - -withParsedResult :: HsParsedModule -> (HsParsedModule -> HsParsedModule) -> HsParsedModule -withParsedResult parsed f = f parsed - -#endif diff --git a/nri-redis/test/Helpers.hs b/nri-redis/test/Helpers.hs index 9522e36c..9b939ebc 100644 --- a/nri-redis/test/Helpers.hs +++ b/nri-redis/test/Helpers.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Helpers where @@ -22,7 +21,8 @@ getHandlers = do handler <- Handler.handler "tests" settings {Settings.defaultExpiry = Settings.NoDefaultExpiry} Prelude.pure TestHandlers {autoExtendExpireHandler, handler} --- | Golden results are slightly different between GHC 9.2.x and 8.10.x due +-- | Historical context: +-- Golden results are slightly different between GHC 9.2.x and 8.10.x due -- to apparent differences in internal handling of stack frame source locations. -- In particular, the end of a function call now does not extend to the end of -- the line but instead to the end of the function name. E.g. for the following: @@ -34,9 +34,7 @@ getHandlers = do -- In GHC 8.10.x (and possibly GHC 9.0.x?) `srcLocEndLine` and `srcLocEndCol` -- would correspond to the `z` at the end of `baz`. Unfortunately, in GHC 9.2.x -- it corresponds to the second `o` at the end of `foo`. +-- +-- We keep this here in case similar is true in later versions of GHC. goldenResultsDir :: Text -#if __GLASGOW_HASKELL__ >= 902 goldenResultsDir = "test/golden-results-9.2" -#else -goldenResultsDir = "test/golden-results-8.10" -#endif diff --git a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-counter-query b/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-counter-query deleted file mode 100644 index a44457e7..00000000 --- a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-counter-query +++ /dev/null @@ -1,51 +0,0 @@ -TracingSpan - { name = "test-root" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "rootTracingSpanIO" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 31 - , srcLocStartCol = 7 - , srcLocEndLine = 35 - , srcLocEndCol = 40 - } - ) - , details = Nothing - , summary = Nothing - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = - [ TracingSpan - { name = "Redis Query" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "query" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 105 - , srcLocStartCol = 9 - , srcLocEndLine = 105 - , srcLocEndCol = 68 - } - ) - , details = - Just - "{\"commands\":[\"PING\"],\"host\":\"localhost\",\"port\":6379}" - , summary = Just "PING" - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = [] - } - ] - } \ No newline at end of file diff --git a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-counter-transaction b/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-counter-transaction deleted file mode 100644 index 5b14ef76..00000000 --- a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-counter-transaction +++ /dev/null @@ -1,51 +0,0 @@ -TracingSpan - { name = "test-root" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "rootTracingSpanIO" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 31 - , srcLocStartCol = 7 - , srcLocEndLine = 35 - , srcLocEndCol = 40 - } - ) - , details = Nothing - , summary = Nothing - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = - [ TracingSpan - { name = "Redis Query" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "transaction" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 112 - , srcLocStartCol = 9 - , srcLocEndLine = 112 - , srcLocEndCol = 74 - } - ) - , details = - Just - "{\"commands\":[\"PING\"],\"host\":\"localhost\",\"port\":6379}" - , summary = Just "PING" - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = [] - } - ] - } \ No newline at end of file diff --git a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-hash-query b/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-hash-query deleted file mode 100644 index dbc01a55..00000000 --- a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-hash-query +++ /dev/null @@ -1,51 +0,0 @@ -TracingSpan - { name = "test-root" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "rootTracingSpanIO" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 31 - , srcLocStartCol = 7 - , srcLocEndLine = 35 - , srcLocEndCol = 40 - } - ) - , details = Nothing - , summary = Nothing - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = - [ TracingSpan - { name = "Redis Query" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "query" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 77 - , srcLocStartCol = 9 - , srcLocEndLine = 77 - , srcLocEndCol = 59 - } - ) - , details = - Just - "{\"commands\":[\"PING\"],\"host\":\"localhost\",\"port\":6379}" - , summary = Just "PING" - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = [] - } - ] - } \ No newline at end of file diff --git a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-hash-transaction b/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-hash-transaction deleted file mode 100644 index 18d639d6..00000000 --- a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-hash-transaction +++ /dev/null @@ -1,51 +0,0 @@ -TracingSpan - { name = "test-root" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "rootTracingSpanIO" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 31 - , srcLocStartCol = 7 - , srcLocEndLine = 35 - , srcLocEndCol = 40 - } - ) - , details = Nothing - , summary = Nothing - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = - [ TracingSpan - { name = "Redis Query" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "transaction" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 84 - , srcLocStartCol = 9 - , srcLocEndLine = 84 - , srcLocEndCol = 65 - } - ) - , details = - Just - "{\"commands\":[\"PING\"],\"host\":\"localhost\",\"port\":6379}" - , summary = Just "PING" - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = [] - } - ] - } \ No newline at end of file diff --git a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-list-query b/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-list-query deleted file mode 100644 index 8923bfe1..00000000 --- a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-list-query +++ /dev/null @@ -1,51 +0,0 @@ -TracingSpan - { name = "test-root" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "rootTracingSpanIO" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 31 - , srcLocStartCol = 7 - , srcLocEndLine = 35 - , srcLocEndCol = 40 - } - ) - , details = Nothing - , summary = Nothing - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = - [ TracingSpan - { name = "Redis Query" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "query" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 91 - , srcLocStartCol = 9 - , srcLocEndLine = 91 - , srcLocEndCol = 59 - } - ) - , details = - Just - "{\"commands\":[\"PING\"],\"host\":\"localhost\",\"port\":6379}" - , summary = Just "PING" - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = [] - } - ] - } \ No newline at end of file diff --git a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-list-transaction b/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-list-transaction deleted file mode 100644 index ad1e253d..00000000 --- a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-list-transaction +++ /dev/null @@ -1,51 +0,0 @@ -TracingSpan - { name = "test-root" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "rootTracingSpanIO" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 31 - , srcLocStartCol = 7 - , srcLocEndLine = 35 - , srcLocEndCol = 40 - } - ) - , details = Nothing - , summary = Nothing - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = - [ TracingSpan - { name = "Redis Query" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "transaction" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 98 - , srcLocStartCol = 9 - , srcLocEndLine = 98 - , srcLocEndCol = 65 - } - ) - , details = - Just - "{\"commands\":[\"PING\"],\"host\":\"localhost\",\"port\":6379}" - , summary = Just "PING" - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = [] - } - ] - } \ No newline at end of file diff --git a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-query b/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-query deleted file mode 100644 index 1fcd70c0..00000000 --- a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-query +++ /dev/null @@ -1,51 +0,0 @@ -TracingSpan - { name = "test-root" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "rootTracingSpanIO" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 31 - , srcLocStartCol = 7 - , srcLocEndLine = 35 - , srcLocEndCol = 40 - } - ) - , details = Nothing - , summary = Nothing - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = - [ TracingSpan - { name = "Redis Query" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "query" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 63 - , srcLocStartCol = 9 - , srcLocEndLine = 63 - , srcLocEndCol = 45 - } - ) - , details = - Just - "{\"commands\":[\"PING\"],\"host\":\"localhost\",\"port\":6379}" - , summary = Just "PING" - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = [] - } - ] - } \ No newline at end of file diff --git a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-transaction b/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-transaction deleted file mode 100644 index 345a0841..00000000 --- a/nri-redis/test/golden-results-8.10/observability-spec-reporting-redis-transaction +++ /dev/null @@ -1,51 +0,0 @@ -TracingSpan - { name = "test-root" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "rootTracingSpanIO" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 31 - , srcLocStartCol = 7 - , srcLocEndLine = 35 - , srcLocEndCol = 40 - } - ) - , details = Nothing - , summary = Nothing - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = - [ TracingSpan - { name = "Redis Query" - , started = MonotonicTime { inMicroseconds = 0 } - , finished = MonotonicTime { inMicroseconds = 0 } - , frame = - Just - ( "transaction" - , SrcLoc - { srcLocPackage = "main" - , srcLocModule = "Spec.Redis" - , srcLocFile = "test/Spec/Redis.hs" - , srcLocStartLine = 70 - , srcLocStartCol = 9 - , srcLocEndLine = 70 - , srcLocEndCol = 51 - } - ) - , details = - Just - "{\"commands\":[\"PING\"],\"host\":\"localhost\",\"port\":6379}" - , summary = Just "PING" - , succeeded = Succeeded - , containsFailures = False - , allocated = 0 - , children = [] - } - ] - } \ No newline at end of file diff --git a/nri-test-encoding/test/Main.hs b/nri-test-encoding/test/Main.hs index 6d812fb4..e2bf0ea6 100644 --- a/nri-test-encoding/test/Main.hs +++ b/nri-test-encoding/test/Main.hs @@ -5,7 +5,6 @@ import Data.Proxy import Examples import qualified Redis import Servant -import Servant.API.Generic ((:-)) import qualified Test import qualified Test.Encoding.Redis import qualified Test.Encoding.Routes From 1dde8fe77473ea1de866eb341ac326594523c805 Mon Sep 17 00:00:00 2001 From: Jinnah Ali-Clarke Date: Tue, 6 Aug 2024 21:25:27 -0400 Subject: [PATCH 6/9] use servant-auth-server@0.4.8.0 --- nix/common-haskell-overrides.nix | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/nix/common-haskell-overrides.nix b/nix/common-haskell-overrides.nix index fd35508c..72c146cd 100644 --- a/nix/common-haskell-overrides.nix +++ b/nix/common-haskell-overrides.nix @@ -20,20 +20,9 @@ self: super: # jailbreak to allow text >= 2 pretty-diff = pkgs.haskell.lib.doJailbreak super.pretty-diff; - # servant-auth-server 0.4.8.0 is marked as broken in nixpkgs, so jailbreak - # (known good) 0.4.7.0 to make it work - servant-auth-server = pkgs.haskell.lib.doJailbreak - (self.callHackage "servant-auth-server" "0.4.7.0" { }); - - # required by servant-auth-server@0.4.7.0 - jose = pkgs.haskell.lib.dontCheck (self.callHackage "jose" "0.9" { }); - jose-jwt = self.callHackage "jose-jwt" "0.9.5" { }; - - # servant-auth@0.4.1.0 is known-good but now complains re: jose version - # (now needs >= 0.10 but we've already used it successfully with 0.9). we - # can bypass this issue with a jailbreak - servant-auth = pkgs.haskell.lib.doJailbreak (self.callHackage "servant-auth" "0.4.1.0" { }); - + # servant-auth-server 0.4.8.0 is marked as broken in nixpkgs but it should be fine + servant-auth-server = pkgs.haskell.lib.markUnbroken super.servant-auth-server; + # for now, pin hw-kafka-client to 4.0.3; nixpkgs@release-24.05 provides 5.3.0 hw-kafka-client = self.callHackage "hw-kafka-client" "4.0.3" { }; } \ No newline at end of file From 59754d05820f515c13368eead4e667e0e01f9b62 Mon Sep 17 00:00:00 2001 From: Jinnah Ali-Clarke Date: Tue, 6 Aug 2024 22:03:11 -0400 Subject: [PATCH 7/9] drop support for `aeson-1.x` --- nri-env-parser/CHANGELOG.md | 4 ++ nri-http/CHANGELOG.md | 4 ++ nri-http/nri-http.cabal | 4 +- nri-http/package.yaml | 4 +- nri-kafka/CHANGELOG.md | 4 ++ nri-kafka/nri-kafka.cabal | 8 +-- nri-kafka/package.yaml | 2 +- nri-log-explorer/CHANGELOG.md | 4 ++ nri-log-explorer/nri-log-explorer.cabal | 3 +- nri-log-explorer/package.yaml | 2 +- nri-log-explorer/src/AesonHelpers.hs | 43 ------------- nri-log-explorer/src/Main.hs | 7 ++- nri-observability/CHANGELOG.md | 4 ++ nri-observability/nri-observability.cabal | 4 +- nri-observability/package.yaml | 2 +- .../src/Platform/AesonHelpers.hs | 63 +------------------ .../src/Reporter/Bugsnag/Internal.hs | 20 +++--- nri-postgresql/CHANGELOG.md | 1 + nri-prelude/CHANGELOG.md | 2 +- nri-prelude/nri-prelude.cabal | 2 - nri-prelude/package.yaml | 2 +- nri-prelude/src/Internal/AesonHelpers.hs | 37 ----------- nri-prelude/src/Log.hs | 6 +- nri-redis/CHANGELOG.md | 1 + nri-redis/nri-redis.cabal | 4 +- nri-redis/package.yaml | 2 +- nri-test-encoding/CHANGELOG.md | 1 + nri-test-encoding/nri-test-encoding.cabal | 4 +- nri-test-encoding/package.yaml | 2 +- 29 files changed, 65 insertions(+), 181 deletions(-) delete mode 100644 nri-log-explorer/src/AesonHelpers.hs delete mode 100644 nri-prelude/src/Internal/AesonHelpers.hs diff --git a/nri-env-parser/CHANGELOG.md b/nri-env-parser/CHANGELOG.md index 9e5a060c..c9dd9147 100644 --- a/nri-env-parser/CHANGELOG.md +++ b/nri-env-parser/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.2.0.1 + +- Drop support for `aeson-1.x` + # 0.2.0.0 - Drop support for GHC 8.10.7 diff --git a/nri-http/CHANGELOG.md b/nri-http/CHANGELOG.md index f1f4e498..29b1775c 100644 --- a/nri-http/CHANGELOG.md +++ b/nri-http/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.5.0.1 + +- Drop support for `aeson-1.x` + # 0.5.0.0 - Drop support for GHC 8.10.7 diff --git a/nri-http/nri-http.cabal b/nri-http/nri-http.cabal index f159e6fc..44457c90 100644 --- a/nri-http/nri-http.cabal +++ b/nri-http/nri-http.cabal @@ -54,7 +54,7 @@ library NumericUnderscores ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin build-depends: - aeson >=1.4.6.0 && <2.2 + aeson >=2.0 && <2.2 , base >=4.16.4.0 && <4.18 , bytestring >=0.10.8.2 && <0.12 , case-insensitive >=1.1 && <2.0 @@ -100,7 +100,7 @@ test-suite spec NumericUnderscores ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin -fno-warn-type-defaults build-depends: - aeson >=1.4.6.0 && <2.1 + aeson >=2.0 && <2.2 , base >=4.12.0.0 && <4.17 , bytestring >=0.10.8.2 && <0.12 , case-insensitive >=1.1 && <2.0 diff --git a/nri-http/package.yaml b/nri-http/package.yaml index bc28b838..f2011f30 100644 --- a/nri-http/package.yaml +++ b/nri-http/package.yaml @@ -14,7 +14,7 @@ extra-source-files: - "test/golden-results-*/*" library: dependencies: - - aeson >= 1.4.6.0 && < 2.2 + - aeson >= 2.0 && < 2.2 - base >= 4.16.4.0 && < 4.18 - bytestring >= 0.10.8.2 && < 0.12 - nri-prelude >= 0.1.0.0 && < 0.7 @@ -35,7 +35,7 @@ library: tests: spec: dependencies: - - aeson >= 1.4.6.0 && < 2.1 + - aeson >= 2.0 && < 2.2 - base >= 4.12.0.0 && < 4.17 - bytestring >= 0.10.8.2 && < 0.12 - nri-prelude >= 0.1.0.0 && < 0.7 diff --git a/nri-kafka/CHANGELOG.md b/nri-kafka/CHANGELOG.md index 1e03f4c6..f549985b 100644 --- a/nri-kafka/CHANGELOG.md +++ b/nri-kafka/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.2.0.1 + +- Drop support for `aeson-1.x` + # 0.2.0.0 - Drop support for GHC 8.10.7 diff --git a/nri-kafka/nri-kafka.cabal b/nri-kafka/nri-kafka.cabal index 295cc198..1b01204b 100644 --- a/nri-kafka/nri-kafka.cabal +++ b/nri-kafka/nri-kafka.cabal @@ -67,7 +67,7 @@ library TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fno-warn-type-defaults -fplugin=NriPrelude.Plugin build-depends: - aeson >=1.4.6.0 && <2.2 + aeson >=2.0 && <2.2 , async >=2.2.2 && <2.3 , base >=4.16.4.0 && <4.18 , bytestring >=0.10.8.2 && <0.12 @@ -111,7 +111,7 @@ executable pause-resume-bug-consumer TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fno-warn-type-defaults -fplugin=NriPrelude.Plugin -threaded -rtsopts "-with-rtsopts=-N -T" -O2 -main-is Consumer build-depends: - aeson >=1.4.6.0 && <2.2 + aeson >=2.0 && <2.2 , async >=2.2.2 && <2.3 , base >=4.16.4.0 && <4.18 , bytestring >=0.10.8.2 && <0.12 @@ -160,7 +160,7 @@ executable pause-resume-bug-producer TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fno-warn-type-defaults -fplugin=NriPrelude.Plugin -main-is Producer build-depends: - aeson >=1.4.6.0 && <2.2 + aeson >=2.0 && <2.2 , async >=2.2.2 && <2.3 , base >=4.16.4.0 && <4.18 , bytestring >=0.10.8.2 && <0.12 @@ -224,7 +224,7 @@ test-suite tests TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fno-warn-type-defaults -fplugin=NriPrelude.Plugin -threaded -rtsopts "-with-rtsopts=-N -T" -fno-warn-type-defaults build-depends: - aeson >=1.4.6.0 && <2.2 + aeson >=2.0 && <2.2 , async >=2.2.2 && <2.3 , base >=4.16.4.0 && <4.18 , bytestring >=0.10.8.2 && <0.12 diff --git a/nri-kafka/package.yaml b/nri-kafka/package.yaml index 12f702e0..60b9fb2f 100644 --- a/nri-kafka/package.yaml +++ b/nri-kafka/package.yaml @@ -14,7 +14,7 @@ extra-source-files: - LICENSE - CHANGELOG.md dependencies: - - aeson >= 1.4.6.0 && < 2.2 + - aeson >= 2.0 && < 2.2 - async >=2.2.2 && <2.3 - base >= 4.16.4.0 && < 4.18 - bytestring >= 0.10.8.2 && < 0.12 diff --git a/nri-log-explorer/CHANGELOG.md b/nri-log-explorer/CHANGELOG.md index 4140af96..91d98cc1 100644 --- a/nri-log-explorer/CHANGELOG.md +++ b/nri-log-explorer/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.2.0.1 + +- Drop support for `aeson-1.x` + # 0.2.0.0 - Drop support for GHC 8.10.7 diff --git a/nri-log-explorer/nri-log-explorer.cabal b/nri-log-explorer/nri-log-explorer.cabal index 21f8df1e..f9c56579 100644 --- a/nri-log-explorer/nri-log-explorer.cabal +++ b/nri-log-explorer/nri-log-explorer.cabal @@ -29,7 +29,6 @@ source-repository head executable log-explorer main-is: Main.hs other-modules: - AesonHelpers Filterable Paths_nri_log_explorer hs-source-dirs: @@ -50,7 +49,7 @@ executable log-explorer TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -threaded -rtsopts "-with-rtsopts=-N -T -xq10m" -O2 -fplugin=NriPrelude.Plugin build-depends: - aeson >=1.4.6.0 && <2.2 + aeson >=2.0 && <2.2 , aeson-pretty >=0.8.0 && <0.9 , async >=2.2.2 && <2.3 , base >=4.16.4.0 && <4.18 diff --git a/nri-log-explorer/package.yaml b/nri-log-explorer/package.yaml index efbc03f2..d49150ea 100644 --- a/nri-log-explorer/package.yaml +++ b/nri-log-explorer/package.yaml @@ -16,7 +16,7 @@ extra-doc-files: executables: log-explorer: dependencies: - - aeson >= 1.4.6.0 && < 2.2 + - aeson >= 2.0 && < 2.2 - aeson-pretty >= 0.8.0 && < 0.9 - async >= 2.2.2 && < 2.3 - base >= 4.16.4.0 && < 4.18 diff --git a/nri-log-explorer/src/AesonHelpers.hs b/nri-log-explorer/src/AesonHelpers.hs deleted file mode 100644 index 56f72857..00000000 --- a/nri-log-explorer/src/AesonHelpers.hs +++ /dev/null @@ -1,43 +0,0 @@ -{-# LANGUAGE CPP #-} - --- | This module supports working with aeson objects in a way compatible with --- both the 1.x and 2.x versions of the aeson library. --- --- Aeson has a Value type for representing JSON values. The Value type has --- constructors for JSON strings, numbers, arrays, and objects. Aeson represents --- JSON objects using an Object type, which in versions 1.x of aeson is a type --- alias for a HashMap. Version 2.x of library make Object an opaque type. --- --- nri-observability needs to perform some operations on JSON objects. Depending --- on which version of aeson we got, we need to use different functions to --- perform these operations. This module contains implementations for both 1.x --- and 2.x versions of Aeson, and automatically picks the right version --- depending on which version of the library is detected. --- --- Once we're done supporting versions 1.x of aeson we can drop this module and --- inline the 2.x versions of functions wherever they are called. -module AesonHelpers (hashMapFromObject, textFromKey) where - -import qualified Data.Aeson.Types as Types -import qualified Data.HashMap.Strict as HashMap - -#if MIN_VERSION_aeson(2,0,0) - -import qualified Data.Aeson.Key as Key -import qualified Data.Aeson.KeyMap as KeyMap - -hashMapFromObject :: Types.Object -> HashMap.HashMap Key.Key Types.Value -hashMapFromObject object = KeyMap.toHashMap object - -textFromKey :: Key.Key -> Text -textFromKey key = Key.toText key - -#else - -hashMapFromObject :: Types.Object -> HashMap.HashMap Key.Key Types.Value -hashMapFromObject object = object - -textFromKey :: Text -> Text -textFromKey key = key - -#endif diff --git a/nri-log-explorer/src/Main.hs b/nri-log-explorer/src/Main.hs index f5ca44b0..a4104ff8 100644 --- a/nri-log-explorer/src/Main.hs +++ b/nri-log-explorer/src/Main.hs @@ -7,7 +7,6 @@ module Main ) where -import AesonHelpers (hashMapFromObject, textFromKey) import qualified Brick import qualified Brick.BChan import Brick.Types (ViewportType (..)) @@ -21,6 +20,8 @@ import qualified Control.Exception.Safe as Exception import Control.Monad.IO.Class (liftIO) import qualified Data.Aeson as Aeson import qualified Data.Aeson.Encode.Pretty +import Data.Aeson.Key (toText) +import Data.Aeson.KeyMap (toHashMap) import qualified Data.ByteString as ByteString import qualified Data.HashMap.Strict as HashMap import qualified Data.Text @@ -1065,11 +1066,11 @@ viewSpanDetails Span {original} = |> Data.Text.Lazy.toStrict ) Just (Aeson.Object object) -> - HashMap.toList (hashMapFromObject object) + HashMap.toList (toHashMap object) |> List.map ( \(name, val) -> viewDetail - (textFromKey name) + (toText name) ( case Aeson.toJSON val of Aeson.Null -> "Null" Aeson.String str -> str diff --git a/nri-observability/CHANGELOG.md b/nri-observability/CHANGELOG.md index 20421a39..1f44227e 100644 --- a/nri-observability/CHANGELOG.md +++ b/nri-observability/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.2.0.1 + +- Drop support for `aeson-1.x` + # 0.2.0.0 - Drop support for GHC 8.10.7 diff --git a/nri-observability/nri-observability.cabal b/nri-observability/nri-observability.cabal index 9aaba90e..2e779147 100644 --- a/nri-observability/nri-observability.cabal +++ b/nri-observability/nri-observability.cabal @@ -65,7 +65,7 @@ library TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin build-depends: - aeson >=1.4.6.0 && <2.2 + aeson >=2.0 && <2.2 , aeson-pretty >=0.8.0 && <0.9 , async >=2.2.2 && <2.3 , base >=4.16.4.0 && <4.18 @@ -134,7 +134,7 @@ test-suite tests ExtendedDefaultRules ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin -threaded -rtsopts "-with-rtsopts=-N -T" -fno-warn-type-defaults build-depends: - aeson >=1.4.6.0 && <2.2 + aeson >=2.0 && <2.2 , aeson-pretty >=0.8.0 && <0.9 , async >=2.2.2 && <2.3 , base >=4.16.4.0 && <4.18 diff --git a/nri-observability/package.yaml b/nri-observability/package.yaml index 6b856a90..97e867e8 100644 --- a/nri-observability/package.yaml +++ b/nri-observability/package.yaml @@ -14,7 +14,7 @@ extra-doc-files: - LICENSE - CHANGELOG.md dependencies: - - aeson >= 1.4.6.0 && < 2.2 + - aeson >= 2.0 && < 2.2 - aeson-pretty >= 0.8.0 && < 0.9 - async >= 2.2.2 && < 2.3 - base >= 4.16.4.0 && < 4.18 diff --git a/nri-observability/src/Platform/AesonHelpers.hs b/nri-observability/src/Platform/AesonHelpers.hs index 37dfeabc..9658cb92 100644 --- a/nri-observability/src/Platform/AesonHelpers.hs +++ b/nri-observability/src/Platform/AesonHelpers.hs @@ -1,24 +1,4 @@ -{-# LANGUAGE CPP #-} - --- | This module supports working with aeson objects in a way compatible with --- both the 1.x and 2.x versions of the aeson library. --- --- Aeson has a Value type for representing JSON values. The Value type has --- constructors for JSON strings, numbers, arrays, and objects. Aeson represents --- JSON objects using an Object type, which in versions 1.x of aeson is a type --- alias for a HashMap. Version 2.x of library make Object an opaque type. --- --- nri-observability needs to perform some operations on JSON objects. Depending --- on which version of aeson we got, we need to use different functions to --- perform these operations. This module contains implementations for both 1.x --- and 2.x versions of Aeson, and automatically picks the right version --- depending on which version of the library is detected. --- --- Once we're done supporting versions 1.x of aeson we can drop this module and --- inline the 2.x versions of functions wherever they are called. -module Platform.AesonHelpers (foldObject, mergeObjects, keyFromText, singleton, emptyObject) where - -#if MIN_VERSION_aeson(2,0,0) +module Platform.AesonHelpers (foldObject, singleton) where import qualified Data.Aeson as Aeson import qualified Data.Aeson.Key as Key @@ -27,44 +7,5 @@ import qualified Data.Aeson.KeyMap as KeyMap foldObject :: (Text -> Aeson.Value -> acc -> acc) -> acc -> Aeson.Object -> acc foldObject fn = KeyMap.foldrWithKey (\key val acc -> fn (Key.toText key) val acc) -mergeObjects :: - (Aeson.Value -> Aeson.Value -> Aeson.Value) -> - Aeson.Object -> - Aeson.Object -> - Aeson.Object -mergeObjects = KeyMap.unionWith - -keyFromText :: Text -> Key.Key -keyFromText key = Key.fromText key - -singleton :: Text -> Aeson.Value -> Aeson.Object -singleton key = KeyMap.singleton (keyFromText key) - -emptyObject :: Aeson.Object -emptyObject = KeyMap.empty - -#else - -import qualified Data.Aeson as Aeson -import qualified Data.HashMap.Strict as HashMap - -foldObject :: (Text -> Aeson.Value -> acc -> acc) -> acc -> Aeson.Object -> acc -foldObject = HashMap.foldrWithKey - -mergeObjects :: - (Aeson.Value -> Aeson.Value -> Aeson.Value) -> - Aeson.Object -> - Aeson.Object -> - Aeson.Object -mergeObjects merge object1 object2 = HashMap.unionWith merge object1 object2 - -keyFromText :: Text -> Text -keyFromText key = key - singleton :: Text -> Aeson.Value -> Aeson.Object -singleton = HashMap.singleton - -emptyObject :: Aeson.Object -emptyObject = HashMap.empty - -#endif +singleton key = KeyMap.singleton (Key.fromText key) diff --git a/nri-observability/src/Reporter/Bugsnag/Internal.hs b/nri-observability/src/Reporter/Bugsnag/Internal.hs index 7e31f3a5..6701ec01 100644 --- a/nri-observability/src/Reporter/Bugsnag/Internal.hs +++ b/nri-observability/src/Reporter/Bugsnag/Internal.hs @@ -7,6 +7,8 @@ module Reporter.Bugsnag.Internal where import qualified Control.Exception.Safe as Exception import Data.Aeson ((.=)) import qualified Data.Aeson as Aeson +import qualified Data.Aeson.Key as Key +import qualified Data.Aeson.KeyMap as KeyMap import qualified Data.HashMap.Strict as HashMap import qualified Data.List import qualified Data.Proxy as Proxy @@ -374,14 +376,14 @@ renderLog event details = { Bugsnag.event_metaData = Aeson.toJSON details |> AesonHelpers.singleton "custom" - |> AesonHelpers.mergeObjects + |> KeyMap.unionWith mergeJson - (Bugsnag.event_metaData event |> Maybe.withDefault AesonHelpers.emptyObject) + (Bugsnag.event_metaData event |> Maybe.withDefault KeyMap.empty) |> Just } mergeJson :: Aeson.Value -> Aeson.Value -> Aeson.Value -mergeJson (Aeson.Object x) (Aeson.Object y) = Aeson.Object (AesonHelpers.mergeObjects mergeJson x y) +mergeJson (Aeson.Object x) (Aeson.Object y) = Aeson.Object (KeyMap.unionWith mergeJson x y) mergeJson _ last = last mergeMetaData :: @@ -390,7 +392,7 @@ mergeMetaData :: Maybe Aeson.Object mergeMetaData Nothing x = x mergeMetaData x Nothing = x -mergeMetaData (Just x) (Just y) = Just (AesonHelpers.mergeObjects mergeJson x y) +mergeMetaData (Just x) (Just y) = Just (KeyMap.unionWith mergeJson x y) renderIncomingHttpRequest :: Bugsnag.Event -> @@ -415,11 +417,11 @@ renderIncomingHttpRequest event (HttpRequest.Incoming request) = Bugsnag.event_metaData = mergeMetaData (Bugsnag.event_metaData event) - ( [ AesonHelpers.keyFromText "endpoint" .= HttpRequest.endpoint request, - AesonHelpers.keyFromText "http version" .= HttpRequest.httpVersion request, - AesonHelpers.keyFromText "response status" .= HttpRequest.status request, - AesonHelpers.keyFromText "path" .= HttpRequest.path request, - AesonHelpers.keyFromText "query string" .= HttpRequest.queryString request + ( [ Key.fromText "endpoint" .= HttpRequest.endpoint request, + Key.fromText "http version" .= HttpRequest.httpVersion request, + Key.fromText "response status" .= HttpRequest.status request, + Key.fromText "path" .= HttpRequest.path request, + Key.fromText "query string" .= HttpRequest.queryString request ] |> Aeson.object |> AesonHelpers.singleton "request" diff --git a/nri-postgresql/CHANGELOG.md b/nri-postgresql/CHANGELOG.md index e707433b..afac61db 100644 --- a/nri-postgresql/CHANGELOG.md +++ b/nri-postgresql/CHANGELOG.md @@ -1,5 +1,6 @@ # 0.2.0.1 +- Drop support for `aeson-1.x` - Allow `resourcet-1.3.x` # 0.2.0.0 diff --git a/nri-prelude/CHANGELOG.md b/nri-prelude/CHANGELOG.md index 772e8c84..b65e4311 100644 --- a/nri-prelude/CHANGELOG.md +++ b/nri-prelude/CHANGELOG.md @@ -1,6 +1,6 @@ # Unreleased -- Drop support for GHC 8.10.7 +- Drop support for GHC 8.10.7, `aeson-1.x` - Allow specifying where devlogs for log-explorer go through `NRI_DEV_LOG` environment variable. - Added `putText` and `putTextLn` functions for thread-safe console printing. - Allow `hedgehog-1.4.x` diff --git a/nri-prelude/nri-prelude.cabal b/nri-prelude/nri-prelude.cabal index de197991..ef2620ed 100644 --- a/nri-prelude/nri-prelude.cabal +++ b/nri-prelude/nri-prelude.cabal @@ -53,7 +53,6 @@ library Text Tuple other-modules: - Internal.AesonHelpers Internal.IO Internal.Shortcut Internal.Terminal @@ -137,7 +136,6 @@ test-suite tests Dict Expect Fuzz - Internal.AesonHelpers Internal.IO Internal.Shortcut Internal.Terminal diff --git a/nri-prelude/package.yaml b/nri-prelude/package.yaml index db41f5e5..f04fb3f0 100644 --- a/nri-prelude/package.yaml +++ b/nri-prelude/package.yaml @@ -17,7 +17,7 @@ extra-doc-files: - licenses/ELM_TEST_LICENSE library: dependencies: &dependencies - - aeson >= 1.4.6.0 && < 2.2 + - aeson >= 2.0 && < 2.2 - aeson-pretty >= 0.8.0 && < 0.9 - async >= 2.2.2 && < 2.3 - attoparsec >= 0.13.0.0 && < 0.15 diff --git a/nri-prelude/src/Internal/AesonHelpers.hs b/nri-prelude/src/Internal/AesonHelpers.hs deleted file mode 100644 index 20a8583e..00000000 --- a/nri-prelude/src/Internal/AesonHelpers.hs +++ /dev/null @@ -1,37 +0,0 @@ -{-# LANGUAGE CPP #-} - --- | This module supports working with aeson objects in a way compatible with --- both the 1.x and 2.x versions of the aeson library. --- --- Aeson has a Value type for representing JSON values. The Value type has --- constructors for JSON strings, numbers, arrays, and objects. Aeson represents --- JSON objects using an Object type, which in versions 1.x of aeson is a type --- alias for a HashMap. Version 2.x of library make Object an opaque type. --- --- nri-observability needs to perform some operations on JSON objects. Depending --- on which version of aeson we got, we need to use different functions to --- perform these operations. This module contains implementations for both 1.x --- and 2.x versions of Aeson, and automatically picks the right version --- depending on which version of the library is detected. --- --- Once we're done supporting versions 1.x of aeson we can drop this module and --- inline the 2.x versions of functions wherever they are called. -module Internal.AesonHelpers (keyFromText) where - -#if MIN_VERSION_aeson(2,0,0) - -import qualified Data.Aeson.Key as Key -import Text - -keyFromText :: Text -> Key.Key -keyFromText key = Key.fromText key - - -#else - -import Text - -keyFromText :: Text -> Text -keyFromText key = key - -#endif diff --git a/nri-prelude/src/Log.hs b/nri-prelude/src/Log.hs index b700c02c..3878b904 100644 --- a/nri-prelude/src/Log.hs +++ b/nri-prelude/src/Log.hs @@ -32,7 +32,7 @@ where import Data.Aeson ((.=)) import qualified Data.Aeson as Aeson import qualified GHC.Stack as Stack -import Internal.AesonHelpers (keyFromText) +import Data.Aeson.Key (fromText) import NriPrelude import qualified Platform import qualified Platform.Internal as Internal @@ -162,12 +162,12 @@ newtype LogContexts instance Aeson.ToJSON LogContexts where toJSON (LogContexts contexts) = contexts - |> map (\(Context key val) -> (keyFromText key) .= val) + |> map (\(Context key val) -> (fromText key) .= val) |> Aeson.object toEncoding (LogContexts contexts) = contexts - |> Prelude.foldMap (\(Context key val) -> (keyFromText key) .= val) + |> Prelude.foldMap (\(Context key val) -> (fromText key) .= val) |> Aeson.pairs instance Internal.TracingSpanDetails LogContexts diff --git a/nri-redis/CHANGELOG.md b/nri-redis/CHANGELOG.md index f6b951fe..888d7120 100644 --- a/nri-redis/CHANGELOG.md +++ b/nri-redis/CHANGELOG.md @@ -1,5 +1,6 @@ # 0.2.0.1 +- Drop support for `aeson-1.x` - Allow `resourcet-1.3.x`, `megaparsec-9.5.x` # 0.2.0.0 diff --git a/nri-redis/nri-redis.cabal b/nri-redis/nri-redis.cabal index ad55820e..7c23b7fd 100644 --- a/nri-redis/nri-redis.cabal +++ b/nri-redis/nri-redis.cabal @@ -63,7 +63,7 @@ library TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fno-warn-type-defaults -fplugin=NriPrelude.Plugin build-depends: - aeson >=1.4.6.0 && <2.2 + aeson >=2.0 && <2.2 , async >=2.2.2 && <2.3 , base >=4.16.4.0 && <4.18 , bytestring >=0.10.8.2 && <0.12 @@ -128,7 +128,7 @@ test-suite tests TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fno-warn-type-defaults -fplugin=NriPrelude.Plugin -threaded -rtsopts "-with-rtsopts=-N -T" -fno-warn-type-defaults build-depends: - aeson >=1.4.6.0 && <2.2 + aeson >=2.0 && <2.2 , async >=2.2.2 && <2.3 , base >=4.16.4.0 && <4.18 , bytestring >=0.10.8.2 && <0.12 diff --git a/nri-redis/package.yaml b/nri-redis/package.yaml index 78f46d4b..06f7bde0 100644 --- a/nri-redis/package.yaml +++ b/nri-redis/package.yaml @@ -14,7 +14,7 @@ extra-doc-files: - LICENSE - CHANGELOG.md dependencies: - - aeson >= 1.4.6.0 && < 2.2 + - aeson >= 2.0 && < 2.2 - async >=2.2.2 && <2.3 - base >= 4.16.4.0 && < 4.18 - bytestring >= 0.10.8.2 && < 0.12 diff --git a/nri-test-encoding/CHANGELOG.md b/nri-test-encoding/CHANGELOG.md index 815e482d..a95ce741 100644 --- a/nri-test-encoding/CHANGELOG.md +++ b/nri-test-encoding/CHANGELOG.md @@ -1,5 +1,6 @@ # 0.2.0.1 +- Drop support for `aeson-1.x` - Allow `servant-0.20.x` # 0.2.0.0 diff --git a/nri-test-encoding/nri-test-encoding.cabal b/nri-test-encoding/nri-test-encoding.cabal index 9ca496f7..20d822d5 100644 --- a/nri-test-encoding/nri-test-encoding.cabal +++ b/nri-test-encoding/nri-test-encoding.cabal @@ -53,7 +53,7 @@ library TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin build-depends: - aeson >=1.4.6.0 && <2.2 + aeson >=2.0 && <2.2 , aeson-pretty >=0.8.0 && <0.9 , base >=4.16.4.0 && <4.18 , bytestring >=0.10.8.2 && <0.12 @@ -94,7 +94,7 @@ test-suite tests TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin -threaded -rtsopts "-with-rtsopts=-N -T" -fno-warn-type-defaults build-depends: - aeson >=1.4.6.0 && <2.2 + aeson >=2.0 && <2.2 , aeson-pretty >=0.8.0 && <0.9 , base >=4.16.4.0 && <4.18 , bytestring >=0.10.8.2 && <0.12 diff --git a/nri-test-encoding/package.yaml b/nri-test-encoding/package.yaml index 28d85c3b..f7e25b54 100644 --- a/nri-test-encoding/package.yaml +++ b/nri-test-encoding/package.yaml @@ -14,7 +14,7 @@ extra-doc-files: - LICENSE - CHANGELOG.md dependencies: - - aeson >= 1.4.6.0 && < 2.2 + - aeson >= 2.0 && < 2.2 - aeson-pretty >=0.8.0 && < 0.9 - base >= 4.16.4.0 && < 4.18 - bytestring >= 0.10.8.2 && < 0.12 From f60effebad3d72a69e2bdff303e3a943b62bc03d Mon Sep 17 00:00:00 2001 From: Jinnah Ali-Clarke Date: Tue, 6 Aug 2024 22:32:23 -0400 Subject: [PATCH 8/9] support ghc 9.6.5 --- .github/workflows/ci.yml | 1 + nri-env-parser/CHANGELOG.md | 1 + nri-env-parser/nri-env-parser.cabal | 8 +++--- nri-env-parser/package.yaml | 4 +-- nri-http/CHANGELOG.md | 1 + nri-http/nri-http.cabal | 8 +++--- nri-http/package.yaml | 6 ++--- nri-kafka/CHANGELOG.md | 1 + nri-kafka/nri-kafka.cabal | 20 +++++++------- nri-kafka/package.yaml | 6 ++--- nri-log-explorer/CHANGELOG.md | 1 + nri-log-explorer/nri-log-explorer.cabal | 6 ++--- nri-log-explorer/package.yaml | 4 +-- nri-observability/CHANGELOG.md | 1 + nri-observability/nri-observability.cabal | 8 +++--- nri-observability/package.yaml | 4 +-- nri-postgresql/CHANGELOG.md | 1 + nri-postgresql/nri-postgresql.cabal | 8 +++--- nri-postgresql/package.yaml | 4 +-- nri-prelude/CHANGELOG.md | 1 + nri-prelude/nri-prelude.cabal | 8 +++--- nri-prelude/package.yaml | 4 +-- nri-prelude/src/NriPrelude/Plugin.hs | 4 +-- .../NriPrelude/Plugin/GhcVersionDependent.hs | 26 ++++++++++++++++--- nri-redis/CHANGELOG.md | 1 + nri-redis/nri-redis.cabal | 4 +-- nri-redis/package.yaml | 2 +- nri-test-encoding/CHANGELOG.md | 1 + nri-test-encoding/nri-test-encoding.cabal | 4 +-- nri-test-encoding/package.yaml | 2 +- shell-ghc-9-6.nix | 8 ++++++ shell.nix | 2 +- 32 files changed, 99 insertions(+), 61 deletions(-) create mode 100644 shell-ghc-9-6.nix diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2477ff75..4a7a8823 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,7 @@ jobs: ghc: - ghc-9-2 - ghc-9-4 + - ghc-9-6 runs-on: ${{ matrix.runner.os }} steps: - name: Install Nix diff --git a/nri-env-parser/CHANGELOG.md b/nri-env-parser/CHANGELOG.md index c9dd9147..b695667f 100644 --- a/nri-env-parser/CHANGELOG.md +++ b/nri-env-parser/CHANGELOG.md @@ -1,6 +1,7 @@ # 0.2.0.1 - Drop support for `aeson-1.x` +- Support GHC 9.6.5 # 0.2.0.0 diff --git a/nri-env-parser/nri-env-parser.cabal b/nri-env-parser/nri-env-parser.cabal index 49bc1e48..316573ab 100644 --- a/nri-env-parser/nri-env-parser.cabal +++ b/nri-env-parser/nri-env-parser.cabal @@ -1,11 +1,11 @@ cabal-version: 1.18 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: nri-env-parser -version: 0.2.0.0 +version: 0.2.0.1 synopsis: Read environment variables as settings to build 12-factor apps. description: Please see the README at . category: Web @@ -50,7 +50,7 @@ library TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin build-depends: - base >=4.16.4.0 && <4.18 + base >=4.16.4.0 && <4.19 , modern-uri >=0.3.1.0 && <0.4 , network-uri >=2.6.2.0 && <2.8 , nri-prelude >=0.1.0.0 && <0.7 @@ -83,7 +83,7 @@ test-suite tests ExtendedDefaultRules ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin -threaded -rtsopts "-with-rtsopts=-N -T" -fno-warn-type-defaults build-depends: - base >=4.16.4.0 && <4.18 + base >=4.16.4.0 && <4.19 , modern-uri >=0.3.1.0 && <0.4 , network-uri >=2.6.2.0 && <2.8 , nri-prelude >=0.1.0.0 && <0.7 diff --git a/nri-env-parser/package.yaml b/nri-env-parser/package.yaml index 9a2cac26..f47bd00c 100644 --- a/nri-env-parser/package.yaml +++ b/nri-env-parser/package.yaml @@ -3,7 +3,7 @@ synopsis: Read environment variables as settings to build 12-factor apps. description: Please see the README at . homepage: https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-env-parser#readme author: NoRedInk -version: 0.2.0.0 +version: 0.2.0.1 maintainer: haskell-open-source@noredink.com copyright: 2023 NoRedInk Corp. github: NoRedInk/haskell-libraries/env-parser @@ -15,7 +15,7 @@ extra-doc-files: - CHANGELOG.md library: dependencies: &dependencies - - base >= 4.16.4.0 && < 4.18 + - base >= 4.16.4.0 && < 4.19 - nri-prelude >= 0.1.0.0 && < 0.7 - modern-uri >= 0.3.1.0 && < 0.4 - network-uri >= 2.6.2.0 && < 2.8 diff --git a/nri-http/CHANGELOG.md b/nri-http/CHANGELOG.md index 29b1775c..a73359d8 100644 --- a/nri-http/CHANGELOG.md +++ b/nri-http/CHANGELOG.md @@ -1,6 +1,7 @@ # 0.5.0.1 - Drop support for `aeson-1.x` +- Support GHC 9.6.5 # 0.5.0.0 diff --git a/nri-http/nri-http.cabal b/nri-http/nri-http.cabal index 44457c90..02ecf9f6 100644 --- a/nri-http/nri-http.cabal +++ b/nri-http/nri-http.cabal @@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: nri-http -version: 0.5.0.0 +version: 0.5.0.1 synopsis: Make Elm style HTTP requests description: Please see the README at . category: Web @@ -55,7 +55,7 @@ library ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin build-depends: aeson >=2.0 && <2.2 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , bytestring >=0.10.8.2 && <0.12 , case-insensitive >=1.1 && <2.0 , conduit >=1.3.0 && <1.4 @@ -101,7 +101,7 @@ test-suite spec ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin -fno-warn-type-defaults build-depends: aeson >=2.0 && <2.2 - , base >=4.12.0.0 && <4.17 + , base >=4.12.0.0 && <4.19 , bytestring >=0.10.8.2 && <0.12 , case-insensitive >=1.1 && <2.0 , conduit >=1.3.0 && <1.4 diff --git a/nri-http/package.yaml b/nri-http/package.yaml index f2011f30..3038b4d0 100644 --- a/nri-http/package.yaml +++ b/nri-http/package.yaml @@ -2,7 +2,7 @@ name: nri-http synopsis: Make Elm style HTTP requests description: Please see the README at . author: NoRedInk -version: 0.5.0.0 +version: 0.5.0.1 maintainer: haskell-open-source@noredink.com copyright: 2023 NoRedInk Corp. github: NoRedInk/haskell-libraries/nri-http @@ -15,7 +15,7 @@ extra-source-files: library: dependencies: - aeson >= 2.0 && < 2.2 - - base >= 4.16.4.0 && < 4.18 + - base >= 4.16.4.0 && < 4.19 - bytestring >= 0.10.8.2 && < 0.12 - nri-prelude >= 0.1.0.0 && < 0.7 - nri-observability >= 0.1.0.0 && < 0.3 @@ -36,7 +36,7 @@ tests: spec: dependencies: - aeson >= 2.0 && < 2.2 - - base >= 4.12.0.0 && < 4.17 + - base >= 4.12.0.0 && < 4.19 - bytestring >= 0.10.8.2 && < 0.12 - nri-prelude >= 0.1.0.0 && < 0.7 - nri-observability >= 0.1.0.0 && < 0.2 diff --git a/nri-kafka/CHANGELOG.md b/nri-kafka/CHANGELOG.md index f549985b..c41c51ac 100644 --- a/nri-kafka/CHANGELOG.md +++ b/nri-kafka/CHANGELOG.md @@ -1,6 +1,7 @@ # 0.2.0.1 - Drop support for `aeson-1.x` +- Support GHC 9.6.5 # 0.2.0.0 diff --git a/nri-kafka/nri-kafka.cabal b/nri-kafka/nri-kafka.cabal index 1b01204b..47f90ca4 100644 --- a/nri-kafka/nri-kafka.cabal +++ b/nri-kafka/nri-kafka.cabal @@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: nri-kafka -version: 0.2.0.0 +version: 0.2.0.1 synopsis: Functions for working with Kafka description: Please see the README at . category: Web @@ -69,7 +69,7 @@ library build-depends: aeson >=2.0 && <2.2 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , bytestring >=0.10.8.2 && <0.12 , conduit >=1.3.0 && <1.4 , containers >=0.6.0.1 && <0.7 @@ -81,7 +81,7 @@ library , stm >=2.4 && <2.6 , text >=1.2.3.1 && <2.1 , time >=1.8.0.2 && <2 - , unix >=2.7.2.2 && <2.8.0.0 + , unix >=2.7.2.2 && <2.9 , uuid >=1.3.0 && <1.4 default-language: Haskell2010 @@ -113,7 +113,7 @@ executable pause-resume-bug-consumer build-depends: aeson >=2.0 && <2.2 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , bytestring >=0.10.8.2 && <0.12 , conduit >=1.3.0 && <1.4 , containers >=0.6.0.1 && <0.7 @@ -126,7 +126,7 @@ executable pause-resume-bug-consumer , stm >=2.4 && <2.6 , text >=1.2.3.1 && <2.1 , time >=1.8.0.2 && <2 - , unix >=2.7.2.2 && <2.8.0.0 + , unix >=2.7.2.2 && <2.9 , uuid >=1.3.0 && <1.4 default-language: Haskell2010 if flag(pause-resume-bug) @@ -162,7 +162,7 @@ executable pause-resume-bug-producer build-depends: aeson >=2.0 && <2.2 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , bytestring >=0.10.8.2 && <0.12 , conduit >=1.3.0 && <1.4 , containers >=0.6.0.1 && <0.7 @@ -175,7 +175,7 @@ executable pause-resume-bug-producer , stm >=2.4 && <2.6 , text >=1.2.3.1 && <2.1 , time >=1.8.0.2 && <2 - , unix >=2.7.2.2 && <2.8.0.0 + , unix >=2.7.2.2 && <2.9 , uuid >=1.3.0 && <1.4 default-language: Haskell2010 if flag(pause-resume-bug) @@ -226,7 +226,7 @@ test-suite tests build-depends: aeson >=2.0 && <2.2 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , bytestring >=0.10.8.2 && <0.12 , conduit >=1.3.0 && <1.4 , containers >=0.6.0.1 && <0.7 @@ -238,6 +238,6 @@ test-suite tests , stm >=2.4 && <2.6 , text >=1.2.3.1 && <2.1 , time >=1.8.0.2 && <2 - , unix >=2.7.2.2 && <2.8.0.0 + , unix >=2.7.2.2 && <2.9 , uuid >=1.3.0 && <1.4 default-language: Haskell2010 diff --git a/nri-kafka/package.yaml b/nri-kafka/package.yaml index 60b9fb2f..e4385e17 100644 --- a/nri-kafka/package.yaml +++ b/nri-kafka/package.yaml @@ -3,7 +3,7 @@ synopsis: Functions for working with Kafka description: Please see the README at . homepage: https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-kafka#readme author: NoRedInk -version: 0.2.0.0 +version: 0.2.0.1 maintainer: haskell-open-source@noredink.com copyright: 2023 NoRedInk Corp. github: NoRedInk/haskell-libraries/nri-kafka @@ -16,7 +16,7 @@ extra-source-files: dependencies: - aeson >= 2.0 && < 2.2 - async >=2.2.2 && <2.3 - - base >= 4.16.4.0 && < 4.18 + - base >= 4.16.4.0 && < 4.19 - bytestring >= 0.10.8.2 && < 0.12 - conduit >= 1.3.0 && < 1.4 - containers >= 0.6.0.1 && < 0.7 @@ -28,7 +28,7 @@ dependencies: - stm >= 2.4 && < 2.6 - text >= 1.2.3.1 && < 2.1 - time >= 1.8.0.2 && < 2 - - unix >= 2.7.2.2 && < 2.8.0.0 + - unix >= 2.7.2.2 && < 2.9 - uuid >=1.3.0 && < 1.4 library: exposed-modules: diff --git a/nri-log-explorer/CHANGELOG.md b/nri-log-explorer/CHANGELOG.md index 91d98cc1..1504becb 100644 --- a/nri-log-explorer/CHANGELOG.md +++ b/nri-log-explorer/CHANGELOG.md @@ -1,6 +1,7 @@ # 0.2.0.1 - Drop support for `aeson-1.x` +- Support GHC 9.6.5 # 0.2.0.0 diff --git a/nri-log-explorer/nri-log-explorer.cabal b/nri-log-explorer/nri-log-explorer.cabal index f9c56579..128cd5c0 100644 --- a/nri-log-explorer/nri-log-explorer.cabal +++ b/nri-log-explorer/nri-log-explorer.cabal @@ -1,11 +1,11 @@ cabal-version: 1.18 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: nri-log-explorer -version: 0.2.0.0 +version: 0.2.0.1 synopsis: Explore logs produced by nri-prelude tests. description: Please see the README at . category: Web @@ -52,7 +52,7 @@ executable log-explorer aeson >=2.0 && <2.2 , aeson-pretty >=0.8.0 && <0.9 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , brick >=0.51 && <0.72 , bytestring >=0.10.8.2 && <0.12 , directory >=1.3.3.0 && <1.4 diff --git a/nri-log-explorer/package.yaml b/nri-log-explorer/package.yaml index d49150ea..de41fd31 100644 --- a/nri-log-explorer/package.yaml +++ b/nri-log-explorer/package.yaml @@ -3,7 +3,7 @@ synopsis: Explore logs produced by nri-prelude tests. description: Please see the README at . homepage: https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-log-explorer#readme author: NoRedInk -version: 0.2.0.0 +version: 0.2.0.1 maintainer: haskell-open-source@noredink.com copyright: 2023 NoRedInk Corp. github: NoRedInk/haskell-libraries @@ -19,7 +19,7 @@ executables: - aeson >= 2.0 && < 2.2 - aeson-pretty >= 0.8.0 && < 0.9 - async >= 2.2.2 && < 2.3 - - base >= 4.16.4.0 && < 4.18 + - base >= 4.16.4.0 && < 4.19 - brick >= 0.51 && < 0.72 - bytestring >= 0.10.8.2 && < 0.12 - directory >= 1.3.3.0 && < 1.4 diff --git a/nri-observability/CHANGELOG.md b/nri-observability/CHANGELOG.md index 1f44227e..0ed54ddb 100644 --- a/nri-observability/CHANGELOG.md +++ b/nri-observability/CHANGELOG.md @@ -1,6 +1,7 @@ # 0.2.0.1 - Drop support for `aeson-1.x` +- Support GHC 9.6.5 # 0.2.0.0 diff --git a/nri-observability/nri-observability.cabal b/nri-observability/nri-observability.cabal index 2e779147..ebb6c94a 100644 --- a/nri-observability/nri-observability.cabal +++ b/nri-observability/nri-observability.cabal @@ -1,11 +1,11 @@ cabal-version: 1.18 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: nri-observability -version: 0.2.0.0 +version: 0.2.0.1 synopsis: Report log spans collected by nri-prelude. description: Please see the README at . category: Web @@ -68,7 +68,7 @@ library aeson >=2.0 && <2.2 , aeson-pretty >=0.8.0 && <0.9 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , bugsnag-hs >=0.1.0.0 && <0.3 , bytestring >=0.10.8.2 && <0.12 , conduit >=1.3.0 && <1.4 @@ -137,7 +137,7 @@ test-suite tests aeson >=2.0 && <2.2 , aeson-pretty >=0.8.0 && <0.9 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , bugsnag-hs >=0.1.0.0 && <0.3 , bytestring >=0.10.8.2 && <0.12 , conduit >=1.3.0 && <1.4 diff --git a/nri-observability/package.yaml b/nri-observability/package.yaml index 97e867e8..a2dc5e55 100644 --- a/nri-observability/package.yaml +++ b/nri-observability/package.yaml @@ -3,7 +3,7 @@ synopsis: Report log spans collected by nri-prelude. description: Please see the README at . homepage: https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-observability#readme author: NoRedInk -version: 0.2.0.0 +version: 0.2.0.1 maintainer: haskell-open-source@noredink.com copyright: 2023 NoRedInk Corp. github: NoRedInk/haskell-libraries/observability @@ -17,7 +17,7 @@ dependencies: - aeson >= 2.0 && < 2.2 - aeson-pretty >= 0.8.0 && < 0.9 - async >= 2.2.2 && < 2.3 - - base >= 4.16.4.0 && < 4.18 + - base >= 4.16.4.0 && < 4.19 - bugsnag-hs >= 0.1.0.0 && < 0.3 - bytestring >= 0.10.8.2 && < 0.12 - conduit >= 1.3.0 && < 1.4 diff --git a/nri-postgresql/CHANGELOG.md b/nri-postgresql/CHANGELOG.md index afac61db..ab577b40 100644 --- a/nri-postgresql/CHANGELOG.md +++ b/nri-postgresql/CHANGELOG.md @@ -2,6 +2,7 @@ - Drop support for `aeson-1.x` - Allow `resourcet-1.3.x` +- Support GHC 9.6.5 # 0.2.0.0 diff --git a/nri-postgresql/nri-postgresql.cabal b/nri-postgresql/nri-postgresql.cabal index 8531637b..799245f2 100644 --- a/nri-postgresql/nri-postgresql.cabal +++ b/nri-postgresql/nri-postgresql.cabal @@ -62,7 +62,7 @@ library ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin build-depends: attoparsec >=0.13.0.0 && <0.15 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , bytestring >=0.10.8.2 && <0.12 , filepath >=1.4.2.1 && <1.5 , network >=3.1.0.0 && <3.2 @@ -73,7 +73,7 @@ library , resource-pool >=0.2.0.0 && <0.5 , resourcet >=1.2.0 && <1.4 , safe-exceptions >=0.1.7.0 && <1.3 - , template-haskell >=2.15.0.0 && <2.20 + , template-haskell >=2.15.0.0 && <2.21 , text >=1.2.3.1 && <2.1 , time >=1.8.0.2 && <2 default-language: Haskell2010 @@ -120,7 +120,7 @@ test-suite tests ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin -threaded -rtsopts "-with-rtsopts=-N -T" -fno-warn-type-defaults build-depends: attoparsec >=0.13.0.0 && <0.15 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , bytestring >=0.10.8.2 && <0.12 , filepath >=1.4.2.1 && <1.5 , network >=3.1.0.0 && <3.2 @@ -131,7 +131,7 @@ test-suite tests , resource-pool >=0.2.0.0 && <0.5 , resourcet >=1.2.0 && <1.4 , safe-exceptions >=0.1.7.0 && <1.3 - , template-haskell >=2.15.0.0 && <2.20 + , template-haskell >=2.15.0.0 && <2.21 , text >=1.2.3.1 && <2.1 , th-test-utils , time >=1.8.0.2 && <2 diff --git a/nri-postgresql/package.yaml b/nri-postgresql/package.yaml index d98923f0..289a0ee3 100644 --- a/nri-postgresql/package.yaml +++ b/nri-postgresql/package.yaml @@ -17,7 +17,7 @@ extra-source-files: - "test/golden-results/*" dependencies: - attoparsec >= 0.13.0.0 && < 0.15 -- base >= 4.16.4.0 && < 4.18 +- base >= 4.16.4.0 && < 4.19 - bytestring >= 0.10.8.2 && < 0.12 - filepath >= 1.4.2.1 && < 1.5 - network >= 3.1.0.0 && < 3.2 @@ -28,7 +28,7 @@ dependencies: - resource-pool >= 0.2.0.0 && < 0.5 - resourcet >= 1.2.0 && < 1.4 - safe-exceptions >= 0.1.7.0 && < 1.3 -- template-haskell >= 2.15.0.0 && < 2.20 +- template-haskell >= 2.15.0.0 && < 2.21 - text >= 1.2.3.1 && < 2.1 - time >= 1.8.0.2 && < 2 default-extensions: diff --git a/nri-prelude/CHANGELOG.md b/nri-prelude/CHANGELOG.md index b65e4311..b44897d4 100644 --- a/nri-prelude/CHANGELOG.md +++ b/nri-prelude/CHANGELOG.md @@ -1,6 +1,7 @@ # Unreleased - Drop support for GHC 8.10.7, `aeson-1.x` +- Support GHC 9.6.5 - Allow specifying where devlogs for log-explorer go through `NRI_DEV_LOG` environment variable. - Added `putText` and `putTextLn` functions for thread-safe console printing. - Allow `hedgehog-1.4.x` diff --git a/nri-prelude/nri-prelude.cabal b/nri-prelude/nri-prelude.cabal index ef2620ed..eeb05b3a 100644 --- a/nri-prelude/nri-prelude.cabal +++ b/nri-prelude/nri-prelude.cabal @@ -91,7 +91,7 @@ library , async >=2.2.2 && <2.3 , attoparsec >=0.13.0.0 && <0.15 , auto-update >=0.1.6 && <0.2 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , bytestring >=0.10.8.2 && <0.12 , containers >=0.6.0.1 && <0.7 , directory >=1.3.3.0 && <1.4 @@ -109,7 +109,7 @@ library , terminal-size >=0.3.2.1 && <0.4 , text >=1.2.3.1 && <2.1 , time >=1.8.0.2 && <2 - , unix >=2.7.2.2 && <2.8.0.0 + , unix >=2.7.2.2 && <2.9 , vector >=0.12.1.2 && <0.14 default-language: Haskell2010 @@ -189,7 +189,7 @@ test-suite tests , async >=2.2.2 && <2.3 , attoparsec >=0.13.0.0 && <0.15 , auto-update >=0.1.6 && <0.2 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , bytestring >=0.10.8.2 && <0.12 , containers >=0.6.0.1 && <0.7 , directory >=1.3.3.0 && <1.4 @@ -207,6 +207,6 @@ test-suite tests , terminal-size >=0.3.2.1 && <0.4 , text >=1.2.3.1 && <2.1 , time >=1.8.0.2 && <2 - , unix >=2.7.2.2 && <2.8.0.0 + , unix >=2.7.2.2 && <2.9 , vector >=0.12.1.2 && <0.14 default-language: Haskell2010 diff --git a/nri-prelude/package.yaml b/nri-prelude/package.yaml index f04fb3f0..e0ced374 100644 --- a/nri-prelude/package.yaml +++ b/nri-prelude/package.yaml @@ -22,7 +22,7 @@ library: - async >= 2.2.2 && < 2.3 - attoparsec >= 0.13.0.0 && < 0.15 - auto-update >= 0.1.6 && < 0.2 - - base >= 4.16.4.0 && < 4.18 + - base >= 4.16.4.0 && < 4.19 - bytestring >= 0.10.8.2 && < 0.12 - containers >= 0.6.0.1 && < 0.7 - directory >= 1.3.3.0 && < 1.4 @@ -40,7 +40,7 @@ library: - terminal-size >= 0.3.2.1 && < 0.4 - text >= 1.2.3.1 && < 2.1 - time >= 1.8.0.2 && < 2 - - unix >= 2.7.2.2 && < 2.8.0.0 + - unix >= 2.7.2.2 && < 2.9 - vector >= 0.12.1.2 && < 0.14 exposed-modules: - Array diff --git a/nri-prelude/src/NriPrelude/Plugin.hs b/nri-prelude/src/NriPrelude/Plugin.hs index 35ae4f2c..0be1ab59 100644 --- a/nri-prelude/src/NriPrelude/Plugin.hs +++ b/nri-prelude/src/NriPrelude/Plugin.hs @@ -27,7 +27,7 @@ import qualified GHC.Hs import qualified GHC.Parser.Annotation import qualified GHC.Plugins -import NriPrelude.Plugin.GhcVersionDependent (withParsedResult) +import NriPrelude.Plugin.GhcVersionDependent (setIDeclImplicit, withParsedResult) import qualified Set import Prelude @@ -105,7 +105,7 @@ addImplicitImports _ _ parsed = unqualified name = GHC.Parser.Annotation.noLocA (GHC.Hs.simpleImportDecl (GHC.Plugins.mkModuleName name)) - & fmap (\qual -> qual {GHC.Hs.ideclImplicit = True}) + & fmap (setIDeclImplicit True) qualified name = fmap (\qual -> qual {GHC.Hs.ideclQualified = GHC.Hs.QualifiedPre}) (unqualified name) diff --git a/nri-prelude/src/NriPrelude/Plugin/GhcVersionDependent.hs b/nri-prelude/src/NriPrelude/Plugin/GhcVersionDependent.hs index 1e859e67..d8957232 100644 --- a/nri-prelude/src/NriPrelude/Plugin/GhcVersionDependent.hs +++ b/nri-prelude/src/NriPrelude/Plugin/GhcVersionDependent.hs @@ -5,22 +5,42 @@ -- right values dependent on the version of GHC. module NriPrelude.Plugin.GhcVersionDependent ( + setIDeclImplicit, withParsedResult ) where -import GHC.Hs (HsParsedModule) +import qualified GHC.Hs +import qualified GHC.Hs.ImpExp +import Prelude #if __GLASGOW_HASKELL__ >= 904 import qualified GHC.Driver.Plugins #endif #if __GLASGOW_HASKELL__ >= 904 -withParsedResult :: GHC.Driver.Plugins.ParsedResult -> (HsParsedModule -> HsParsedModule) -> GHC.Driver.Plugins.ParsedResult +withParsedResult :: GHC.Driver.Plugins.ParsedResult -> (GHC.Hs.HsParsedModule -> GHC.Hs.HsParsedModule) -> GHC.Driver.Plugins.ParsedResult withParsedResult parsed f = parsed { GHC.Driver.Plugins.parsedResultModule = f (GHC.Driver.Plugins.parsedResultModule parsed) } #else -withParsedResult :: HsParsedModule -> (HsParsedModule -> HsParsedModule) -> HsParsedModule +withParsedResult :: GHC.Hs.HsParsedModule -> (GHC.Hs.HsParsedModule -> GHC.Hs.HsParsedModule) -> GHC.Hs.HsParsedModule withParsedResult parsed f = f parsed #endif + +#if __GLASGOW_HASKELL__ >= 906 +setIDeclImplicit :: Bool -> GHC.Hs.ImpExp.ImportDecl GHC.Hs.GhcPs -> GHC.Hs.ImpExp.ImportDecl GHC.Hs.GhcPs +setIDeclImplicit isImplicit importDecl = + -- no idea what `XImportDeclPass` _is_, btw. just following types + -- ref: https://hackage.haskell.org/package/ghc-9.6.5/docs/Language-Haskell-Syntax-ImpExp.html#t:ImportDecl + -- https://hackage.haskell.org/package/ghc-9.6.5/docs/Language-Haskell-Syntax-Extension.html#t:XCImportDecl + -- https://hackage.haskell.org/package/ghc-9.6.5/docs/GHC-Hs-ImpExp.html#t:XImportDeclPass + let xImportDeclPass = GHC.Hs.ImpExp.ideclExt importDecl + in importDecl + { GHC.Hs.ImpExp.ideclExt = + xImportDeclPass {GHC.Hs.ImpExp.ideclImplicit = isImplicit} + } +#else +setIDeclImplicit :: Bool -> GHC.Hs.ImpExp.ImportDecl GHC.Hs.GhcPs -> GHC.Hs.ImpExp.ImportDecl GHC.Hs.GhcPs +setIDeclImplicit isImplicit importDecl = importDecl {GHC.Hs.ImpExp.ideclImplicit = isImplicit} +#endif diff --git a/nri-redis/CHANGELOG.md b/nri-redis/CHANGELOG.md index 888d7120..edf369b8 100644 --- a/nri-redis/CHANGELOG.md +++ b/nri-redis/CHANGELOG.md @@ -2,6 +2,7 @@ - Drop support for `aeson-1.x` - Allow `resourcet-1.3.x`, `megaparsec-9.5.x` +- Support GHC 9.6.5 # 0.2.0.0 diff --git a/nri-redis/nri-redis.cabal b/nri-redis/nri-redis.cabal index 7c23b7fd..b7743624 100644 --- a/nri-redis/nri-redis.cabal +++ b/nri-redis/nri-redis.cabal @@ -65,7 +65,7 @@ library build-depends: aeson >=2.0 && <2.2 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , bytestring >=0.10.8.2 && <0.12 , conduit >=1.3.0 && <1.4 , containers >=0.6.0.1 && <0.7 @@ -130,7 +130,7 @@ test-suite tests build-depends: aeson >=2.0 && <2.2 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , bytestring >=0.10.8.2 && <0.12 , conduit >=1.3.0 && <1.4 , containers >=0.6.0.1 && <0.7 diff --git a/nri-redis/package.yaml b/nri-redis/package.yaml index 06f7bde0..049c82d4 100644 --- a/nri-redis/package.yaml +++ b/nri-redis/package.yaml @@ -16,7 +16,7 @@ extra-doc-files: dependencies: - aeson >= 2.0 && < 2.2 - async >=2.2.2 && <2.3 - - base >= 4.16.4.0 && < 4.18 + - base >= 4.16.4.0 && < 4.19 - bytestring >= 0.10.8.2 && < 0.12 - conduit >= 1.3.0 && < 1.4 - containers >= 0.6.0.1 && < 0.7 diff --git a/nri-test-encoding/CHANGELOG.md b/nri-test-encoding/CHANGELOG.md index a95ce741..b46ee050 100644 --- a/nri-test-encoding/CHANGELOG.md +++ b/nri-test-encoding/CHANGELOG.md @@ -2,6 +2,7 @@ - Drop support for `aeson-1.x` - Allow `servant-0.20.x` +- Support GHC 9.6.5 # 0.2.0.0 diff --git a/nri-test-encoding/nri-test-encoding.cabal b/nri-test-encoding/nri-test-encoding.cabal index 20d822d5..2f6409a7 100644 --- a/nri-test-encoding/nri-test-encoding.cabal +++ b/nri-test-encoding/nri-test-encoding.cabal @@ -55,7 +55,7 @@ library build-depends: aeson >=2.0 && <2.2 , aeson-pretty >=0.8.0 && <0.9 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , bytestring >=0.10.8.2 && <0.12 , filepath >=1.4.2.1 && <1.5 , nri-prelude >=0.1.0.0 && <0.7 @@ -96,7 +96,7 @@ test-suite tests build-depends: aeson >=2.0 && <2.2 , aeson-pretty >=0.8.0 && <0.9 - , base >=4.16.4.0 && <4.18 + , base >=4.16.4.0 && <4.19 , bytestring >=0.10.8.2 && <0.12 , filepath >=1.4.2.1 && <1.5 , nri-prelude >=0.1.0.0 && <0.7 diff --git a/nri-test-encoding/package.yaml b/nri-test-encoding/package.yaml index f7e25b54..aaef4b34 100644 --- a/nri-test-encoding/package.yaml +++ b/nri-test-encoding/package.yaml @@ -16,7 +16,7 @@ extra-doc-files: dependencies: - aeson >= 2.0 && < 2.2 - aeson-pretty >=0.8.0 && < 0.9 - - base >= 4.16.4.0 && < 4.18 + - base >= 4.16.4.0 && < 4.19 - bytestring >= 0.10.8.2 && < 0.12 - filepath >= 1.4.2.1 && < 1.5 - servant >= 0.16.2 && < 0.21 diff --git a/shell-ghc-9-6.nix b/shell-ghc-9-6.nix new file mode 100644 index 00000000..5a38c754 --- /dev/null +++ b/shell-ghc-9-6.nix @@ -0,0 +1,8 @@ +let + sources = import ./nix/sources.nix { }; + pkgs = import sources.nixpkgs { }; + commonHaskellOverrides = import ./nix/common-haskell-overrides.nix { inherit sources pkgs; }; +in import nix/mk-shell.nix { + pkgs = pkgs; + haskellPackages = pkgs.haskell.packages.ghc965.extend commonHaskellOverrides; +} diff --git a/shell.nix b/shell.nix index 84149658..25006034 120000 --- a/shell.nix +++ b/shell.nix @@ -1 +1 @@ -shell-ghc-9-4.nix \ No newline at end of file +shell-ghc-9-6.nix \ No newline at end of file From 1c43e430a44fc3c5e00178c58ee2c100b280defd Mon Sep 17 00:00:00 2001 From: Jinnah Ali-Clarke Date: Wed, 7 Aug 2024 12:32:04 -0400 Subject: [PATCH 9/9] fix link to plugin docs --- nri-prelude/src/NriPrelude/Plugin.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nri-prelude/src/NriPrelude/Plugin.hs b/nri-prelude/src/NriPrelude/Plugin.hs index 0be1ab59..05b5c158 100644 --- a/nri-prelude/src/NriPrelude/Plugin.hs +++ b/nri-prelude/src/NriPrelude/Plugin.hs @@ -18,7 +18,7 @@ where -- Useful documentation -- - Elm's default imports: https://package.elm-lang.org/packages/elm/core/latest/ -- - GHC user guide on compiler plugins: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/extending_ghc.html#compiler-plugins --- - Module providing API for creating plugins: https://www.stackage.org/haddock/lts-17.4/ghc-lib-8.10.4.20210206/GHC.Plugins.html +-- - Module providing API for creating plugins: https://hackage.haskell.org/package/ghc-lib-9.6.5.20240423/docs/GHC-Plugins.html import Data.Function ((&)) import qualified Data.List