Skip to content

Commit 5978255

Browse files
Merge #143 fx for GHC 9.0; Cabal layout & moving -rtsopts
2 parents c582d0a + b36c585 commit 5978255

File tree

5 files changed

+112
-103
lines changed

5 files changed

+112
-103
lines changed

hnix-store-core/hnix-store-core.cabal

Lines changed: 58 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: hnix-store-core
33
version: 0.4.2.0
44
synopsis: Core effects for interacting with the Nix store.
55
description:
6-
This package contains types and functions needed to describe
7-
interactions with the Nix store abstracted away from
8-
specific effectful context.
6+
This package contains types and functions needed to describe
7+
interactions with the Nix store abstracted away from
8+
specific effectful context.
99
homepage: https://github.com/haskell-nix/hnix-store
1010
license: Apache-2.0
1111
license-file: LICENSE
@@ -14,10 +14,11 @@ maintainer: [email protected]
1414
copyright: 2018 Shea Levy
1515
category: Nix
1616
build-type: Simple
17-
extra-source-files: ChangeLog.md
18-
, README.md
19-
, tests/samples/example0.drv
20-
, tests/samples/example1.drv
17+
extra-source-files:
18+
ChangeLog.md
19+
, README.md
20+
, tests/samples/example0.drv
21+
, tests/samples/example1.drv
2122

2223
Common commons
2324
if impl(ghc >= 8.10)
@@ -27,47 +28,49 @@ Common commons
2728

2829
library
2930
import: commons
30-
exposed-modules: System.Nix.Base32
31-
, System.Nix.Build
32-
, System.Nix.Derivation
33-
, System.Nix.Hash
34-
, System.Nix.Internal.Base32
35-
, System.Nix.Internal.Hash
36-
, System.Nix.Internal.Nar.Parser
37-
, System.Nix.Internal.Nar.Streamer
38-
, System.Nix.Internal.Nar.Effects
39-
, System.Nix.Internal.Signature
40-
, System.Nix.Internal.StorePath
41-
, System.Nix.Nar
42-
, System.Nix.ReadonlyStore
43-
, System.Nix.Signature
44-
, System.Nix.StorePath
45-
, System.Nix.StorePathMetadata
46-
build-depends: base >=4.10 && <5
47-
, attoparsec
48-
, algebraic-graphs >= 0.5 && < 0.6
49-
, base16-bytestring
50-
, base64-bytestring
51-
, bytestring
52-
, cereal
53-
, containers
54-
, cryptohash-md5
55-
, cryptohash-sha1
56-
, cryptohash-sha256
57-
, cryptohash-sha512
58-
, directory
59-
, filepath
60-
, hashable
61-
, lifted-base
62-
, monad-control
63-
, mtl
64-
, nix-derivation >= 1.1.1 && <2
65-
, saltine
66-
, time
67-
, text
68-
, unix
69-
, unordered-containers
70-
, vector
31+
exposed-modules:
32+
System.Nix.Base32
33+
, System.Nix.Build
34+
, System.Nix.Derivation
35+
, System.Nix.Hash
36+
, System.Nix.Internal.Base32
37+
, System.Nix.Internal.Hash
38+
, System.Nix.Internal.Nar.Parser
39+
, System.Nix.Internal.Nar.Streamer
40+
, System.Nix.Internal.Nar.Effects
41+
, System.Nix.Internal.Signature
42+
, System.Nix.Internal.StorePath
43+
, System.Nix.Nar
44+
, System.Nix.ReadonlyStore
45+
, System.Nix.Signature
46+
, System.Nix.StorePath
47+
, System.Nix.StorePathMetadata
48+
build-depends:
49+
base >=4.10 && <5
50+
, attoparsec
51+
, algebraic-graphs >= 0.5 && < 0.6
52+
, base16-bytestring
53+
, base64-bytestring
54+
, bytestring
55+
, cereal
56+
, containers
57+
, cryptohash-md5
58+
, cryptohash-sha1
59+
, cryptohash-sha256
60+
, cryptohash-sha512
61+
, directory
62+
, filepath
63+
, hashable
64+
, lifted-base
65+
, monad-control
66+
, mtl
67+
, nix-derivation >= 1.1.1 && <2
68+
, saltine
69+
, time
70+
, text
71+
, unix
72+
, unordered-containers
73+
, vector
7174
hs-source-dirs: src
7275
default-language: Haskell2010
7376

@@ -79,17 +82,17 @@ test-suite format-tests
7982
import: commons
8083
if flag(bounded_memory)
8184
cpp-options: -DBOUNDED_MEMORY
82-
ghc-options: -rtsopts -fprof-auto
85+
ghc-options: -rtsopts -fprof-auto
8386
type: exitcode-stdio-1.0
8487
main-is: Driver.hs
8588
other-modules:
86-
Arbitrary
87-
Derivation
88-
NarFormat
89-
Hash
90-
StorePath
89+
Arbitrary
90+
Derivation
91+
NarFormat
92+
Hash
93+
StorePath
9194
hs-source-dirs:
92-
tests
95+
tests
9396
build-tool-depends:
9497
tasty-discover:tasty-discover
9598
build-depends:

hnix-store-core/src/System/Nix/ReadonlyStore.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ makeTextPath fp nm h refs = makeStorePath fp ty h nm
4545

4646
makeFixedOutputPath
4747
:: forall hashAlgo
48-
. (ValidAlgo hashAlgo, NamedAlgo hashAlgo)
48+
. ( ValidAlgo hashAlgo
49+
, NamedAlgo hashAlgo
50+
)
4951
=> FilePath
5052
-> Bool
5153
-> Digest hashAlgo
@@ -57,7 +59,7 @@ makeFixedOutputPath fp recursive h =
5759
else makeStorePath fp "output:out" h'
5860
where
5961
h' =
60-
hash @ 'SHA256
62+
hash @'SHA256
6163
$ "fixed:out:"
6264
<> encodeUtf8 (algoName @hashAlgo)
6365
<> (if recursive then ":r:" else ":")

hnix-store-remote/hnix-store-remote.cabal

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,29 @@ flag io-testsuite
2828

2929
library
3030
import: commons
31-
exposed-modules: System.Nix.Store.Remote
32-
, System.Nix.Store.Remote.Binary
33-
, System.Nix.Store.Remote.Builders
34-
, System.Nix.Store.Remote.Logger
35-
, System.Nix.Store.Remote.Parsers
36-
, System.Nix.Store.Remote.Protocol
37-
, System.Nix.Store.Remote.Types
38-
, System.Nix.Store.Remote.Util
31+
exposed-modules:
32+
System.Nix.Store.Remote
33+
, System.Nix.Store.Remote.Binary
34+
, System.Nix.Store.Remote.Builders
35+
, System.Nix.Store.Remote.Logger
36+
, System.Nix.Store.Remote.Parsers
37+
, System.Nix.Store.Remote.Protocol
38+
, System.Nix.Store.Remote.Types
39+
, System.Nix.Store.Remote.Util
3940

40-
build-depends: base >=4.10 && <5
41-
, attoparsec
42-
, binary
43-
, bytestring
44-
, containers
45-
, text
46-
, time
47-
, network
48-
, nix-derivation >= 1.1.1 && <2
49-
, mtl
50-
, unordered-containers
51-
, hnix-store-core >= 0.4 && <0.5
41+
build-depends:
42+
base >=4.10 && <5
43+
, attoparsec
44+
, binary
45+
, bytestring
46+
, containers
47+
, text
48+
, time
49+
, network
50+
, nix-derivation >= 1.1.1 && <2
51+
, mtl
52+
, unordered-containers
53+
, hnix-store-core >= 0.4 && <0.5
5254
hs-source-dirs: src
5355
default-language: Haskell2010
5456
ghc-options: -Wall
@@ -58,34 +60,36 @@ test-suite hnix-store-remote-tests
5860

5961
if !flag(io-testsuite)
6062
buildable: False
63+
ghc-options: -rtsopts -fprof-auto
6164

62-
ghc-options: -rtsopts -fprof-auto
6365
type: exitcode-stdio-1.0
6466
main-is: Driver.hs
65-
other-modules: Derivation
66-
, NixDaemon
67-
, Spec
68-
, Util
67+
other-modules:
68+
Derivation
69+
, NixDaemon
70+
, Spec
71+
, Util
6972
hs-source-dirs: tests
7073
build-tool-depends:
7174
tasty-discover:tasty-discover
72-
build-depends: base
73-
, hnix-store-core >= 0.3
74-
, hnix-store-remote
75-
, containers
76-
, directory
77-
, process
78-
, filepath
79-
, hspec-expectations-lifted
80-
, quickcheck-text
81-
, tasty
82-
, tasty-hspec
83-
, tasty-quickcheck
84-
, linux-namespaces
85-
, nix-derivation
86-
, temporary
87-
, text
88-
, unix
89-
, unordered-containers
90-
, vector
75+
build-depends:
76+
base
77+
, hnix-store-core >= 0.3
78+
, hnix-store-remote
79+
, containers
80+
, directory
81+
, process
82+
, filepath
83+
, hspec-expectations-lifted
84+
, quickcheck-text
85+
, tasty
86+
, tasty-hspec
87+
, tasty-quickcheck
88+
, linux-namespaces
89+
, nix-derivation
90+
, temporary
91+
, text
92+
, unix
93+
, unordered-containers
94+
, vector
9195
default-language: Haskell2010

hnix-store-remote/tests/Derivation.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ withBash action = do
4848
Nothing -> error "No bash executable found"
4949
Just fp -> do
5050
let Right n = System.Nix.StorePath.makeStorePathName "bash"
51-
pth <- addToStore @ 'SHA256 n fp False (pure True) False
51+
pth <- addToStore @'SHA256 n fp False (pure True) False
5252
action pth
5353

5454
withBuildScript :: (StorePath -> MonadStore a) -> MonadStore a

hnix-store-remote/tests/NixDaemon.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ spec_protocol = Hspec.around withNixDaemon $
259259
itRights "adds file to store" $ do
260260
fp <- liftIO $ writeSystemTempFile "addition" "lal"
261261
let Right n = makeStorePathName "tmp-addition"
262-
res <- addToStore @ 'SHA256 n fp False (pure True) False
262+
res <- addToStore @'SHA256 n fp False (pure True) False
263263
liftIO $ print res
264264

265265
context "with dummy" $ do

0 commit comments

Comments
 (0)