From ca9b54f2aa57cd86e70ded65820514781ff3add6 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Sun, 29 Sep 2024 08:53:06 +0200 Subject: [PATCH] nix: ouroboros-network * Added explicit cabal.project * Removed `-Werror` flags in nix, they are set in `cabal.project.local` files. * Used `doCheckCross` instead of setting `doCheck` flag per package. --- nix/ouroboros-network.nix | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/nix/ouroboros-network.nix b/nix/ouroboros-network.nix index 26e15e6d7d..c4341aaafa 100644 --- a/nix/ouroboros-network.nix +++ b/nix/ouroboros-network.nix @@ -5,7 +5,7 @@ let inherit (prev) lib; inherit (prev) pkgs; inherit (final) haskell-nix; - # inherit (final) pkgs; + buildSystem = pkgs.buildPlatform.system; # default compiler used on all systems, also provided within the shell defaultCompiler = "ghc982"; @@ -104,34 +104,24 @@ let # package customizations as needed. Where cabal.project is not # specific enough, or doesn't allow setting these. modules = [ - (forAllProjectPackages ({ ... }: { - ghcOptions = [ "-Werror" ]; - })) ({ pkgs, ... }: { # We impose limit heap size limit when running some of the tests # to discover space leaks Once #4698 and #4699 are done we can # further constrain the heap size. - preCheck = lib.mkForce '' - export GHCRTS=-M250M - ''; + preCheck = + lib.mkForce + (if buildSystem == "x86_64-linux" + then "export GHCRTS=-M200M" + else ""); + doCrossCheck = lib.mkForce false; # pkgs are instantiated for the host platform packages.ouroboros-network-protocols.components.tests.cddl.build-tools = [ pkgs.cddl pkgs.cbor-diag ]; packages.ouroboros-network-protocols.components.tests.cddl.preCheck = "export HOME=`pwd`"; # don't run checks using Wine when cross compiling - packages.quickcheck-monoids.components.tests.test.doCheck = !pkgs.stdenv.hostPlatform.isWindows; - packages.ntp-client.components.tests.test.doCheck = !pkgs.stdenv.hostPlatform.isWindows; - packages.network-mux.components.tests.test.doCheck = !pkgs.stdenv.hostPlatform.isWindows; - packages.network-mux.components.tests.test.preCheck = "export GHCRTS=-M500M"; - packages.ouroboros-network-api.components.tests.test.doCheck = !pkgs.stdenv.hostPlatform.isWindows; - packages.ouroboros-network-protocols.components.tests.test.doCheck = !pkgs.stdenv.hostPlatform.isWindows; - packages.ouroboros-network-framework.components.tests.sim-tests.doCheck = !pkgs.stdenv.hostPlatform.isWindows; - packages.ouroboros-network-framework.components.tests.io-tests.doCheck = !pkgs.stdenv.hostPlatform.isWindows; - packages.ouroboros-network-framework.components.tests.bench.doCheck = !pkgs.stdenv.hostPlatform.isWindows; - packages.ouroboros-network.components.tests.sim-tests.doCheck = !pkgs.stdenv.hostPlatform.isWindows; - packages.ouroboros-network.components.tests.io-tests.doCheck = !pkgs.stdenv.hostPlatform.isWindows; - packages.cardano-client.components.tests.test.doCheck = !pkgs.stdenv.hostPlatform.isWindows; + packages.network-mux.components.tests.test.preCheck = + lib.optionalAttrs (buildSystem == "x86_64-linux") "export GHCRTS=-M500M"; }) ]; });