Skip to content

Commit

Permalink
Fixed build of tls package (#1816)
Browse files Browse the repository at this point in the history
* Fixed build of tls package

* jailbreak connection

* Try a different tls version

* fixed connection

* Revert "Try a different tls version"

This reverts commit b29aca4.

* Create http-client-tls.nix

* updated nixpkgs

* update lockfile

* Fixes

* Update mkGhcCompiler.nix

* Update mkGhcCompiler.nix

* fixed graphql tests

* updated nixpkgs

* Fixed build
  • Loading branch information
mpscholten authored Sep 12, 2023
1 parent 814488e commit 14c8c40
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 25 deletions.
28 changes: 28 additions & 0 deletions NixSupport/haskell-packages/typerep-map.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ mkDerivation, base, containers, criterion, deepseq, dependent-map
, dependent-sum, ghc-prim, ghc-typelits-knownnat, hedgehog, hspec
, hspec-hedgehog, lib, primitive, vector, fetchFromGitHub
}:
mkDerivation {
pname = "typerep-map";
version = "0.6.0.0";
libraryHaskellDepends = [
base containers deepseq ghc-prim primitive vector
];
testHaskellDepends = [
base ghc-typelits-knownnat hedgehog hspec hspec-hedgehog
];
benchmarkHaskellDepends = [
base criterion deepseq dependent-map dependent-sum
ghc-typelits-knownnat
];
doHaddock = false;
homepage = "https://github.com/kowainik/typerep-map";
description = "Efficient implementation of a dependent map with types as keys";
license = lib.licenses.mpl20;
src = fetchFromGitHub {
owner = "alaendle";
repo = "typerep-map";
rev = "444d377fac1d0941721233737ee65b631ea3d056";
sha256 = "sha256-BU/BvOI920QTW9MCfQyz+8zTRa0Ayx8i6R3matzRAIs";
};
}
29 changes: 29 additions & 0 deletions NixSupport/haskell-packages/xconnection.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{ mkDerivation, base, basement, bytestring, containers
, data-default-class, lib, network, socks, tls, x509, x509-store
, x509-system, x509-validation, fetchFromGitHub
, crypton-x509-system
, crypton-x509-validation
, crypton-x509-store
, crypton-x509
}:
mkDerivation {
pname = "connection";
version = "0.4.1";
libraryHaskellDepends = [
base basement bytestring containers data-default-class network
socks tls x509 x509-store x509-system x509-validation
crypton-x509-system
crypton-x509-validation
crypton-x509-store
crypton-x509
];
homepage = "https://github.com/vincenthz/hs-connection";
description = "Simple and easy network connections API";
license = lib.licenses.bsd3;
src = fetchFromGitHub {
owner = "vincenthz";
repo = "hs-connection";
rev = "1dc000d38963de0e4c3954b27d4fe0e5f1d9cee2";
sha256 = "sha256-yyKmEYMdCmicz3jSe1UOD/t3Bsgukb9pWeY0NZPP39Q";
};
}
23 changes: 23 additions & 0 deletions NixSupport/haskell-packages/xhttp-client-tls.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{ mkDerivation, base, bytestring, case-insensitive, containers
, crypton, crypton-connection, data-default-class, exceptions
, gauge, hspec, http-client, http-types, lib, memory, network
, network-uri, text, tls, transformers
}:
mkDerivation {
pname = "http-client-tls";
version = "0.3.6.3";
sha256 = "15chmlnq0nk2kxhk65r9xdjkzl94k0axcml89a5qkdiffwyzrp1q";
libraryHaskellDepends = [
base bytestring case-insensitive containers crypton
crypton-connection data-default-class exceptions http-client
http-types memory network network-uri text tls transformers
];
testHaskellDepends = [
base crypton-connection hspec http-client http-types
];
benchmarkHaskellDepends = [ base gauge http-client ];
doCheck = false;
homepage = "https://github.com/snoyberg/http-client";
description = "http-client backend using the connection package and tls library";
license = lib.licenses.mit;
}
29 changes: 29 additions & 0 deletions NixSupport/haskell-packages/xtls.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{ mkDerivation, asn1-encoding, asn1-types, async, base, bytestring
, cereal, crypton, crypton-x509, crypton-x509-store
, crypton-x509-validation, data-default-class, gauge, hourglass
, lib, memory, mtl, network, QuickCheck, tasty, tasty-quickcheck
, transformers, unix-time
}:
mkDerivation {
pname = "tls";
version = "1.9.0";
sha256 = "0gj3af9sqd0bw7dpcqfyvbslpxsk2ij00a77kl710fwhw35vj1an";
libraryHaskellDepends = [
asn1-encoding asn1-types async base bytestring cereal crypton
crypton-x509 crypton-x509-store crypton-x509-validation
data-default-class memory mtl network transformers unix-time
];
testHaskellDepends = [
asn1-types async base bytestring crypton crypton-x509
crypton-x509-validation data-default-class hourglass QuickCheck
tasty tasty-quickcheck
];
benchmarkHaskellDepends = [
asn1-types async base bytestring crypton crypton-x509
crypton-x509-validation data-default-class gauge hourglass
QuickCheck tasty-quickcheck
];
homepage = "https://github.com/haskell-tls/hs-tls";
description = "TLS/SSL protocol native implementation (Server and Client)";
license = lib.licenses.bsd3;
}
2 changes: 1 addition & 1 deletion NixSupport/mkGhcCompiler.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ let
builtins.listToAttrs (map toPackage names);

ihpDontCheckPackages = [ "mmark" "mmark-ext" "mutable-containers" "hiedb" "hls-fourmolu-plugin" "relude" "inflections" ];
ihpDoJailbreakPackages = [ "haskell-to-elm" "ip" "ghc-syntax-highlighter" "relude" "hs-brotli" "tuples" "singletons-th" "singletons-base" "inflections" "postgresql-simple" "with-utf8" "chell" "zigzag" "typerep-map" "relude" "bytebuild" ];
ihpDoJailbreakPackages = [ "haskell-to-elm" "ip" "ghc-syntax-highlighter" "relude" "hs-brotli" "tuples" "singletons-th" "singletons-base" "inflections" "postgresql-simple" "with-utf8" "chell" "zigzag" "typerep-map" "relude" "bytebuild" "connection" "microlens" "microlens-th"];
ihpDontHaddockPackages = [ ];
in ghcCompiler.override {
overrides = composeExtensionsList [
Expand Down
5 changes: 4 additions & 1 deletion flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ ihpFlake:
};

devenv.shells.default = lib.mkIf cfg.enable {
packages = [ ghcCompiler.ihp pkgs.postgresql_13 pkgs.gnumake ] ++ cfg.packages;
packages = [ ghcCompiler.ihp pkgs.postgresql_13 pkgs.gnumake ]
++ cfg.packages
++ [pkgs.mktemp] # Without this 'make build/bin/RunUnoptimizedProdServer' fails on macOS
;

/*
we currently don't use devenv containers, and they break nix flake show
Expand Down
40 changes: 20 additions & 20 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

inputs = {
# TODO use nixpkgs-unstable and just .lock a version?
nixpkgs.url = "github:NixOS/nixpkgs?rev=277bf961c323b6cde46932cc9308135d0687af95";
nixpkgs.url = "github:NixOS/nixpkgs?rev=ff303118b2ec262eb342eab88ae79318fac66d52";

# pre-defined set of default target systems
systems.url = "github:nix-systems/default";
Expand Down
4 changes: 2 additions & 2 deletions ihp-graphql/Test/GraphQL/CompilerSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ tests = do
|] }
]
compileGQL mutation arguments `shouldBe` [trimming|
INSERT INTO projects (user_id, title) VALUES ('dc984c2f-d91c-4143-9091-400ad2333f83', 'Hello World') RETURNING json_build_object('id', projects.id, 'title', projects.title)
INSERT INTO projects (title, user_id) VALUES ('Hello World', 'dc984c2f-d91c-4143-9091-400ad2333f83') RETURNING json_build_object('id', projects.id, 'title', projects.title)
|]
it "should compile a delete mutation" do
let mutation = [trimming|
Expand Down Expand Up @@ -118,7 +118,7 @@ tests = do
, argumentValue = parseValue [trimming|"df1f54d5-ced6-4f65-8aea-fcd5ea6b9df1"|] }
]
compileGQL mutation arguments `shouldBe` [trimming|
UPDATE projects SET user_id = 'dc984c2f-d91c-4143-9091-400ad2333f83', title = 'Hello World' WHERE id = 'df1f54d5-ced6-4f65-8aea-fcd5ea6b9df1' RETURNING json_build_object('id', projects.id, 'title', projects.title)
UPDATE projects SET title = 'Hello World', user_id = 'dc984c2f-d91c-4143-9091-400ad2333f83' WHERE id = 'df1f54d5-ced6-4f65-8aea-fcd5ea6b9df1' RETURNING json_build_object('id', projects.id, 'title', projects.title)
|]

compileGQL gql arguments = gql
Expand Down

0 comments on commit 14c8c40

Please sign in to comment.