Skip to content
Snippets Groups Projects
Unverified Commit e1335135 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone Committed by GitHub
Browse files

Merge pull request #18 from PrivateStorageio/16.ristretto-dependency

Add the Ristretto dependency
parents b27cfb93 3ef75e88
No related branches found
No related tags found
No related merge requests found
...@@ -74,6 +74,42 @@ jobs: ...@@ -74,6 +74,42 @@ jobs:
- paymentserver-v1-{{ checksum "stack.yaml" }}-{{ checksum "PaymentServer.cabal" }} - paymentserver-v1-{{ checksum "stack.yaml" }}-{{ checksum "PaymentServer.cabal" }}
- paymentserver-v1-{{ checksum "stack.yaml" }} - paymentserver-v1-{{ checksum "stack.yaml" }}
- run:
# Build just our dependencies. It's nice to have this as a separate
# step so failures here are more easily identified as being
# unrelated to our code.
#
# See below for explanation of the various flags passed in. If the
# flags here differ from those below in a way that makes ghc think a
# library needs to be rebuilt then we'll build everything twice and
# our cache will be useless! Try not to make that happen.
name: "Build Dependencies"
command: |
BUILD="stack build \
--no-terminal \
--only-dependencies \
--fast \
--test \
--no-run-tests \
--jobs 1 \
--interleaved-output"
nix-shell shell.nix --run "$BUILD"
# Give it a good long while. stripe-core, in particular, can take a
# while to build.
no_output_timeout: "20m"
- save_cache:
# We can save the stack cache right here. It will have everything
# we want in it now that the dependencies have been built. And this
# way we get to save the cache whether or not the test suite goes on
# to succeed.
name: "Cache Dependencies"
key: paymentserver-v1-{{ checksum "stack.yaml" }}-{{ checksum "PaymentServer.cabal" }}
paths:
- "/root/.stack"
- ".stack-work"
- run: - run:
name: "Run Tests" name: "Run Tests"
command: | command: |
...@@ -107,13 +143,6 @@ jobs: ...@@ -107,13 +143,6 @@ jobs:
--no-haddock-deps" --no-haddock-deps"
nix-shell shell.nix --run "$BUILD" nix-shell shell.nix --run "$BUILD"
- save_cache:
name: "Cache Dependencies"
key: paymentserver-v1-{{ checksum "stack.yaml" }}-{{ checksum "PaymentServer.cabal" }}
paths:
- "/root/.stack"
- ".stack-work"
- save_cache: - save_cache:
name: "Cache Nix Store Paths" name: "Cache Nix Store Paths"
key: paymentserver-nix-store-v1-{{ .Environment.NIXPKGS_REV }} key: paymentserver-nix-store-v1-{{ .Environment.NIXPKGS_REV }}
......
...@@ -35,6 +35,7 @@ library ...@@ -35,6 +35,7 @@ library
, cryptonite , cryptonite
default-language: Haskell2010 default-language: Haskell2010
ghc-options: -Wmissing-import-lists -Wunused-imports ghc-options: -Wmissing-import-lists -Wunused-imports
pkgconfig-depends: ristretto
executable PaymentServer-exe executable PaymentServer-exe
hs-source-dirs: app hs-source-dirs: app
......
{ fetchFromGitHub, callPackage }:
let
src = fetchFromGitHub {
owner = "LeastAuthority";
repo = "privacypass";
rev = "f74b371cdf179454f3ad540a4d0deea879fbe5e1";
sha256 = "0a020ks8awlpil58zcaj5apk1ls0q2y492wsh62kl529jp518v4b";
};
in
callPackage "${src}/ristretto.nix" { }
# This is intended to be used as the shell-file for the stack configuration.
# It sets up the non-Haskell parts of the stack build environment.
{ ghc }:
let
pkgs = import <nixpkgs> { };
# Get our Ristretto bindings.
ristretto = pkgs.callPackage ./ristretto.nix { };
in
# This is what you're supposed to call in a stack shell-file. I don't
# *really* know what it does but I know it works...
pkgs.haskell.lib.buildStackProject {
inherit ghc;
name = "PrivacyPass";
# zlib is a common dependency of many of our dependencies. and we put our
# ristretto library in as well.
buildInputs = [ pkgs.zlib ristretto ];
}
...@@ -64,9 +64,7 @@ extra-deps: ...@@ -64,9 +64,7 @@ extra-deps:
# Allow a newer minor version of GHC than the snapshot specifies # Allow a newer minor version of GHC than the snapshot specifies
# compiler-check: newer-minor # compiler-check: newer-minor
# https://docs.haskellstack.org/en/stable/nix_integration/#additions-to-your-stackyaml
nix: nix:
enable: true enable: true
packages: # https://docs.haskellstack.org/en/stable/nix_integration/#using-a-custom-shellnix-file
- "zlib" shell-file: "stack-shell.nix"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment