From fa58411e8068b7cb54b0591c127f47a1044dd3d1 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Mon, 14 Mar 2022 13:09:31 +0100 Subject: [PATCH 1/2] nix: added nightly to config flags Use ``` nix-build --arg config '{ nightly = true; }' -A nightly-checks.ouroboros-network-framework ``` to build nightly checks of `ouroboros-network-framework`. --- default.nix | 8 +++++++- nix/ouroboros-network.nix | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index 0677b4c94b5..c591fe3051a 100644 --- a/default.nix +++ b/default.nix @@ -8,7 +8,9 @@ # }' , sourcesOverride ? { } # pinned version of nixpkgs augmented with overlays (iohk-nix and our packages). -, pkgs ? import ./nix { inherit system crossSystem config sourcesOverride; } + , pkgs ? import ./nix { inherit system crossSystem sourcesOverride; + config = { nightly = false; } // config; + } , gitrev ? pkgs.iohkNix.commitIdFromGitRepoOrZero ./.git }: with pkgs; with commonLib; @@ -61,6 +63,10 @@ let haskellPackages.ouroboros-consensus-cardano-test.components.tests.test; Shelley = haskellPackages.ouroboros-consensus-shelley-test.components.tests.test; + ouroboros-network-framework = + haskellPackages.ouroboros-network-framework.components.tests.test; + ouroboros-network = + haskellPackages.ouroboros-network.components.tests.test; }; shell = import ./shell.nix { diff --git a/nix/ouroboros-network.nix b/nix/ouroboros-network.nix index 12eebf2cef4..e869f38dd1b 100644 --- a/nix/ouroboros-network.nix +++ b/nix/ouroboros-network.nix @@ -4,7 +4,8 @@ { lib, stdenv, pkgs, haskell-nix, buildPackages, config ? { } # Enable profiling , profiling ? config.haskellNix.profiling or false -, libsodium-vrf ? pkgs.libsodium-vrf }: +, libsodium-vrf ? pkgs.libsodium-vrf +}: let compiler-nix-name = pkgs.localConfig.ghcVersion; src = haskell-nix.haskellLib.cleanGit { @@ -78,6 +79,7 @@ let "xhtml" # "stm" "terminfo" ]; + packages.ouroboros-network-testing.flags.nightly = config.nightly; # ruby/perl dependencies cannot be cross-built for cddl tests: packages.ouroboros-network.flags.cddl = false; @@ -110,6 +112,7 @@ let # Options for when not compiling to windows: ({ pkgs, ... }: lib.mkIf (!pkgs.stdenv.hostPlatform.isWindows) { + packages.ouroboros-network-testing.flags.nightly = config.nightly; packages.ouroboros-network.flags.cddl = true; packages.ouroboros-network.components.tests.cddl.build-tools = [ pkgs.cddl pkgs.cbor-diag ]; From fd28ef7b624fae7612bdac029483338c8c7226b8 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Mon, 14 Mar 2022 13:10:02 +0100 Subject: [PATCH 2/2] ouroboros-network-framework: utf8 characters are not always well supported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On nix and Windows the following error can be observed ``` : commitBuffer: invalid argument (invalid character) ``` This is misconfiguration of the locale, but the easiest way to fix it is to avoid the `→` character all together. --- .../src/Ouroboros/Network/ConnectionManager/Types.hs | 2 +- .../test/Test/Ouroboros/Network/Server2.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ouroboros-network-framework/src/Ouroboros/Network/ConnectionManager/Types.hs b/ouroboros-network-framework/src/Ouroboros/Network/ConnectionManager/Types.hs index f9517a42914..36430050d04 100644 --- a/ouroboros-network-framework/src/Ouroboros/Network/ConnectionManager/Types.hs +++ b/ouroboros-network-framework/src/Ouroboros/Network/ConnectionManager/Types.hs @@ -874,7 +874,7 @@ instance Show state => Show (Transition' state) where show Transition { fromState, toState } = concat [ show fromState - , " → " + , " -> " , show toState ] diff --git a/ouroboros-network-framework/test/Test/Ouroboros/Network/Server2.hs b/ouroboros-network-framework/test/Test/Ouroboros/Network/Server2.hs index e07699da519..d8fb3fb478a 100644 --- a/ouroboros-network-framework/test/Test/Ouroboros/Network/Server2.hs +++ b/ouroboros-network-framework/test/Test/Ouroboros/Network/Server2.hs @@ -3695,7 +3695,7 @@ splitRemoteConns = ppTransition :: AbstractTransition -> String ppTransition Transition {fromState, toState} = - printf "%-30s → %s" (show fromState) (show toState) + printf "%-30s -> %s" (show fromState) (show toState) ppScript :: (Show peerAddr, Show req) => MultiNodeScript peerAddr req -> String ppScript (MultiNodeScript script _) = intercalate "\n" $ go 0 script