Skip to content

Commit 326719f

Browse files
committed
Use nix-tools to build cardano-sl
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.
1 parent b0603de commit 326719f

File tree

109 files changed

+9481
-13
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+9481
-13
lines changed

.gitattributes

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# GitHub Linguist annotations.
2+
# Hide nix/.stack.nix/*.nix
3+
# That is stuff that is generated by nix-tools stack-to-nix
4+
5+
nix/.stack.nix/*.nix linguist-generated=true
6+
.stack-to-nix.cache linguist-generated=true
7+
nix/.stack-pkgs.nix linguist-generated=true

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,11 @@ venv.bak/
231231
/faucet/default.nix
232232
/faucet/shell.nix
233233
/faucet/recaptcha-secret.txt
234+
235+
# GitHub Linguist annotations.
236+
# Hide nix/.stack.nix/*.nix
237+
# That is stuff that is generated by nix-tools stack-to-nix
238+
239+
nix/.stack.nix/*.nix linguist-generated=true
240+
.stack-to-nix.cache linguist-generated=true
241+
nix/.stack-pkgs.nix linguist-generated=true

.stack-to-nix.cache

+23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

auxx/cardano-sl-auxx.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ test-suite cardano-auxx-test
193193
, cardano-sl-crypto
194194
, hspec
195195
, universum >= 0.1.11
196-
196+
build-tool-depends: hspec-discover:hspec-discover
197197
hs-source-dirs: test
198198
default-language: Haskell2010
199199
ghc-options: -threaded

binary/cardano-sl-binary.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ test-suite binary-test
120120
, time-units
121121
, universum >= 0.1.11
122122
, unordered-containers
123+
build-tool-depends: hspec-discover:hspec-discover
123124

124125
hs-source-dirs: test
125126
default-language: Haskell2010

chain/cardano-sl-chain.cabal

+2
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ test-suite chain-test
310310
, universum
311311
, unordered-containers
312312
, vector
313+
build-tool-depends: hspec-discover:hspec-discover
314+
313315
default-language: Haskell2010
314316
default-extensions: NoImplicitPrelude
315317
OverloadedStrings

client/cardano-sl-client.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ test-suite cardano-client-test
111111
, QuickCheck
112112
, universum >= 0.1.11
113113
, unordered-containers
114+
build-tool-depends: hspec-discover:hspec-discover
114115

115116
hs-source-dirs: test
116117
default-language: Haskell2010

core/cardano-sl-core.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ test-suite core-test
250250
, time-units
251251
, universum >= 0.1.11
252252
, unordered-containers
253+
build-tool-depends: hspec-discover:hspec-discover
253254

254255
ghc-options:
255256
-threaded

crypto/cardano-sl-crypto.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ test-suite crypto-test
138138
, text
139139
, universum >= 0.1.11
140140
, unordered-containers
141+
build-tool-depends: hspec-discover:hspec-discover
141142

142143
ghc-options: -threaded
143144
-rtsopts

default.nix

+19-2
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ let
4646
localLib = import ./lib.nix;
4747
in
4848
{ system ? builtins.currentSystem
49+
, crossSystem ? null
4950
, config ? {} # The nixpkgs configuration file
5051

5152
# Use a pinned version nixpkgs.
52-
, pkgs ? localLib.importPkgs { inherit system config; }
53+
, pkgs ? localLib.importPkgs { inherit system crossSystem config; }
5354

5455
# SHA1 hash which will be embedded in binaries
5556
, gitrev ? localLib.commitIdFromGitRepo ./.git
@@ -288,7 +289,23 @@ let
288289
cardano-wallet;
289290
inherit (self.haskellPackages)
290291
cardano-report-server; }
291-
292+
# nix-tools setup
293+
// (with builtins; with pkgs.lib; let nix-tools = import ./nix/pkgs.nix { nixpkgs = _: pkgs; }; in
294+
{
295+
nix-tools = { _raw = nix-tools; }
296+
# some shorthands
297+
// { libs = mapAttrs (k: v: if v.components ? "library"
298+
then v.components.library
299+
else null) nix-tools; }
300+
// { exes = mapAttrs (k: v: if length (attrValues v.components.exes) > 0
301+
then (if pkgs.stdenv.targetPlatform.isWindows then pkgs.copyJoin else pkgs.symlinkJoin)
302+
{ name = "${k}-exes"; paths = attrValues v.components.exes; }
303+
else null) nix-tools; }
304+
// { tests = mapAttrs (k: v: if length (attrValues v.components.tests) > 0
305+
then v.components.tests
306+
else null) nix-tools; }
307+
;
308+
})
292309
);
293310

294311
in

explorer/cardano-sl-explorer.cabal

+2
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ test-suite cardano-explorer-test
347347
, lens
348348
, universum >= 0.1.11
349349
, warp
350+
build-tool-depends: hspec-discover:hspec-discover
351+
350352
hs-source-dirs: test
351353
default-language: Haskell2010
352354
ghc-options: -threaded

generator/cardano-sl-generator.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ test-suite cardano-generator-test
137137
, serokell-util
138138
, universum >= 0.1.11
139139
, unordered-containers
140+
build-tool-depends: hspec-discover:hspec-discover
140141

141142
hs-source-dirs: test
142143
default-language: Haskell2010

lib/cardano-sl.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ test-suite cardano-test
348348
, time-units
349349
, universum >= 0.1.11
350350
, unordered-containers
351+
build-tool-depends: hspec-discover:hspec-discover
351352

352353
hs-source-dirs: test
353354
default-language: Haskell2010

networking/cardano-sl-networking.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ test-suite cardano-sl-networking-test
235235
, serokell-util >= 0.1.2.3
236236
, stm
237237
, time-units
238+
build-tool-depends: hspec-discover:hspec-discover
238239
hs-source-dirs: test
239240
default-language: Haskell2010
240241
ghc-options: -threaded

nix/.stack-pkgs.nix

+86
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nix/.stack.nix/acid-state-exts.nix

+43
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)