From dfbcc2623e7f5cbc0edaf9edda2a579fa667adf9 Mon Sep 17 00:00:00 2001 From: Marcelo Zabani Date: Sun, 1 Mar 2026 17:44:10 -0300 Subject: [PATCH 1/2] Bumping nixpkgs --- default.nix | 2 +- nix/nixpkgs.nix | 6 +++--- stack.yaml | 2 +- test/ParsingSpec.hs | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/default.nix b/default.nix index 529bf4a2..2722b3dd 100644 --- a/default.nix +++ b/default.nix @@ -10,7 +10,7 @@ let fileset = fs.gitTracked ./.; }; stackYaml = "stack.yaml"; - compiler-nix-name = "ghc965"; + compiler-nix-name = "ghc966"; modules = [ diff --git a/nix/nixpkgs.nix b/nix/nixpkgs.nix index ccb23254..155553be 100644 --- a/nix/nixpkgs.nix +++ b/nix/nixpkgs.nix @@ -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 diff --git a/stack.yaml b/stack.yaml index 93adaa70..bee11a94 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-22.22 +resolver: lts-22.28 packages: - . diff --git a/test/ParsingSpec.hs b/test/ParsingSpec.hs index c27c453c..9e424eee 100644 --- a/test/ParsingSpec.hs +++ b/test/ParsingSpec.hs @@ -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 $$" From 70cbbabde5a2047b0f7f4b98d56e36acc43f1d49 Mon Sep 17 00:00:00 2001 From: Marcelo Zabani Date: Tue, 3 Mar 2026 16:52:51 -0300 Subject: [PATCH 2/2] Avoid double-compilation of every Haskell module --- default.nix | 54 ++++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/default.nix b/default.nix index 2722b3dd..3ba3a54c 100644 --- a/default.nix +++ b/default.nix @@ -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; }; } ]