Skip to content

Commit

Permalink
Remove stack build
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Oct 19, 2020
1 parent 5868c6b commit 28ff54a
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 78 deletions.
17 changes: 0 additions & 17 deletions .buildkite/pipeline.yml
@@ -1,26 +1,9 @@
steps:
- label: 'stack rebuild'
env:
STACK_ROOT: "/build/cardano-prelude.stack"
command:
- "rm -rf /build/cardano-prelude"
- "cp -R . /build/cardano-prelude"
- "cd /build/cardano-prelude"
- "nix-build scripts/buildkite -o stack-rebuild"
- "./stack-rebuild"
agents:
system: x86_64-linux

- label: 'check-cabal-project'
command: 'nix-build ./nix -A iohkNix.checkCabalProject -o check-cabal-project.sh && ./check-cabal-project.sh'
agents:
system: x86_64-linux

- label: 'stack-cabal-sync'
command: 'nix-shell scripts/buildkite/stack-cabal-sync.nix --run scripts/buildkite/stack-cabal-sync.sh'
agents:
system: x86_64-linux

# FIXME, waiting for https://github.com/input-output-hk/haskell.nix/pull/426
#- label: 'release.nix'
# command: 'nix-build -A check-hydra -o check-hydra.sh && ./check-hydra.sh'
Expand Down
1 change: 1 addition & 0 deletions nix/pkgs.nix
Expand Up @@ -8,4 +8,5 @@ pkgs: _: with pkgs; {
buildPackages
;
};

}
8 changes: 0 additions & 8 deletions nix/stack-shell.nix

This file was deleted.

48 changes: 33 additions & 15 deletions scripts/buildkite/default.nix
@@ -1,22 +1,40 @@
{ system ? builtins.currentSystem
, crossSystem ? null
# allows to customize haskellNix (ghc and profiling, see ./nix/haskell.nix)
, config ? {}
, pkgs ? import ../../nix { inherit system config; }
, buildTools ? with pkgs; [ git nix gnumake ]
# allows to override dependencies of the project without modifications,
# eg. to test build against local checkout of iohk-nix:
# nix build -f default.nix cardano-prelude --arg sourcesOverride '{
# iohk-nix = ../iohk-nix;
# }'
, sourcesOverride ? {}
# pinned version of nixpkgs augmented with overlays (iohk-nix and our packages).
, pkgs ? import ./nix { inherit system crossSystem config sourcesOverride; }
, gitrev ? pkgs.iohkNix.commitIdFromGitRepoOrZero ./.git
}:
with pkgs; with commonLib;
let

with pkgs.lib;
with pkgs;
haskellPackages = recRecurseIntoAttrs
# we are only interested in listing the project packages:
(selectProjectPackages cardanoPreludeHaskellPackages);

let
cache-s3 = callPackage ./cache-s3.nix {};
self = {
inherit haskellPackages;

# `tests` are the test suites which have been built.
tests = collectComponents' "tests" haskellPackages;
# `benchmarks` (only built, not run).
benchmarks = collectComponents' "benchmarks" haskellPackages;

stackRebuild = runCommand "stack-rebuild" {} ''
${haskellPackages.ghcWithPackages (ps: [ps.turtle ps.safe ps.transformers])}/bin/ghc -o $out ${./rebuild.hs}
'';
checks = recurseIntoAttrs {
# `checks.tests` collect results of executing the tests:
tests = collectChecks haskellPackages;
};

in
writeScript "stack-rebuild-wrapped" ''
#!${stdenv.shell}
export PATH=${lib.makeBinPath ([ cache-s3 stack gnused coreutils gnutar gzip ] ++ buildTools)}
exec ${stackRebuild} "$@"
''
shell = import ./shell.nix {
inherit pkgs;
withHoogle = true;
};
};
in self
27 changes: 21 additions & 6 deletions shell.nix
@@ -1,8 +1,7 @@
# This file is used by nix-shell.
# It just takes the shell attribute from default.nix.
{ config ? {}
, sourcesOverride ? {}
, withHoogle ? true
, withHoogle ? false
, pkgs ? import ./nix {
inherit config sourcesOverride;
}
Expand All @@ -14,19 +13,35 @@ let
shell = cardanoPreludeHaskellPackages.shellFor {
name = "cabal-dev-shell";

# If shellFor local packages selection is wrong,
# If shellFor default local packages selection is wrong,
# then list all local packages then include source-repository-package that cabal complains about:
# packages = ps: with ps; [ ];
packages = ps: with ps; [
cardano-prelude
cardano-prelude-test
];

# These programs will be available inside the nix-shell.
buildInputs = with haskellPackages; [
cabal-install
ghcid
gitAndTools.git
hlint
weeder
nix
niv
pkgconfig
sqlite-interactive
];

tools = {
cabal = "3.2.0.0";
};

# Prevents cabal from choosing alternate plans, so that
# *all* dependencies are provided by Nix.
exactDeps = true;
exactDeps = false;

NIX_SSL_CERT_FILE = "/etc/ssl/certs/ca-bundle.crt";
SSL_CERT_FILE = "/etc/ssl/certs/ca-bundle.crt";

inherit withHoogle;
};
Expand Down
20 changes: 0 additions & 20 deletions snapshot.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions stack.yaml

This file was deleted.

0 comments on commit 28ff54a

Please sign in to comment.