From d3f3813bf6e24fb26ad76977887a68ec9d5aa740 Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Fri, 6 Oct 2023 17:29:38 -0400 Subject: [PATCH 1/2] Upgrade stackage to LTS 21.14, relax some upper bounds and adjust hasql-pool acquire call accordingly --- postgres-websockets.cabal | 22 +++++++++++----------- src/PostgresWebsockets/Context.hs | 2 +- stack.yaml | 5 +---- stack.yaml.lock | 31 +++++-------------------------- 4 files changed, 18 insertions(+), 42 deletions(-) diff --git a/postgres-websockets.cabal b/postgres-websockets.cabal index 8e26953..a18cd6e 100644 --- a/postgres-websockets.cabal +++ b/postgres-websockets.cabal @@ -27,8 +27,8 @@ library , PostgresWebsockets.Middleware , PostgresWebsockets.Context build-depends: base >= 4.7 && < 5 - , hasql-pool >= 0.8 && < 0.9 - , text >= 1.2 && < 1.3 + , hasql-pool >= 0.8 && < 0.10 + , text >= 1.2 && < 2.1 , wai >= 3.2 && < 4 , websockets >= 0.9 && < 0.13 , wai-websockets >= 3.0 && < 4 @@ -38,15 +38,15 @@ library , lens >= 4.17.1 , jose >= 0.6 , unordered-containers >= 0.2 - , aeson >= 2.0 && < 2.1 + , aeson >= 2.0 && < 2.2 , protolude >= 0.2.3 && < 0.4 , hasql >= 1.4.1 , hasql-notifications >= 0.1.0.0 && < 0.3 , either >= 5.0.1.1 && < 5.1 - , stm-containers >= 1.1.0.2 && < 1.2 + , stm-containers >= 1.1.0.2 && < 1.3 , stm >= 2.5.0.0 && < 2.6 - , retry >= 0.8.1.0 && < 0.9 - , time >= 1.8.0.2 && < 1.12 + , retry >= 0.8.1.0 && < 0.10 + , time >= 1.8.0.2 && < 1.13 , alarmclock >= 0.7.0.2 && < 0.8 , envparse >= 0.4.1 , base64-bytestring >= 1.0.0.3 && < 1.3 @@ -82,19 +82,19 @@ test-suite postgres-websockets-test build-depends: base , protolude >= 0.2.3 && < 0.4 , postgres-websockets - , hspec >= 2.7.1 && < 2.10 - , aeson >= 2.0 && < 2.1 + , hspec >= 2.7.1 && < 2.11 + , aeson >= 2.0 && < 2.2 , hasql >= 0.19 - , hasql-pool >= 0.8 && < 0.9 + , hasql-pool >= 0.8 && < 0.10 , hasql-notifications >= 0.1.0.0 && < 0.3 , http-types >= 0.9 - , time >= 1.8.0.2 && < 1.12 + , time >= 1.8.0.2 && < 1.13 , unordered-containers >= 0.2 , wai-extra >= 3.0.29 && < 3.2 , stm >= 2.5.0.0 && < 2.6 , websockets >= 0.12.7.0 && < 0.13 , network >= 2.8.0.1 && < 3.2 - , lens >= 4.17.1 && < 5.2 + , lens >= 4.17.1 && < 5.3 , lens-aeson ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N default-language: Haskell2010 diff --git a/src/PostgresWebsockets/Context.hs b/src/PostgresWebsockets/Context.hs index b413643..03dc3db 100644 --- a/src/PostgresWebsockets/Context.hs +++ b/src/PostgresWebsockets/Context.hs @@ -31,7 +31,7 @@ data Context = Context mkContext :: AppConfig -> IO () -> IO Context mkContext conf@AppConfig {..} shutdownServer = do Context conf - <$> P.acquire configPool (Just 10000) pgSettings + <$> P.acquire configPool 10000 10000 pgSettings <*> newHasqlBroadcaster shutdown (toS configListenChannel) configRetries configReconnectInterval pgSettings <*> mkGetTime where diff --git a/stack.yaml b/stack.yaml index 455d7d0..a30018f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,8 +1,5 @@ -resolver: lts-20.12 +resolver: lts-21.14 extra-deps: -- exceptions-0.10.4@sha256:7ed09aed03683d5b4337088061106c2389d274b3472031a330ff1b220bad2b2d,2796 -- retry-0.8.1.2@sha256:b81e7d7e5f068da82349a3c157a2ab25d399c9ca4841d1b6e54e8c4050cb065f,2189 -- stm-containers-1.1.0.5@sha256:dffad326e360cf937840bf61f00c6e7dcc4fe62b4db420bf51266b08559f5020,3248 packages: - . diff --git a/stack.yaml.lock b/stack.yaml.lock index 3bfecb5..31decf5 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -3,31 +3,10 @@ # For more information, please see the documentation at: # https://docs.haskellstack.org/en/stable/lock_files -packages: -- completed: - hackage: exceptions-0.10.4@sha256:7ed09aed03683d5b4337088061106c2389d274b3472031a330ff1b220bad2b2d,2796 - pantry-tree: - sha256: f1eb6efc7f747444de23771bef8ac4d4c2f0e2f99bb149d72a9441d8df022263 - size: 908 - original: - hackage: exceptions-0.10.4@sha256:7ed09aed03683d5b4337088061106c2389d274b3472031a330ff1b220bad2b2d,2796 -- completed: - hackage: retry-0.8.1.2@sha256:b81e7d7e5f068da82349a3c157a2ab25d399c9ca4841d1b6e54e8c4050cb065f,2189 - pantry-tree: - sha256: a9ebf74c0fce47b4e743c4d1a2c72fcc949a702e5790fa2784c835db17492012 - size: 433 - original: - hackage: retry-0.8.1.2@sha256:b81e7d7e5f068da82349a3c157a2ab25d399c9ca4841d1b6e54e8c4050cb065f,2189 -- completed: - hackage: stm-containers-1.1.0.5@sha256:dffad326e360cf937840bf61f00c6e7dcc4fe62b4db420bf51266b08559f5020,3248 - pantry-tree: - sha256: e09db5d8233874c789dad634896b0240e40c6a5fcdce055730cd62b1a6f94cb4 - size: 761 - original: - hackage: stm-containers-1.1.0.5@sha256:dffad326e360cf937840bf61f00c6e7dcc4fe62b4db420bf51266b08559f5020,3248 +packages: [] snapshots: - completed: - sha256: af5d667f6096e535b9c725a72cffe0f6c060e0568d9f9eeda04caee70d0d9d2d - size: 649133 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/12.yaml - original: lts-20.12 + sha256: 60e54c1ba3c1e7163acf6dafa9d56b2d3b23f88a31ad53a1c9d888f32561f8da + size: 639819 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/14.yaml + original: lts-21.14 From f98b832623a1c6c20242f4a8871579d69555e3ce Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Fri, 6 Oct 2023 18:07:03 -0400 Subject: [PATCH 2/2] Update Dockerfiles --- Dockerfile | 2 +- Dockerfile.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index abc492d..bc8eaa3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use Alpine Linux as base image -FROM alpine:3.17 +FROM alpine:edge # Install libpq and gmp dependencies (dynamic libraries required by the project) RUN apk update && apk add libpq gmp libffi diff --git a/Dockerfile.build b/Dockerfile.build index b180f7a..5e06379 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -1,4 +1,4 @@ -FROM alpine:3.17 +FROM alpine:edge RUN apk add --update ca-certificates openssl && update-ca-certificates