|
150 | 150 | echo "file binary-dist $out/$NAME" > $out/nix-support/hydra-build-products
|
151 | 151 | '';
|
152 | 152 |
|
| 153 | + isCross = pkgs: |
| 154 | + with pkgs.haskell-nix.haskellLib; isNativeMusl || isCrossHost; |
| 155 | + |
153 | 156 | project = (nixpkgs.haskell-nix.cabalProject' ({ config, lib, pkgs, ... }: rec {
|
154 | 157 | src = ./.;
|
155 | 158 | name = "cardano-db-sync";
|
|
220 | 223 | [ "../schema/*.sql" ];
|
221 | 224 | })
|
222 | 225 |
|
223 |
| - |
224 | 226 | ({ lib, pkgs, config, ... }: {
|
225 | 227 | # lib:ghc is a bit annoying in that it comes with it's own build-type:Custom, and then tries
|
226 | 228 | # to call out to all kinds of silly tools that GHC doesn't really provide.
|
227 | 229 | # For this reason, we try to get away without re-installing lib:ghc for now.
|
228 | 230 | reinstallableLibGhc = false;
|
229 | 231 | })
|
230 | 232 |
|
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 |
| - |
245 | 233 | (pkgs.lib.mkIf pkgs.hostPlatform.isMusl
|
246 | 234 | (let
|
247 | 235 | ghcOptions = [
|
|
318 | 306 | ];
|
319 | 307 | })
|
320 | 308 |
|
| 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 | + |
321 | 333 | ({ lib, pkgs, config, ... }: lib.mkIf pkgs.hostPlatform.isMacOS {
|
322 | 334 | # PostgreSQL tests fail in Hydra on MacOS with:
|
323 | 335 | #
|
|
332 | 344 | packages.cardano-chain-gen.components.tests.cardano-chain-gen.doCheck = false;
|
333 | 345 | packages.cardano-db.components.tests.test-db.doCheck = false;
|
334 | 346 | })
|
| 347 | + |
335 | 348 | ];
|
336 | 349 | })).appendOverlays [
|
337 | 350 | # Collect local package `exe`s
|
|
0 commit comments