mirror of
https://github.com/haskell-nix/hnix-store.git
synced 2024-12-13 23:56:37 +03:00
Merge #143 fx for GHC 9.0; Cabal layout & moving -rtsopts
This commit is contained in:
commit
5978255e2e
@ -3,9 +3,9 @@ name: hnix-store-core
|
||||
version: 0.4.2.0
|
||||
synopsis: Core effects for interacting with the Nix store.
|
||||
description:
|
||||
This package contains types and functions needed to describe
|
||||
interactions with the Nix store abstracted away from
|
||||
specific effectful context.
|
||||
This package contains types and functions needed to describe
|
||||
interactions with the Nix store abstracted away from
|
||||
specific effectful context.
|
||||
homepage: https://github.com/haskell-nix/hnix-store
|
||||
license: Apache-2.0
|
||||
license-file: LICENSE
|
||||
@ -14,10 +14,11 @@ maintainer: shea@shealevy.com
|
||||
copyright: 2018 Shea Levy
|
||||
category: Nix
|
||||
build-type: Simple
|
||||
extra-source-files: ChangeLog.md
|
||||
, README.md
|
||||
, tests/samples/example0.drv
|
||||
, tests/samples/example1.drv
|
||||
extra-source-files:
|
||||
ChangeLog.md
|
||||
, README.md
|
||||
, tests/samples/example0.drv
|
||||
, tests/samples/example1.drv
|
||||
|
||||
Common commons
|
||||
if impl(ghc >= 8.10)
|
||||
@ -27,47 +28,49 @@ Common commons
|
||||
|
||||
library
|
||||
import: commons
|
||||
exposed-modules: System.Nix.Base32
|
||||
, System.Nix.Build
|
||||
, System.Nix.Derivation
|
||||
, System.Nix.Hash
|
||||
, System.Nix.Internal.Base32
|
||||
, System.Nix.Internal.Hash
|
||||
, System.Nix.Internal.Nar.Parser
|
||||
, System.Nix.Internal.Nar.Streamer
|
||||
, System.Nix.Internal.Nar.Effects
|
||||
, System.Nix.Internal.Signature
|
||||
, System.Nix.Internal.StorePath
|
||||
, System.Nix.Nar
|
||||
, System.Nix.ReadonlyStore
|
||||
, System.Nix.Signature
|
||||
, System.Nix.StorePath
|
||||
, System.Nix.StorePathMetadata
|
||||
build-depends: base >=4.10 && <5
|
||||
, attoparsec
|
||||
, algebraic-graphs >= 0.5 && < 0.6
|
||||
, base16-bytestring
|
||||
, base64-bytestring
|
||||
, bytestring
|
||||
, cereal
|
||||
, containers
|
||||
, cryptohash-md5
|
||||
, cryptohash-sha1
|
||||
, cryptohash-sha256
|
||||
, cryptohash-sha512
|
||||
, directory
|
||||
, filepath
|
||||
, hashable
|
||||
, lifted-base
|
||||
, monad-control
|
||||
, mtl
|
||||
, nix-derivation >= 1.1.1 && <2
|
||||
, saltine
|
||||
, time
|
||||
, text
|
||||
, unix
|
||||
, unordered-containers
|
||||
, vector
|
||||
exposed-modules:
|
||||
System.Nix.Base32
|
||||
, System.Nix.Build
|
||||
, System.Nix.Derivation
|
||||
, System.Nix.Hash
|
||||
, System.Nix.Internal.Base32
|
||||
, System.Nix.Internal.Hash
|
||||
, System.Nix.Internal.Nar.Parser
|
||||
, System.Nix.Internal.Nar.Streamer
|
||||
, System.Nix.Internal.Nar.Effects
|
||||
, System.Nix.Internal.Signature
|
||||
, System.Nix.Internal.StorePath
|
||||
, System.Nix.Nar
|
||||
, System.Nix.ReadonlyStore
|
||||
, System.Nix.Signature
|
||||
, System.Nix.StorePath
|
||||
, System.Nix.StorePathMetadata
|
||||
build-depends:
|
||||
base >=4.10 && <5
|
||||
, attoparsec
|
||||
, algebraic-graphs >= 0.5 && < 0.6
|
||||
, base16-bytestring
|
||||
, base64-bytestring
|
||||
, bytestring
|
||||
, cereal
|
||||
, containers
|
||||
, cryptohash-md5
|
||||
, cryptohash-sha1
|
||||
, cryptohash-sha256
|
||||
, cryptohash-sha512
|
||||
, directory
|
||||
, filepath
|
||||
, hashable
|
||||
, lifted-base
|
||||
, monad-control
|
||||
, mtl
|
||||
, nix-derivation >= 1.1.1 && <2
|
||||
, saltine
|
||||
, time
|
||||
, text
|
||||
, unix
|
||||
, unordered-containers
|
||||
, vector
|
||||
hs-source-dirs: src
|
||||
default-language: Haskell2010
|
||||
|
||||
@ -79,17 +82,17 @@ test-suite format-tests
|
||||
import: commons
|
||||
if flag(bounded_memory)
|
||||
cpp-options: -DBOUNDED_MEMORY
|
||||
ghc-options: -rtsopts -fprof-auto
|
||||
ghc-options: -rtsopts -fprof-auto
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: Driver.hs
|
||||
other-modules:
|
||||
Arbitrary
|
||||
Derivation
|
||||
NarFormat
|
||||
Hash
|
||||
StorePath
|
||||
Arbitrary
|
||||
Derivation
|
||||
NarFormat
|
||||
Hash
|
||||
StorePath
|
||||
hs-source-dirs:
|
||||
tests
|
||||
tests
|
||||
build-tool-depends:
|
||||
tasty-discover:tasty-discover
|
||||
build-depends:
|
||||
|
@ -45,7 +45,9 @@ makeTextPath fp nm h refs = makeStorePath fp ty h nm
|
||||
|
||||
makeFixedOutputPath
|
||||
:: forall hashAlgo
|
||||
. (ValidAlgo hashAlgo, NamedAlgo hashAlgo)
|
||||
. ( ValidAlgo hashAlgo
|
||||
, NamedAlgo hashAlgo
|
||||
)
|
||||
=> FilePath
|
||||
-> Bool
|
||||
-> Digest hashAlgo
|
||||
@ -57,7 +59,7 @@ makeFixedOutputPath fp recursive h =
|
||||
else makeStorePath fp "output:out" h'
|
||||
where
|
||||
h' =
|
||||
hash @ 'SHA256
|
||||
hash @'SHA256
|
||||
$ "fixed:out:"
|
||||
<> encodeUtf8 (algoName @hashAlgo)
|
||||
<> (if recursive then ":r:" else ":")
|
||||
|
@ -28,27 +28,29 @@ flag io-testsuite
|
||||
|
||||
library
|
||||
import: commons
|
||||
exposed-modules: System.Nix.Store.Remote
|
||||
, System.Nix.Store.Remote.Binary
|
||||
, System.Nix.Store.Remote.Builders
|
||||
, System.Nix.Store.Remote.Logger
|
||||
, System.Nix.Store.Remote.Parsers
|
||||
, System.Nix.Store.Remote.Protocol
|
||||
, System.Nix.Store.Remote.Types
|
||||
, System.Nix.Store.Remote.Util
|
||||
exposed-modules:
|
||||
System.Nix.Store.Remote
|
||||
, System.Nix.Store.Remote.Binary
|
||||
, System.Nix.Store.Remote.Builders
|
||||
, System.Nix.Store.Remote.Logger
|
||||
, System.Nix.Store.Remote.Parsers
|
||||
, System.Nix.Store.Remote.Protocol
|
||||
, System.Nix.Store.Remote.Types
|
||||
, System.Nix.Store.Remote.Util
|
||||
|
||||
build-depends: base >=4.10 && <5
|
||||
, attoparsec
|
||||
, binary
|
||||
, bytestring
|
||||
, containers
|
||||
, text
|
||||
, time
|
||||
, network
|
||||
, nix-derivation >= 1.1.1 && <2
|
||||
, mtl
|
||||
, unordered-containers
|
||||
, hnix-store-core >= 0.4 && <0.5
|
||||
build-depends:
|
||||
base >=4.10 && <5
|
||||
, attoparsec
|
||||
, binary
|
||||
, bytestring
|
||||
, containers
|
||||
, text
|
||||
, time
|
||||
, network
|
||||
, nix-derivation >= 1.1.1 && <2
|
||||
, mtl
|
||||
, unordered-containers
|
||||
, hnix-store-core >= 0.4 && <0.5
|
||||
hs-source-dirs: src
|
||||
default-language: Haskell2010
|
||||
ghc-options: -Wall
|
||||
@ -58,34 +60,36 @@ test-suite hnix-store-remote-tests
|
||||
|
||||
if !flag(io-testsuite)
|
||||
buildable: False
|
||||
ghc-options: -rtsopts -fprof-auto
|
||||
|
||||
ghc-options: -rtsopts -fprof-auto
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: Driver.hs
|
||||
other-modules: Derivation
|
||||
, NixDaemon
|
||||
, Spec
|
||||
, Util
|
||||
other-modules:
|
||||
Derivation
|
||||
, NixDaemon
|
||||
, Spec
|
||||
, Util
|
||||
hs-source-dirs: tests
|
||||
build-tool-depends:
|
||||
tasty-discover:tasty-discover
|
||||
build-depends: base
|
||||
, hnix-store-core >= 0.3
|
||||
, hnix-store-remote
|
||||
, containers
|
||||
, directory
|
||||
, process
|
||||
, filepath
|
||||
, hspec-expectations-lifted
|
||||
, quickcheck-text
|
||||
, tasty
|
||||
, tasty-hspec
|
||||
, tasty-quickcheck
|
||||
, linux-namespaces
|
||||
, nix-derivation
|
||||
, temporary
|
||||
, text
|
||||
, unix
|
||||
, unordered-containers
|
||||
, vector
|
||||
build-depends:
|
||||
base
|
||||
, hnix-store-core >= 0.3
|
||||
, hnix-store-remote
|
||||
, containers
|
||||
, directory
|
||||
, process
|
||||
, filepath
|
||||
, hspec-expectations-lifted
|
||||
, quickcheck-text
|
||||
, tasty
|
||||
, tasty-hspec
|
||||
, tasty-quickcheck
|
||||
, linux-namespaces
|
||||
, nix-derivation
|
||||
, temporary
|
||||
, text
|
||||
, unix
|
||||
, unordered-containers
|
||||
, vector
|
||||
default-language: Haskell2010
|
||||
|
@ -48,7 +48,7 @@ withBash action = do
|
||||
Nothing -> error "No bash executable found"
|
||||
Just fp -> do
|
||||
let Right n = System.Nix.StorePath.makeStorePathName "bash"
|
||||
pth <- addToStore @ 'SHA256 n fp False (pure True) False
|
||||
pth <- addToStore @'SHA256 n fp False (pure True) False
|
||||
action pth
|
||||
|
||||
withBuildScript :: (StorePath -> MonadStore a) -> MonadStore a
|
||||
|
@ -259,7 +259,7 @@ spec_protocol = Hspec.around withNixDaemon $
|
||||
itRights "adds file to store" $ do
|
||||
fp <- liftIO $ writeSystemTempFile "addition" "lal"
|
||||
let Right n = makeStorePathName "tmp-addition"
|
||||
res <- addToStore @ 'SHA256 n fp False (pure True) False
|
||||
res <- addToStore @'SHA256 n fp False (pure True) False
|
||||
liftIO $ print res
|
||||
|
||||
context "with dummy" $ do
|
||||
|
Loading…
Reference in New Issue
Block a user