Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
[DEVOPS-956] stack2nix: Add logging of hackage snapshot and update
Browse files Browse the repository at this point in the history
  • Loading branch information
rvl committed Jul 19, 2018
1 parent 93cbd79 commit 51a2719
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkgs/generate.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash cabal2nix stack cabal-install ghc

# regenerate the `pkgs/default.nix` file based on the current contents of cardano-sl.cabal and stack.yaml
# Regenerate the `pkgs/default.nix` file based on the current
# contents of cardano-sl.cabal and stack.yaml, with a hackage snapshot.

# Update this if you need a package version recently uploaded to hackage.
# Any timestamp works.
hackageSnapshot="2018-07-17T09:58:14Z"

function runInShell {
local inputs="$1"
Expand All @@ -20,13 +25,15 @@ fi
# Get relative path to script directory
scriptDir="$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")"

echo "Using hackage snapshot from ${hackageSnapshot}"

pushd "${scriptDir}"

# https://github.com/NixOS/cabal2nix/issues/146
runInShell "cabal2nix glibcLocales" cabal2nix --system x86_64-darwin --revision 25a53d417d7c7a8fc3116b63e3ba14ca7c8f188f \
https://github.com/luite/hfsevents.git > hfsevents.nix

# Generate cardano-sl package set
runInShell "cabal2nix glibcLocales" "$(nix-build -A stack2nix --no-out-link -Q ../)/bin/stack2nix" --platform x86_64-linux --hackage-snapshot 2018-06-20T09:58:14Z -j8 --test --bench --no-indent ./.. > default.nix.new
runInShell "cabal2nix glibcLocales" "$(nix-build -A stack2nix --no-out-link -Q ../)/bin/stack2nix" --platform x86_64-linux --hackage-snapshot "${hackageSnapshot}" -j8 --test --bench --no-indent ./.. > default.nix.new
mv default.nix.new default.nix
popd

0 comments on commit 51a2719

Please sign in to comment.