Skip to content

Commit

Permalink
Merge pull request #131 from NoRedInk/foxen/fxn-3752-upgrade-nixpkgs-…
Browse files Browse the repository at this point in the history
…ref-in-monorepo

support ghc 9.8, drop support for ghc 9.2
  • Loading branch information
jali-clarke authored Feb 28, 2025
2 parents daf22fe + a666c63 commit 6b5e27a
Show file tree
Hide file tree
Showing 118 changed files with 477 additions and 454 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
matrix:
runner:
- os: macos-14 # macos sonoma on m1; 3 vcpu, 7 GB memory
base-nixpkgs-channel: nixpkgs-24.05-darwin
base-nixpkgs-channel: nixpkgs-24.11-darwin
- os: ubuntu-22.04 # linux x86_64; 4 vcpu, 16 GB memory
base-nixpkgs-channel: nixos-24.05
base-nixpkgs-channel: nixos-24.11
ghc:
- ghc-9-6
- ghc-9-8
runs-on: ${{ matrix.runner.os }}
steps:
- name: Install Nix
Expand Down
8 changes: 5 additions & 3 deletions nix/common-haskell-overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ self: super:
brick =
pkgs.haskell.lib.doJailbreak (self.callHackage "brick" "0.71.1" { });

# >= 5.39 has breaking changes for [email protected]; pin to 5.38 (known-good)
vty = self.callHackage "vty" "5.38" { };
# >= 5.39 has breaking changes for [email protected]; pin to 5.38 (known-good).
# jailbreak to allow deepseq 1.5.1.0 as provided by ghc 9.8.3
vty =
pkgs.haskell.lib.doJailbreak (self.callHackage "vty" "5.38" { });

# latest master supports ghc 9.4.x
tasty-test-reporter = packageFromSources "tasty-test-reporter";
Expand All @@ -23,6 +25,6 @@ self: super:
# 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
# for now, pin hw-kafka-client to 4.0.3; nixpkgs@release-24.11 provides 5.3.0
hw-kafka-client = self.callHackage "hw-kafka-client" "4.0.3" { };
}
4 changes: 1 addition & 3 deletions nix/mk-shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

# Fix from https://github.com/srid/haskell-template
let
sources = import ./sources.nix { };
pkgs-unstable = import sources.nixpkgs-unstable { };
workaround140774 = hpkg:
with pkgs.haskell.lib;
overrideCabal hpkg (drv: { enableSeparateBinOutput = false; });
Expand Down Expand Up @@ -74,6 +72,6 @@ in pkgs.mkShell {
pkgs.postgresql # for nri-postgres
pkgs.redis # for nri-redis
pkgs.zlib
pkgs-unstable.zookeeper # for nri-kafka
pkgs.zookeeper # for nri-kafka
];
}
20 changes: 4 additions & 16 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,15 @@
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
"branch": "release-24.05",
"branch": "release-24.11",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "59be168c1fcab339bab5fd482d93c995f470cbad",
"sha256": "0am4h3ck2as4lq7b37zlxah8zqm57scjl06y5xkk9islh3jvklmf",
"rev": "2bc8d3dcc2eb6f7d23590b52042e274eda02318e",
"sha256": "0lj7ynnhqc9j9h100xw4bdggz7q730iwvzad8fcr0l1wz2n72lxp",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/59be168c1fcab339bab5fd482d93c995f470cbad.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs-unstable": {
"branch": "nixpkgs-unstable",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4c0834929cafb7478a5e82616d484578a80a3e41",
"sha256": "1ld29fsviq5ax1drh25fxqcxi44g3cisf5hfib29d0qxjqlicbdf",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/4c0834929cafb7478a5e82616d484578a80a3e41.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/2bc8d3dcc2eb6f7d23590b52042e274eda02318e.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"string-qq": {
Expand Down
5 changes: 5 additions & 0 deletions nri-env-parser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.3.0.0

- Drop support for GHC 9.2.x
- Support GHC 9.8.3, `text-2.1.x`

# 0.2.0.1

- Drop support for `aeson-1.x`
Expand Down
12 changes: 6 additions & 6 deletions nri-env-parser/nri-env-parser.cabal
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cabal-version: 1.18

-- This file has been generated from package.yaml by hpack version 0.36.0.
-- This file has been generated from package.yaml by hpack version 0.36.1.
--
-- see: https://github.com/sol/hpack

name: nri-env-parser
version: 0.2.0.1
version: 0.3.0.0
synopsis: Read environment variables as settings to build 12-factor apps.
description: Please see the README at <https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-env-parser#readme>.
category: Web
Expand Down Expand Up @@ -50,11 +50,11 @@ 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.19
base >=4.17 && <4.20
, modern-uri >=0.3.1.0 && <0.4
, network-uri >=2.6.2.0 && <2.8
, nri-prelude >=0.1.0.0 && <0.7
, text >=1.2.3.1 && <2.1
, text >=1.2.3.1 && <2.2
default-language: Haskell2010

test-suite tests
Expand Down Expand Up @@ -83,9 +83,9 @@ 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.19
base >=4.17 && <4.20
, modern-uri >=0.3.1.0 && <0.4
, network-uri >=2.6.2.0 && <2.8
, nri-prelude >=0.1.0.0 && <0.7
, text >=1.2.3.1 && <2.1
, text >=1.2.3.1 && <2.2
default-language: Haskell2010
6 changes: 3 additions & 3 deletions nri-env-parser/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ synopsis: Read environment variables as settings to build 12-factor apps.
description: Please see the README at <https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-env-parser#readme>.
homepage: https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-env-parser#readme
author: NoRedInk
version: 0.2.0.1
version: 0.3.0.0
maintainer: [email protected]
copyright: 2024 NoRedInk Corp.
github: NoRedInk/haskell-libraries/env-parser
Expand All @@ -15,11 +15,11 @@ extra-doc-files:
- CHANGELOG.md
library:
dependencies: &dependencies
- base >= 4.16.4.0 && < 4.19
- base >= 4.17 && < 4.20
- nri-prelude >= 0.1.0.0 && < 0.7
- modern-uri >= 0.3.1.0 && < 0.4
- network-uri >= 2.6.2.0 && < 2.8
- text >= 1.2.3.1 && < 2.1
- text >= 1.2.3.1 && < 2.2
exposed-modules:
- Environment
source-dirs: src
Expand Down
2 changes: 1 addition & 1 deletion nri-env-parser/src/Environment.hs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ instance Applicative Decoder where
}
where
readFromEnvironment' ::
Semigroup err =>
(Semigroup err) =>
(env -> Result err (a -> config)) ->
(env -> Result err a) ->
env ->
Expand Down
5 changes: 5 additions & 0 deletions nri-http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.6.0.0

- Drop support for GHC 9.2.x
- Support GHC 9.8.3, `bytestring-0.12.x.x`, `text-2.1.x`, `aeson-2.2.x.x`

# 0.5.0.3

- Use an `MVar` instead of `IORef` for mocked requests to hopefully reduce flake in cases where concurrent (mocked) requests are being made
Expand Down
24 changes: 12 additions & 12 deletions nri-http/nri-http.cabal
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.36.0.
-- This file has been generated from package.yaml by hpack version 0.36.1.
--
-- see: https://github.com/sol/hpack

name: nri-http
version: 0.5.0.3
version: 0.6.0.0
synopsis: Make Elm style HTTP requests
description: Please see the README at <https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-http#readme>.
category: Web
Expand Down Expand Up @@ -54,20 +54,20 @@ library
NumericUnderscores
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.19
, bytestring >=0.10.8.2 && <0.12
aeson >=2.0 && <2.3
, base >=4.17 && <4.20
, bytestring >=0.10.8.2 && <0.13
, case-insensitive >=1.1 && <2.0
, conduit >=1.3.0 && <1.4
, http-client >=0.6.0 && <0.8
, http-client-tls >=0.3.0 && <0.4
, http-types ==0.12.*
, mime-types >=0.1.0.0 && <0.2
, network-uri >=2.6.0.0 && <2.8
, nri-observability >=0.1.0.0 && <0.3
, nri-observability >=0.1.0.0 && <0.4
, nri-prelude >=0.1.0.0 && <0.7
, safe-exceptions >=0.1.7.0 && <1.3
, text >=1.2.3.1 && <2.1
, text >=1.2.3.1 && <2.2
default-language: Haskell2010

test-suite spec
Expand Down Expand Up @@ -100,20 +100,20 @@ 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 >=2.0 && <2.2
, base >=4.12.0.0 && <4.19
, bytestring >=0.10.8.2 && <0.12
aeson >=2.0 && <2.3
, base >=4.17 && <4.20
, bytestring >=0.10.8.2 && <0.13
, case-insensitive >=1.1 && <2.0
, conduit >=1.3.0 && <1.4
, http-client >=0.6.0 && <0.8
, http-client-tls >=0.3.0 && <0.4
, http-types ==0.12.*
, mime-types >=0.1.0.0 && <0.2
, network-uri >=2.6.0.0 && <2.8
, nri-observability >=0.1.0.0 && <0.2
, nri-observability >=0.1.0.0 && <0.4
, nri-prelude >=0.1.0.0 && <0.7
, safe-exceptions >=0.1.7.0 && <1.3
, text >=1.2.3.1 && <2.1
, text >=1.2.3.1 && <2.2
, wai >=3.2.0 && <3.3
, warp >=3.3.0 && <3.4
default-language: Haskell2010
22 changes: 11 additions & 11 deletions nri-http/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: nri-http
synopsis: Make Elm style HTTP requests
description: Please see the README at <https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-http#readme>.
author: NoRedInk
version: 0.5.0.3
version: 0.6.0.0
maintainer: [email protected]
copyright: 2024 NoRedInk Corp.
github: NoRedInk/haskell-libraries/nri-http
Expand All @@ -14,11 +14,11 @@ extra-source-files:
- "test/golden-results-*/*"
library:
dependencies:
- aeson >= 2.0 && < 2.2
- base >= 4.16.4.0 && < 4.19
- bytestring >= 0.10.8.2 && < 0.12
- aeson >= 2.0 && < 2.3
- base >= 4.17 && < 4.20
- bytestring >= 0.10.8.2 && < 0.13
- nri-prelude >= 0.1.0.0 && < 0.7
- nri-observability >= 0.1.0.0 && < 0.3
- nri-observability >= 0.1.0.0 && < 0.4
- conduit >= 1.3.0 && < 1.4
- case-insensitive >= 1.1 && < 2.0
- http-client >= 0.6.0 && < 0.8
Expand All @@ -27,19 +27,19 @@ library:
- mime-types >= 0.1.0.0 && < 0.2
- network-uri >= 2.6.0.0 && < 2.8
- safe-exceptions >= 0.1.7.0 && < 1.3
- text >= 1.2.3.1 && < 2.1
- text >= 1.2.3.1 && < 2.2
exposed-modules:
- Http
- Http.Mock
source-dirs: src
tests:
spec:
dependencies:
- aeson >= 2.0 && < 2.2
- base >= 4.12.0.0 && < 4.19
- bytestring >= 0.10.8.2 && < 0.12
- aeson >= 2.0 && < 2.3
- base >= 4.17 && < 4.20
- bytestring >= 0.10.8.2 && < 0.13
- nri-prelude >= 0.1.0.0 && < 0.7
- nri-observability >= 0.1.0.0 && < 0.2
- nri-observability >= 0.1.0.0 && < 0.4
- conduit >= 1.3.0 && < 1.4
- case-insensitive >= 1.1 && < 2.0
- http-client >= 0.6.0 && < 0.8
Expand All @@ -48,7 +48,7 @@ tests:
- mime-types >= 0.1.0.0 && < 0.2
- network-uri >= 2.6.0.0 && < 2.8
- safe-exceptions >= 0.1.7.0 && < 1.3
- text >= 1.2.3.1 && < 2.1
- text >= 1.2.3.1 && < 2.2
- wai >= 3.2.0 && < 3.3
- warp >= 3.3.0 && < 3.4
main: Main.hs
Expand Down
4 changes: 2 additions & 2 deletions nri-http/src/Http.hs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ stringBody mimeType text =

-- | Put some JSON value in the body of your Request. This will automatically
-- add the Content-Type: application/json header.
jsonBody :: Aeson.ToJSON body => body -> Body
jsonBody :: (Aeson.ToJSON body) => body -> Body
jsonBody json =
Internal.Body
{ Internal.bodyContents = Aeson.encode json,
Expand Down Expand Up @@ -325,7 +325,7 @@ mkMetadata response =

-- |
-- Expect the response body to be JSON.
expectJson :: Aeson.FromJSON a => Expect a
expectJson :: (Aeson.FromJSON a) => Expect a
expectJson = Internal.ExpectJson

-- |
Expand Down
2 changes: 1 addition & 1 deletion nri-http/src/Http/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type Expect a = Expect' Error a

-- | Logic for interpreting a response body.
data Expect' x a where
ExpectJson :: Aeson.FromJSON a => Expect a
ExpectJson :: (Aeson.FromJSON a) => Expect a
ExpectText :: Expect Text
ExpectWhatever :: Expect ()
ExpectTextResponse :: (Response Text -> Result x a) -> Expect' x a
Expand Down
4 changes: 2 additions & 2 deletions nri-http/src/Http/Mock.hs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ getTextBody req =
-- submitted inside a 'stub' function.
--
-- This will return an error if parsing the JSON body fails.
getJsonBody :: Aeson.FromJSON a => Internal.Request' e expect -> Result Text a
getJsonBody :: (Aeson.FromJSON a) => Internal.Request' e expect -> Result Text a
getJsonBody req =
case Aeson.eitherDecodeStrict (getBytesBody req) of
Prelude.Left err -> Err (Text.fromList err)
Expand Down Expand Up @@ -178,7 +178,7 @@ tryRespond (Stub respond : rest) req =
|> Maybe.andThen Dynamic.fromDynamic
|> Maybe.withDefault (tryRespond rest req)

printType :: Dynamic.Typeable expect => proxy expect -> Text
printType :: (Dynamic.Typeable expect) => proxy expect -> Text
printType expect =
Type.Reflection.someTypeRep expect
|> Debug.toString
5 changes: 2 additions & 3 deletions nri-http/test/GoldenHelpers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ module GoldenHelpers (goldenResultsDir) where
-- > foo
-- > bar
-- > baz
--
--
-- 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 helper around so that if this happens again for future GHC versions
-- we can have different golden results for different GHC versions as necessary.

goldenResultsDir :: Text
goldenResultsDir = "test/golden-results-9.2"
goldenResultsDir = "test/golden-results-9.8"
4 changes: 2 additions & 2 deletions nri-http/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ withServerIO log app run = do
-- immediately returns that request so you can run expectations against it.
--
-- Useful if you want to check properties of requests you send.
expectRequest :: Show e => (Http.Handler -> Text -> Task e a) -> Expect.Expectation' Wai.Request
expectRequest :: (Show e) => (Http.Handler -> Text -> Task e a) -> Expect.Expectation' Wai.Request
expectRequest run = do
let app req _respond = Exception.throwIO (FirstRequest req)
log <- Expect.succeeds Platform.logHandler
Expand All @@ -226,7 +226,7 @@ newtype FirstRequest = FirstRequest Wai.Request deriving (Show)

instance Exception.Exception FirstRequest

spanForTask :: Show e => Task e () -> Expect.Expectation' Platform.TracingSpan
spanForTask :: (Show e) => Task e () -> Expect.Expectation' Platform.TracingSpan
spanForTask task = do
spanVar <- Expect.fromIO MVar.newEmptyMVar
res <-
Expand Down
Loading

0 comments on commit 6b5e27a

Please sign in to comment.