Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 27 additions & 29 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let
fileset = fs.gitTracked ./.;
};
stackYaml = "stack.yaml";
compiler-nix-name = "ghc965";
compiler-nix-name = "ghc966";

modules =
[
Expand All @@ -27,42 +27,40 @@ let
if pkgs.stdenv.isDarwin then
[ ]
else
let
# I'm not sure how linking works. HMAC_Update and HMAC_Final are two symbols present both in
# libssl.a and libcrypto.a, but without including both linking will fail! It is also present
# in pgcommon_shlib (from postgres) but it doesn't work if it comes from there either.
# Also, the order of -lssl and -lcrypto is important here, and this doesn't seem to affect
# dynamically linked glibc builds.
# IMPORTANT: `postgresql` is postgresql 15, not 16. pg16 static builds are failing, see
# https://github.com/NixOS/nixpkgs/issues/191920
# This doesn't seem like a big issue since we only need libpq and we do run tests against
# postgresql-16-the-server.
muslConfigureFlags = [
"--ghc-option=-optl=-L${pkgsMusl.openssl.out}/lib"
"--ghc-option=-optl=-lssl"
"--ghc-option=-optl=-lcrypto"

"--ghc-option=-optl=-L${pkgsMusl.postgresql.out}/lib"
"--ghc-option=-optl=-lpgcommon"
"--ghc-option=-optl=-lpgport"
];
in
[
{
# Apply the same configureFlags to all components so that
# haskell.nix doesn't recompile the library inside exe/test
# derivations due to a configuration mismatch.
packages.codd.components.library.configureFlags = muslConfigureFlags;
packages.codd.components.exes.codd = {
dontStrip = false;
configureFlags = [
# I'm not sure how linking works. HMAC_Update and HMAC_Final are two symbols present both in
# libssl.a and libcrypto.a, but without including both linking will fail! It is also present
# in pgcommon_shlib (from postgres) but it doesn't work if it comes from there either.
# Also, the order of -lssl and -lcrypto is important here, and this doesn't seem to affect
# dynamically linked glibc builds.
# IMPORTANT: `postgresql` is postgresql 15, not 16. pg16 static builds are failing, see
# https://github.com/NixOS/nixpkgs/issues/191920
# This doesn't seem like a big issue since we only need libpq and we do run tests against
# postgresql-16-the-server.
"--ghc-option=-optl=-L${pkgsMusl.openssl.out}/lib"
"--ghc-option=-optl=-lssl"
"--ghc-option=-optl=-lcrypto"

"--ghc-option=-optl=-L${pkgsMusl.postgresql.out}/lib"
"--ghc-option=-optl=-lpgcommon"
"--ghc-option=-optl=-lpgport"
];
configureFlags = muslConfigureFlags;
};

packages.codd.components.tests.codd-test = {
dontStrip = false;
configureFlags = [
# Same as for the executable here
"--ghc-option=-optl=-L${pkgsMusl.openssl.out}/lib"
"--ghc-option=-optl=-lssl"
"--ghc-option=-optl=-lcrypto"

"--ghc-option=-optl=-L${pkgsMusl.postgresql.out}/lib"
"--ghc-option=-optl=-lpgcommon"
"--ghc-option=-optl=-lpgport"
];
configureFlags = muslConfigureFlags;
};
}
]
Expand Down
6 changes: 3 additions & 3 deletions nix/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ let haskellPatchesOverlay = final: prev: {
};
};
haskellNix = import (fetchTarball {
url = "https://github.com/input-output-hk/haskell.nix/archive/6aa8046087d4e6fd70f3b6b99628f77e398e9fd2.tar.gz";
sha256 = "sha256:1wrzkmqkhansgic6x55jjkssq5viis41lwnn3vkyn19818xjylw0";
url = "https://github.com/input-output-hk/haskell.nix/archive/e35f00f2aaee653ce8b504c512a3eb4030517c14.tar.gz";
sha256 = "sha256:ceWHb8+EZJKi+o4dr6/5vp2X+QIdo35I7ZjPc9nfFGU=";
}) {};
nixpkgsImportArgs = haskellNix.nixpkgsArgs // { inherit system; overlays = haskellNix.nixpkgsArgs.overlays ++ [haskellPatchesOverlay ]; };
in
import haskellNix.sources.nixpkgs-2311 nixpkgsImportArgs
import haskellNix.sources.nixpkgs-2405 nixpkgsImportArgs
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-22.22
resolver: lts-22.28

packages:
- .
Expand Down
1 change: 1 addition & 0 deletions test/ParsingSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ validSqlStatements =
<> "\nEND"
<> "\n$do$;",
OtherSqlPiece "CREATE TABLE \"escaped--table /* nasty */\";",
OtherSqlPiece "SELECT x, pg_sleep(x / 1000.0) FROM generate_series(1,1000) q(x);",
OtherSqlPiece "CREATE TABLE any_table();",
OtherSqlPiece $
"CREATE FUNCTION sales_tax(subtotal real) RETURNS real AS $$"
Expand Down