Skip to content

Commit 62c9391

Browse files
committed
fixup! Automatically generate cache
Print out the cache so that users can speed up builds
1 parent db88c60 commit 62c9391

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

changelog.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
This file contains a summary of changes to Haskell.nix and `nix-tools`
22
that will impact users.
33

4-
## December 10, 2019
5-
* Now the `cache` attribute of `stackProject` is not required and is going to be deprecated.
6-
74
## November 18, 2019
85
* Changed the `cleanSourceHaskell` to accept an attrset of `src` and
96
(optional) `name` parameters. This allows you to keep the source

overlays/haskell.nix

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -412,14 +412,17 @@ self: super: {
412412
stackProject' =
413413
{ ... }@args:
414414
let stack = importAndFilterProject (callStackToNix ({ inherit cache; } // args));
415-
cache = if args ? cache
416-
then builtins.trace
417-
"warning: passing `cache' to `stackProject' is deprecated. See #335 #358"
418-
args.cache
419-
else genStackCache {
420-
inherit (args) src;
421-
stackYaml = args.stackYaml or "stack.yaml";
422-
};
415+
generatedCache = genStackCache {
416+
inherit (args) src;
417+
stackYaml = args.stackYaml or "stack.yaml";
418+
};
419+
cache = args.cache or (builtins.trace
420+
(builtins.trace ''
421+
Automatically generated cache for this project.
422+
You can pass it as a cache argument to speed up builds:
423+
''
424+
# Force evaluation so that tracing prints out the whole list
425+
(builtins.deepSeq generatedCache generatedCache)) generatedCache);
423426
in let pkg-set = mkStackPkgSet
424427
{ stack-pkgs = stack.pkgs;
425428
pkg-def-extras = (args.pkg-def-extras or []);

0 commit comments

Comments
 (0)