Skip to content

Commit

Permalink
Use io-classes-1.2 and strict-checked-vars-0.1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
coot committed Aug 2, 2023
1 parent 51e0c80 commit 1cd3318
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 37 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/cabal.project.local
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ ignore-project: False
tests: True
benchmarks: True

package strict-stm
flags: +checktvarinvariant
-- TODO: we only verify it with nix
-- package strict-checked-vars
-- flags: +checktvarinvariants +checkmvarinvariants

program-options
ghc-options: -Werror
Expand All @@ -21,9 +22,6 @@ package io-sim
ghc-options: -Werror
flags: +asserts

package io-classes
flags: +checktvarinvariant

package typed-protocols
ghc-options: -Werror

Expand Down
4 changes: 2 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ repository cardano-haskell-packages
index-state: 2023-03-29T00:00:00Z
index-state:
-- Bump this if you need newer packages from Hackage
, hackage.haskell.org 2023-05-29T09:27:07Z
, hackage.haskell.org 2023-07-28T17:40:00Z
-- Bump this if you need newer packages from CHaP
, cardano-haskell-packages 2023-05-16T03:39:10Z
, cardano-haskell-packages 2023-08-02T10:58:44Z

packages: ./cardano-ping
./monoidal-synchronisation
Expand Down
2 changes: 1 addition & 1 deletion cardano-client/cardano-client.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ library
build-depends: base >=4.14 && <4.19,
bytestring >=0.10 && <0.12,
containers,
io-classes ^>=1.1,
io-classes ^>=1.2,
ouroboros-network-api,
ouroboros-network,
ouroboros-network-framework,
Expand Down
2 changes: 1 addition & 1 deletion cardano-ping/cardano-ping.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ library
contra-tracer >=0.1 && <0.2,
time,

si-timers ^>=1.1,
si-timers ^>=1.2,
strict-stm,

network-mux ^>=0.4,
Expand Down
7 changes: 1 addition & 6 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,13 @@ let

checks = recurseIntoAttrs {
# `checks.tests` collect results of executing the tests:
tests = collectChecks' haskellPackages;
tests = collectChecks' haskellPackagesWithTVarCheck;
styles = recurseIntoAttrs {
check-nixfmt = callPackage ./nix/check-nixfmt.nix { };
check-stylish = callPackage ./nix/check-stylish.nix { };
};
};

nightly-checks.tvar-invariant-checks = recurseIntoAttrs {
inherit haskellPackagesWithTVarCheck;
tests = collectChecks' haskellPackagesWithTVarCheck;
};

shell = import ./shell.nix {
inherit pkgs;
withHoogle = true;
Expand Down
2 changes: 1 addition & 1 deletion network-mux/network-mux.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ common demo-deps

library
build-depends: base >=4.14 && <4.19,
io-classes ^>=1.1,
io-classes ^>=1.2,
strict-stm,
si-timers,
contra-tracer >=0.1 && <0.2,
Expand Down
6 changes: 3 additions & 3 deletions nix/ouroboros-network.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
, profiling ? config.haskellNix.profiling or false
, libsodium-vrf ? pkgs.libsodium-vrf, secp256k1 ? pkgs.secp256k1
# Enable strict TVar invariant check flag in strict-stm
, checkTVarInvariant ? false }:
, checkTVarInvariants ? false }:
let
compiler-nix-name = pkgs.localConfig.ghcVersion;
src = haskell-nix.haskellLib.cleanGit {
Expand Down Expand Up @@ -50,8 +50,8 @@ let
});
}
{
packages.strict-stm.components.library.configureFlags = lib.mkForce
(if checkTVarInvariant then [ "-f checktvarinvariant" ] else [ ]);
packages.strict-checked-vars.components.library.configureFlags = lib.mkForce
(if checkTVarInvariants then [ "-f +checktvarinvariants" ] else [ ]);
}
({ pkgs, ... }: {
# Apply profiling arg to all library components in the build:
Expand Down
2 changes: 1 addition & 1 deletion nix/pkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ in {
ouroborosNetworkHaskellPackagesWithTVarCheck =
import ./ouroboros-network.nix {
inherit config pkgs lib stdenv haskell-nix buildPackages;
checkTVarInvariant = true;
checkTVarInvariants = true;
inherit (sources) CHaP;
};

Expand Down
12 changes: 6 additions & 6 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"homepage": "https://input-output-hk.github.io/cardano-haskell-packages/",
"owner": "input-output-hk",
"repo": "cardano-haskell-packages",
"rev": "91f934baa24dcef5e2bd61bfdc9aad3d0a7437b8",
"sha256": "16d9bd0sdjiwyc8201z978x8avrif0k9vfak3l63r2i2bdv13dxs",
"rev": "0ced21474b5c8a4ce8320c1f61d5b9fcef3e3029",
"sha256": "18lnwi82z987y14n47rnnq2a0cchnx2iwkc2n7axfxgyidpid9fa",
"type": "tarball",
"url": "https://github.com/input-output-hk/cardano-haskell-packages/archive/91f934baa24dcef5e2bd61bfdc9aad3d0a7437b8.tar.gz",
"url": "https://github.com/input-output-hk/cardano-haskell-packages/archive/0ced21474b5c8a4ce8320c1f61d5b9fcef3e3029.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"hackage.nix": {
Expand All @@ -17,10 +17,10 @@
"homepage": "",
"owner": "input-output-hk",
"repo": "hackage.nix",
"rev": "1cf7e1a3746cc285aeebb0f87fbed10e23aa6b70",
"sha256": "1ph3jvz0n6g2c8p01nlm2vh6m5pqhpil03my1xjxm10rsckipbh3",
"rev": "4e6c3592ff197354762f3272515245ca862608ca",
"sha256": "1n3305hvl65yh2cizp5k6n620nk57nabdki3l67g4x1f2imjf5hb",
"type": "tarball",
"url": "https://github.com/input-output-hk/hackage.nix/archive/1cf7e1a3746cc285aeebb0f87fbed10e23aa6b70.tar.gz",
"url": "https://github.com/input-output-hk/hackage.nix/archive/4e6c3592ff197354762f3272515245ca862608ca.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz",
"version": "b3c99d7f13df89a9a918c835ecb7114098912962"
},
Expand Down
4 changes: 2 additions & 2 deletions ouroboros-network-api/ouroboros-network-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ library
cardano-strict-containers,
contra-tracer,

io-classes ^>=1.1,
io-classes ^>=1.2,
network-mux ^>=0.4,
strict-stm,
si-timers,
typed-protocols ^>=0.1.0.4,
typed-protocols ^>=0.1.0.6,

ghc-options: -Wall
-Wno-unticked-promoted-constructors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ library
, cardano-prelude
, contra-tracer

, io-classes ^>=1.1
, io-classes ^>=1.2
, si-timers
, strict-stm

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ library
bytestring >=0.10 && <0.12,
cborg >=0.2.1 && <0.3,

io-classes ^>=1.1,
io-classes ^>=1.2,
si-timers,

ouroboros-network-api
Expand Down
2 changes: 1 addition & 1 deletion ouroboros-network-testing/ouroboros-network-testing.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ library
containers,
contra-tracer,
deque ^>=0.4,
io-classes ^>=1.1,
io-classes ^>=1.2,
io-sim,
psqueues >=0.2.3 && <0.3,
si-timers,
Expand Down
5 changes: 3 additions & 2 deletions ouroboros-network/ouroboros-network.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,16 @@ library
cardano-strict-containers,
contra-tracer,
monoidal-synchronisation,
strict-checked-vars ^>= 0.1.0.1,

io-classes ^>=1.1,
io-classes ^>=1.2,
io-classes-mtl ^>=0.1,
network-mux,
si-timers,
ouroboros-network-api ^>=0.5,
ouroboros-network-framework ^>=0.7,
ouroboros-network-protocols ^>=0.5.1.0,
strict-stm ^>=1.1.0.1,
strict-stm,
typed-protocols >=0.1.0.4 && <1.0,
if !os(windows)
build-depends: directory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ module Ouroboros.Network.PeerSelection.PeerMetric
, newPeerMetric'
) where

import Control.Concurrent.Class.MonadSTM.Strict
import Control.Concurrent.Class.MonadSTM.Strict.TVar.Checked.Switch
import Control.Monad.Class.MonadSTM
import Control.DeepSeq (NFData (..))
import Control.Monad (when)
import Control.Monad.Class.MonadTime.SI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import NoThunks.Class (NoThunks (..), unsafeNoThunks)

import Cardano.Prelude (forceElemsToWHNF)

import Control.Concurrent.Class.MonadSTM.Strict
import Control.Concurrent.Class.MonadSTM.Strict.TVar.Checked.Switch
import Control.Monad.Class.MonadSTM
import Control.Exception (assert)
import Control.Monad (unless)
import Control.Monad.Class.MonadThrow
Expand Down
4 changes: 2 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# It just takes the shell attribute from default.nix.
{ config ? { }, sourcesOverride ? { }, withHoogle ? false
, pkgs ? import ./nix { inherit config sourcesOverride; }
, checkTVarInvariant ? false }:
, checkTVarInvariants ? false }:
with pkgs;
let
hsPkgs = if checkTVarInvariant then
hsPkgs = if checkTVarInvariants then
ouroborosNetworkHaskellPackagesWithTVarCheck
else
ouroborosNetworkHaskellPackages;
Expand Down

0 comments on commit 1cd3318

Please sign in to comment.