Skip to content

Commit d931022

Browse files
committed
build(nix): Disable native musl integration testing
1 parent 32c03bc commit d931022

File tree

1 file changed

+28
-15
lines changed

1 file changed

+28
-15
lines changed

flake.nix

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@
150150
echo "file binary-dist $out/$NAME" > $out/nix-support/hydra-build-products
151151
'';
152152

153+
isCross = pkgs:
154+
with pkgs.haskell-nix.haskellLib; isNativeMusl || isCrossHost;
155+
153156
project = (nixpkgs.haskell-nix.cabalProject' ({ config, lib, pkgs, ... }: rec {
154157
src = ./.;
155158
name = "cardano-db-sync";
@@ -220,28 +223,13 @@
220223
[ "../schema/*.sql" ];
221224
})
222225

223-
224226
({ lib, pkgs, config, ... }: {
225227
# lib:ghc is a bit annoying in that it comes with it's own build-type:Custom, and then tries
226228
# to call out to all kinds of silly tools that GHC doesn't really provide.
227229
# For this reason, we try to get away without re-installing lib:ghc for now.
228230
reinstallableLibGhc = false;
229231
})
230232

231-
({ pkgs, ... }:
232-
# Database tests
233-
let
234-
postgresTest = {
235-
build-tools = [ pkgs.pkgsBuildHost.postgresql_17 ];
236-
inherit preCheck;
237-
inherit postCheck;
238-
};
239-
in {
240-
packages.cardano-db.components.tests.test-db = postgresTest;
241-
packages.cardano-chain-gen.components.tests.cardano-chain-gen =
242-
postgresTest;
243-
})
244-
245233
(pkgs.lib.mkIf pkgs.hostPlatform.isMusl
246234
(let
247235
ghcOptions = [
@@ -318,6 +306,30 @@
318306
];
319307
})
320308

309+
({ lib, pkgs, ... }:
310+
# Database tests
311+
let
312+
inherit (pkgs.haskell-nix) haskellLib;
313+
314+
postgresTest = {
315+
# Keep postgresql static builds out of shells
316+
build-tools = lib.optional (!isCross pkgs) pkgs.postgresql;
317+
inherit preCheck;
318+
inherit postCheck;
319+
};
320+
in {
321+
packages.cardano-db.components.tests.test-db = postgresTest;
322+
packages.cardano-chain-gen.components.tests.cardano-chain-gen =
323+
postgresTest;
324+
})
325+
326+
({ lib, pkgs, ... }: with pkgs.haskell-nix.haskellLib;
327+
# There's no need to run PostgreSQL integration tests on static builds
328+
lib.mkIf (isCross pkgs) {
329+
packages.cardano-chain-gen.components.tests.cardano-chain-gen.doCheck = false;
330+
packages.cardano-db.components.tests.test-db.doCheck = false;
331+
})
332+
321333
({ lib, pkgs, config, ... }: lib.mkIf pkgs.hostPlatform.isMacOS {
322334
# PostgreSQL tests fail in Hydra on MacOS with:
323335
#
@@ -332,6 +344,7 @@
332344
packages.cardano-chain-gen.components.tests.cardano-chain-gen.doCheck = false;
333345
packages.cardano-db.components.tests.test-db.doCheck = false;
334346
})
347+
335348
];
336349
})).appendOverlays [
337350
# Collect local package `exe`s

0 commit comments

Comments
 (0)