Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChangeLog updates, remote version bump #77

Merged
merged 6 commits into from
Nov 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions hnix-store-core/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## (unreleased) 0.3.0.0 -- 2020-XY-ZV

* `System.Nix.Nar` changes API to support NAR format streaming:
* `buildNarIO :: FilePath -> Handle -> IO ()` - Create a NAR from a regular filesystem object, stream it out on the Handle
* `unpackNarIO :: Handle -> FilePath -> IO ()` - Recreate filesystem object from a NAR file accessed by the Handle
* `StorePath` type changed to simple variant without type level
symbolic store path root.
* Added `makeFixedOutputPath` to `System.Nix.ReadonlyStore`
Expand All @@ -14,6 +17,7 @@ symbolic store path root.
* Added `System.Nix.Build` module
* Added `System.Nix.Derivation` module
* Removed `System.Nix.Util` module, moved to `hnix-store-remote`
* Added base64 and SHA512 hash support

## 0.2.0.0 -- 2020-03-12

Expand Down
2 changes: 1 addition & 1 deletion hnix-store-remote/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## (unreleased) 0.3.0.0 -- 2020-XY-ZV

* Restored most store API functions
* Restored most store API functions except `addToStoreNar`
* Added `buildDerivation`

## 0.2.0.0 -- skipped
Expand Down
6 changes: 2 additions & 4 deletions hnix-store-remote/hnix-store-remote.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: hnix-store-remote
version: 0.2.0.0
version: 0.3.0.0
synopsis: Remote hnix store
description: Implementation of the nix store using the daemon protocol.
homepage: https://github.com/haskell-nix/hnix-store
Expand Down Expand Up @@ -55,8 +55,6 @@ test-suite hnix-store-remote-tests
if !flag(io-testsuite)
buildable: False

build-tool-depends: nix:nix-daemon

ghc-options: -rtsopts -fprof-auto
type: exitcode-stdio-1.0
main-is: Driver.hs
Expand All @@ -67,7 +65,7 @@ test-suite hnix-store-remote-tests
hs-source-dirs: tests
build-depends:
attoparsec
, hnix-store-core
, hnix-store-core >= 0.3
, hnix-store-remote
, base
, base64-bytestring
Expand Down
20 changes: 10 additions & 10 deletions hnix-store-remote/src/System/Nix/Store/Remote/Builders.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ module System.Nix.Store.Remote.Builders (
) where

import Data.Text.Lazy (Text)
import System.Nix.Hash (Digest, NamedAlgo, SomeNamedDigest(SomeDigest))
import System.Nix.StorePath (ContentAddressableAddress(..), NarHashMode(..))
import System.Nix.Hash (Digest, SomeNamedDigest(SomeDigest))
import System.Nix.StorePath (ContentAddressableAddress(..))

import Data.Text.Lazy.Builder (Builder)
import qualified Data.Text.Lazy.Builder
Expand All @@ -19,19 +19,19 @@ import qualified System.Nix.Hash

-- | Marshall `ContentAddressableAddress` to `Text`
-- in form suitable for remote protocol usage.
buildContentAddressableAddress :: forall hashAlgo . NamedAlgo hashAlgo
=> ContentAddressableAddress
-> Text
buildContentAddressableAddress
:: ContentAddressableAddress
-> Text
buildContentAddressableAddress =
Data.Text.Lazy.Builder.toLazyText . contentAddressableAddressBuilder @hashAlgo
Data.Text.Lazy.Builder.toLazyText . contentAddressableAddressBuilder

contentAddressableAddressBuilder :: forall hashAlgo . NamedAlgo hashAlgo
=> ContentAddressableAddress
-> Builder
contentAddressableAddressBuilder
:: ContentAddressableAddress
-> Builder
contentAddressableAddressBuilder (Text digest) =
"text:"
<> digestBuilder digest
contentAddressableAddressBuilder (Fixed narHashMode (SomeDigest digest)) =
contentAddressableAddressBuilder (Fixed _narHashMode (SomeDigest (digest :: Digest hashAlgo))) =
"fixed:"
<> (Data.Text.Lazy.Builder.fromText $ System.Nix.Hash.algoName @hashAlgo)
<> digestBuilder digest
Expand Down