Skip to content

Commit

Permalink
bump nixpkgs (#4365)
Browse files Browse the repository at this point in the history
Co-authored-by: Akshay Mankar <[email protected]>
Co-authored-by: Matthias Fischmann <[email protected]>
Co-authored-by: Sven Tennie <[email protected]>
  • Loading branch information
4 people authored Dec 13, 2024
1 parent d142082 commit 9dbcc71
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 18 deletions.
1 change: 1 addition & 0 deletions changelog.d/3-bug-fixes/WPB-14537
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix `gzip filter failed to use preallocated memory` alerts in nginz by upgrading
6 changes: 6 additions & 0 deletions libs/wai-utilities/src/Network/Wai/Utilities/Response.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ json = responseLBS status200 [jsonContent] . encode
jsonContent :: Header
jsonContent = (hContentType, "application/json")

html :: Lazy.ByteString -> Response
html = responseLBS status200 [htmlContent]

htmlContent :: Header
htmlContent = (hContentType, "text/html; charset=UTF-8")

errorRs :: Error -> Response
errorRs e = setStatus (code e) (json e)

Expand Down
2 changes: 1 addition & 1 deletion libs/wire-api/src/Wire/API/Routes/Internal/Brig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -785,5 +785,5 @@ brigInternalClient = namedClient @API @name @BrigInternalClient
runBrigInternalClient :: HTTP.Manager -> Endpoint -> BrigInternalClient a -> IO (Either Servant.ClientError a)
runBrigInternalClient httpMgr (Endpoint brigHost brigPort) (BrigInternalClient action) = do
let baseUrl = Servant.BaseUrl Servant.Http (Text.unpack brigHost) (fromIntegral brigPort) ""
clientEnv = Servant.ClientEnv httpMgr baseUrl Nothing Servant.defaultMakeClientRequest
clientEnv = Servant.mkClientEnv httpMgr baseUrl
Servant.runClientM action clientEnv
6 changes: 2 additions & 4 deletions libs/wire-api/src/Wire/API/Routes/QualifiedCapture.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,8 @@ instance
qualify handler domain value = handler (Qualified value domain)

instance
( KnownSymbol capture,
ToHttpApiData a,
HasClient m api,
KnownSymbol (AppendSymbol capture "_domain")
( ToHttpApiData a,
HasClient m api
) =>
HasClient m (QualifiedCapture' mods capture a :> api)
where
Expand Down
4 changes: 2 additions & 2 deletions nix/manual-overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ hself: hsuper: {
# version overrides
# (these are fine but will probably need to be adjusted in a future nixpkgs update)
# -----------------
tls = hsuper.tls_2_1_0;
tls = hsuper.tls_2_1_1;
tls-session-manager = hsuper.tls-session-manager_0_0_6;
crypton-connection = hsuper.crypton-connection_0_4_1; # older version doesn't allow tls 2.1
amqp = hlib.dontCheck hsuper.amqp_0_23_0; # older version doesn't allow cryton-connection 0.4.1, this one has broken tests
amqp = hlib.dontCheck hsuper.amqp_0_24_0; # older version doesn't allow cryton-connection 0.4.1, this one has broken tests

# warp requires curl in its testsuite
warp = hlib.addTestToolDepends hsuper.warp [ curl ];
Expand Down
5 changes: 5 additions & 0 deletions nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ let
};

sources = import ./sources.nix;

pkgs_old = import sources.nixpkgs_old { config.allowUnfree = true; };
in

self: super: {
Expand Down Expand Up @@ -109,4 +111,7 @@ self: super: {
rabbitmqadmin = super.callPackage ./pkgs/rabbitmqadmin { };

sbomqs = super.callPackage ./pkgs/sbomqs { };

# FUTUREWORK: Remove this override when vacuum-go has been fixed so it doesn't panic when running `make openapi-validate`
vacuum-go = pkgs_old.vacuum-go;
}
11 changes: 11 additions & 0 deletions nix/sources.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
{
"nixpkgs": {
"branch": "nixpkgs-unstable",
"description": "Nix Packages collection",
"homepage": "https://github.com/NixOS/nixpkgs",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dd51f52372a20a93c219e8216fe528a648ffcbf4",
"sha256": "0wlzlsxnc67zcdl0v6d5bp57a8fn7wmv8mj0jv368n2nfvz0w09m",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/dd51f52372a20a93c219e8216fe528a648ffcbf4.tar.gz"
},
"nixpkgs_old": {
"branch": "nixpkgs-unstable",
"description": "Nix Packages collection",
"homepage": "https://github.com/NixOS/nixpkgs",
Expand Down
19 changes: 10 additions & 9 deletions services/brig/src/Brig/API/Public.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ import Control.Lens ((.~), (?~))
import Control.Monad.Catch (throwM)
import Control.Monad.Except
import Data.Aeson hiding (json)
import Data.ByteString (fromStrict, toStrict)
import Data.ByteString (fromStrict)
import Data.ByteString.Lazy.Char8 qualified as LBS
import Data.ByteString.UTF8 qualified as UTF8
import Data.Code qualified as Code
import Data.CommaSeparatedList
import Data.Default
Expand Down Expand Up @@ -233,14 +232,16 @@ versionedSwaggerDocsAPI (Just (VersionNumber V3)) = swaggerPregenUIServer $(preg
versionedSwaggerDocsAPI (Just (VersionNumber V2)) = swaggerPregenUIServer $(pregenSwagger V2)
versionedSwaggerDocsAPI (Just (VersionNumber V1)) = swaggerPregenUIServer $(pregenSwagger V1)
versionedSwaggerDocsAPI (Just (VersionNumber V0)) = swaggerPregenUIServer $(pregenSwagger V0)
versionedSwaggerDocsAPI Nothing = allroutes (throwError listAllVersionsResp)
versionedSwaggerDocsAPI Nothing = tocPage
where
allroutes ::
(forall a. Servant.Handler a) ->
Servant.Server (SwaggerSchemaUI "swagger-ui" "swagger.json")
allroutes action =
-- why? see 'SwaggerSchemaUI' type.
action :<|> action :<|> action :<|> error (UTF8.toString . toStrict $ listAllVersionsHTML)
-- Renders and returns a table-of-contents page
tocPage :: Servant.Server (SwaggerSchemaUI "swagger-ui" "swagger.json")
tocPage =
let throwingHandler :: forall a. Servant.Handler a
throwingHandler = (throwError listAllVersionsResp)
handler = Tagged @Servant.Handler (\_req k -> k (Utilities.html listAllVersionsHTML))
in -- why? see 'SwaggerSchemaUI' type.
throwingHandler :<|> throwingHandler :<|> throwingHandler :<|> handler

listAllVersionsResp :: ServerError
listAllVersionsResp = ServerError 200 mempty listAllVersionsHTML [("Content-Type", "text/html;charset=utf-8")]
Expand Down
2 changes: 1 addition & 1 deletion services/brig/test/integration/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ runFedClient (FedClient mgr ep) domain =
let brigHost = Text.unpack ep.host
brigPort = fromInteger . toInteger $ ep.port
baseUrl = Servant.BaseUrl Servant.Http brigHost brigPort "/federation"
clientEnv = Servant.ClientEnv mgr baseUrl Nothing (makeClientRequest originDomain)
clientEnv = Servant.ClientEnv mgr baseUrl Nothing (makeClientRequest originDomain) id
eitherRes <- Servant.runClientM action clientEnv
case eitherRes of
Right res -> pure res
Expand Down
2 changes: 1 addition & 1 deletion services/galley/test/integration/TestSetup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ runFedClient (FedClient mgr ep) domain =
let h = Text.unpack ep.host
p = fromInteger $ toInteger ep.port
baseUrl = Servant.BaseUrl Servant.Http h p "/federation"
clientEnv = Servant.ClientEnv mgr baseUrl Nothing (makeClientRequest originDomain)
clientEnv = Servant.ClientEnv mgr baseUrl Nothing (makeClientRequest originDomain) id
eitherRes <- Servant.runClientM action clientEnv
case eitherRes of
Right res -> pure res
Expand Down

0 comments on commit 9dbcc71

Please sign in to comment.