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

Commit

Permalink
Use nix-tools to build cardano-sl
Browse files Browse the repository at this point in the history
We now use the nix-tools generated pacakge set.
For now the wallet-new unit test and cardano-chain
test had to be disabled due to build failures.
  • Loading branch information
angerman committed Dec 11, 2018
1 parent b0603de commit 326719f
Show file tree
Hide file tree
Showing 109 changed files with 9,481 additions and 13 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# GitHub Linguist annotations.
# Hide nix/.stack.nix/*.nix
# That is stuff that is generated by nix-tools stack-to-nix

nix/.stack.nix/*.nix linguist-generated=true
.stack-to-nix.cache linguist-generated=true
nix/.stack-pkgs.nix linguist-generated=true
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,11 @@ venv.bak/
/faucet/default.nix
/faucet/shell.nix
/faucet/recaptcha-secret.txt

# GitHub Linguist annotations.
# Hide nix/.stack.nix/*.nix
# That is stuff that is generated by nix-tools stack-to-nix

nix/.stack.nix/*.nix linguist-generated=true
.stack-to-nix.cache linguist-generated=true
nix/.stack-pkgs.nix linguist-generated=true
23 changes: 23 additions & 0 deletions .stack-to-nix.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auxx/cardano-sl-auxx.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ test-suite cardano-auxx-test
, cardano-sl-crypto
, hspec
, universum >= 0.1.11

build-tool-depends: hspec-discover:hspec-discover
hs-source-dirs: test
default-language: Haskell2010
ghc-options: -threaded
Expand Down
1 change: 1 addition & 0 deletions binary/cardano-sl-binary.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ test-suite binary-test
, time-units
, universum >= 0.1.11
, unordered-containers
build-tool-depends: hspec-discover:hspec-discover

hs-source-dirs: test
default-language: Haskell2010
Expand Down
2 changes: 2 additions & 0 deletions chain/cardano-sl-chain.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ test-suite chain-test
, universum
, unordered-containers
, vector
build-tool-depends: hspec-discover:hspec-discover

default-language: Haskell2010
default-extensions: NoImplicitPrelude
OverloadedStrings
Expand Down
1 change: 1 addition & 0 deletions client/cardano-sl-client.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ test-suite cardano-client-test
, QuickCheck
, universum >= 0.1.11
, unordered-containers
build-tool-depends: hspec-discover:hspec-discover

hs-source-dirs: test
default-language: Haskell2010
Expand Down
1 change: 1 addition & 0 deletions core/cardano-sl-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ test-suite core-test
, time-units
, universum >= 0.1.11
, unordered-containers
build-tool-depends: hspec-discover:hspec-discover

ghc-options:
-threaded
Expand Down
1 change: 1 addition & 0 deletions crypto/cardano-sl-crypto.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ test-suite crypto-test
, text
, universum >= 0.1.11
, unordered-containers
build-tool-depends: hspec-discover:hspec-discover

ghc-options: -threaded
-rtsopts
Expand Down
21 changes: 19 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ let
localLib = import ./lib.nix;
in
{ system ? builtins.currentSystem
, crossSystem ? null
, config ? {} # The nixpkgs configuration file

# Use a pinned version nixpkgs.
, pkgs ? localLib.importPkgs { inherit system config; }
, pkgs ? localLib.importPkgs { inherit system crossSystem config; }

# SHA1 hash which will be embedded in binaries
, gitrev ? localLib.commitIdFromGitRepo ./.git
Expand Down Expand Up @@ -288,7 +289,23 @@ let
cardano-wallet;
inherit (self.haskellPackages)
cardano-report-server; }

# nix-tools setup
// (with builtins; with pkgs.lib; let nix-tools = import ./nix/pkgs.nix { nixpkgs = _: pkgs; }; in
{
nix-tools = { _raw = nix-tools; }
# some shorthands
// { libs = mapAttrs (k: v: if v.components ? "library"
then v.components.library
else null) nix-tools; }
// { exes = mapAttrs (k: v: if length (attrValues v.components.exes) > 0
then (if pkgs.stdenv.targetPlatform.isWindows then pkgs.copyJoin else pkgs.symlinkJoin)
{ name = "${k}-exes"; paths = attrValues v.components.exes; }
else null) nix-tools; }
// { tests = mapAttrs (k: v: if length (attrValues v.components.tests) > 0
then v.components.tests
else null) nix-tools; }
;
})
);

in
Expand Down
2 changes: 2 additions & 0 deletions explorer/cardano-sl-explorer.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ test-suite cardano-explorer-test
, lens
, universum >= 0.1.11
, warp
build-tool-depends: hspec-discover:hspec-discover

hs-source-dirs: test
default-language: Haskell2010
ghc-options: -threaded
Expand Down
1 change: 1 addition & 0 deletions generator/cardano-sl-generator.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ test-suite cardano-generator-test
, serokell-util
, universum >= 0.1.11
, unordered-containers
build-tool-depends: hspec-discover:hspec-discover

hs-source-dirs: test
default-language: Haskell2010
Expand Down
1 change: 1 addition & 0 deletions lib/cardano-sl.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ test-suite cardano-test
, time-units
, universum >= 0.1.11
, unordered-containers
build-tool-depends: hspec-discover:hspec-discover

hs-source-dirs: test
default-language: Haskell2010
Expand Down
1 change: 1 addition & 0 deletions networking/cardano-sl-networking.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ test-suite cardano-sl-networking-test
, serokell-util >= 0.1.2.3
, stm
, time-units
build-tool-depends: hspec-discover:hspec-discover
hs-source-dirs: test
default-language: Haskell2010
ghc-options: -threaded
Expand Down
86 changes: 86 additions & 0 deletions nix/.stack-pkgs.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions nix/.stack.nix/acid-state-exts.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 326719f

Please sign in to comment.