on iko/ghcjs-patch-master help sign in
Remove internal deps on default ghc and stackage (#738)
4cac8bdHamish Mackenzie
.buildkite/pipeline.yml+5−5
@@ -1,6 +1,6 @@
1steps:
1steps:
2− - label: 'Run tests'
2+ - label: 'Run tests with ghc883'
3− command: "./test/tests.sh"
3+ command: "./test/tests.sh ghc883"
4 agents:
4 agents:
5 system: x86_64-linux
5 system: x86_64-linux
6
6
@@ -14,9 +14,9 @@ steps:
14 agents:
14 agents:
15 system: x86_64-linux
15 system: x86_64-linux
16
16
17− - label: 'Check closure size'
17+ - label: 'Check closure size with ghc883'
18 command:
18 command:
19− - nix-build build.nix -A maintainer-scripts.check-closure-size -o check-closure-size.sh
19+ - nix-build build.nix -A maintainer-scripts.check-closure-size --argstr compiler-nix-name ghc883 -o check-closure-size.sh
20 - echo "+++ Closure size (MB)"
20 - echo "+++ Closure size (MB)"
21 - ./check-closure-size.sh
21 - ./check-closure-size.sh
22 agents:
22 agents:
@@ -36,5 +36,5 @@ steps:
36
36
37 - label: 'Make sure non store paths like can be used as src'
37 - label: 'Make sure non store paths like can be used as src'
38 command:
38 command:
39− - nix-build build.nix -A maintainer-scripts.check-path-support -o check-path-support.sh
39+ - nix-build build.nix -A maintainer-scripts.check-path-support --argstr compiler-nix-name ghc883 -o check-path-support.sh
40 - ./check-path-support.sh
40 - ./check-path-support.sh
build.nix+25−14
@@ -5,10 +5,11 @@
5let
5let
6 haskellNix = (import ./default.nix {});
6 haskellNix = (import ./default.nix {});
7in
7in
8−{ nixpkgs ? haskellNix.sources.nixpkgs-default
8+{ nixpkgs ? haskellNix.sources.nixpkgs
9, nixpkgsArgs ? haskellNix.nixpkgsArgs
9, nixpkgsArgs ? haskellNix.nixpkgsArgs
10, pkgs ? import nixpkgs nixpkgsArgs
10, pkgs ? import nixpkgs nixpkgsArgs
11, ifdLevel ? 1000
11, ifdLevel ? 1000
12+, compiler-nix-name ? throw "No `compiler-nix-name` passed to build.nix"
12}:
13}:
13
14
14let
15let
@@ -16,16 +17,14 @@ let
16 buildHaskell = pkgs.buildPackages.haskell-nix;
17 buildHaskell = pkgs.buildPackages.haskell-nix;
17 tool = buildHaskell.tool;
18 tool = buildHaskell.tool;
18in rec {
19in rec {
19− tests = import ./test/default.nix { inherit pkgs ifdLevel; };
20+ tests = import ./test/default.nix { inherit pkgs ifdLevel compiler-nix-name; };
20
21
21 tools = pkgs.lib.optionalAttrs (ifdLevel >= 3) (
22 tools = pkgs.lib.optionalAttrs (ifdLevel >= 3) (
22 pkgs.recurseIntoAttrs {
23 pkgs.recurseIntoAttrs {
23− ghcide-020 = tool "ghcide" "0.2.0";
24+ ghcide-020 = tool compiler-nix-name "ghcide" "0.2.0";
24− } // pkgs.lib.optionalAttrs (buildHaskell.defaultCompilerNixName == "ghc865") {
25− cabal-30 = tool "cabal" "3.0.0.0";
25+ cabal-32 = tool compiler-nix-name "cabal" "3.2.0.0";
26− } // pkgs.lib.optionalAttrs (buildHaskell.defaultCompilerNixName != "ghc8101") {
26+ } // pkgs.lib.optionalAttrs (compiler-nix-name != "ghc8101") {
27− cabal-32 = tool "cabal" "3.2.0.0";
28− ghcide-object-code = tool "ghcide" "object-code";
27+ ghcide-object-code = tool compiler-nix-name "ghcide" "object-code";
29 }
28 }
30 );
29 );
31
30
@@ -34,8 +33,21 @@ in rec {
34 # as not all of them can work in restricted eval mode (as they
33 # as not all of them can work in restricted eval mode (as they
35 # are not pure).
34 # are not pure).
36 maintainer-scripts = pkgs.dontRecurseIntoAttrs {
35 maintainer-scripts = pkgs.dontRecurseIntoAttrs {
37− update-hackage = haskell.callPackage ./scripts/update-hackage.nix {};
36+ update-hackage = import ./scripts/update-hackage.nix {
37+ inherit (pkgs) stdenv writeScript coreutils glibc git
38+ openssh nix-prefetch-git gawk bash curl findutils;
39+ # Update scripts use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
40+ nix-tools = haskell.internal-nix-tools;
41+ cabal-install = haskell.internal-cabal-install;
42+ inherit (haskell) update-index-state-hashes;
43+ };
38− update-stackage = haskell.callPackage ./scripts/update-stackage.nix {};
44+ update-stackage = haskell.callPackage ./scripts/update-stackage.nix {
45+ inherit (pkgs) stdenv writeScript coreutils glibc git
46+ openssh nix-prefetch-git gawk bash curl findutils;
47+ # Update scripts use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
48+ nix-tools = haskell.internal-nix-tools;
49+ cabal-install = haskell.internal-cabal-install;
50+ };
39 update-pins = haskell.callPackage ./scripts/update-pins.nix {};
51 update-pins = haskell.callPackage ./scripts/update-pins.nix {};
40 update-docs = pkgs.buildPackages.callPackage ./scripts/update-docs.nix {
52 update-docs = pkgs.buildPackages.callPackage ./scripts/update-docs.nix {
41 generatedOptions = pkgs.callPackage ./scripts/options-doc.nix { };
53 generatedOptions = pkgs.callPackage ./scripts/options-doc.nix { };
@@ -47,11 +59,10 @@ in rec {
47 # use)
59 # use)
48 check-hydra = pkgs.buildPackages.callPackage ./scripts/check-hydra.nix {};
60 check-hydra = pkgs.buildPackages.callPackage ./scripts/check-hydra.nix {};
49 check-closure-size = pkgs.buildPackages.callPackage ./scripts/check-closure-size.nix {
61 check-closure-size = pkgs.buildPackages.callPackage ./scripts/check-closure-size.nix {
50− # Includes cabal-install and hpack since these are commonly used.
62+ # Includes cabal-install since this is commonly used.
51 nix-tools = pkgs.linkFarm "common-tools" [
63 nix-tools = pkgs.linkFarm "common-tools" [
52− { name = "nix-tools"; path = haskell.nix-tools; }
64+ { name = "nix-tools"; path = haskell.nix-tools.${compiler-nix-name}; }
53− { name = "cabal-install"; path = haskell.cabal-install; }
65+ { name = "cabal-install"; path = haskell.cabal-install.${compiler-nix-name}; }
54− { name = "hpack"; path = haskell.haskellPackages.hpack.components.exes.hpack; }
55 ];
66 ];
56 };
67 };
57 check-materialization-concurrency = pkgs.buildPackages.callPackage ./scripts/check-materialization-concurrency/check.nix {};
68 check-materialization-concurrency = pkgs.buildPackages.callPackage ./scripts/check-materialization-concurrency/check.nix {};
builder/default.nix+3−4
@@ -1,4 +1,4 @@
1−{ pkgs, buildPackages, stdenv, lib, haskellLib, ghc, fetchurl, pkgconfig, nonReinstallablePkgs, hsPkgs }:
1+{ pkgs, buildPackages, stdenv, lib, haskellLib, ghc, fetchurl, pkgconfig, nonReinstallablePkgs, hsPkgs, compiler }:
2
2
3let
3let
4 # Builds a single component of a package.
4 # Builds a single component of a package.
@@ -44,7 +44,7 @@ let
44
44
45 hoogleLocal = let
45 hoogleLocal = let
46 nixpkgsHoogle = import (pkgs.path + /pkgs/development/haskell-modules/hoogle.nix);
46 nixpkgsHoogle = import (pkgs.path + /pkgs/development/haskell-modules/hoogle.nix);
47− in { packages ? [], hoogle ? pkgs.buildPackages.haskell-nix.tool "hoogle" {
47+ in { packages ? [], hoogle ? pkgs.buildPackages.haskell-nix.tool compiler.nix-name "hoogle" {
48 version = "5.0.17.15";
48 version = "5.0.17.15";
49 index-state = pkgs.haskell-nix.internalHackageIndexState;
49 index-state = pkgs.haskell-nix.internalHackageIndexState;
50 }
50 }
@@ -59,9 +59,8 @@ let
59
59
60 # Same as haskellPackages.shellFor in nixpkgs.
60 # Same as haskellPackages.shellFor in nixpkgs.
61 shellFor = haskellLib.weakCallPackage pkgs ./shell-for.nix {
61 shellFor = haskellLib.weakCallPackage pkgs ./shell-for.nix {
62− inherit hsPkgs ghcForComponent makeConfigFiles hoogleLocal haskellLib buildPackages;
62+ inherit hsPkgs ghcForComponent makeConfigFiles hoogleLocal haskellLib buildPackages compiler;
63 inherit (buildPackages) glibcLocales;
63 inherit (buildPackages) glibcLocales;
64− buildGHC = ghc.passthru.buildGHC or ghc;
65 };
64 };
66
65
67 # Same as haskellPackages.ghcWithPackages and ghcWithHoogle in nixpkgs.
66 # Same as haskellPackages.ghcWithPackages and ghcWithHoogle in nixpkgs.
builder/shell-for.nix+2−2
@@ -1,4 +1,4 @@
1−{ lib, stdenv, glibcLocales, pkgconfig, ghcForComponent, makeConfigFiles, hsPkgs, hoogleLocal, haskellLib, buildPackages, buildGHC }:
1+{ lib, stdenv, glibcLocales, pkgconfig, ghcForComponent, makeConfigFiles, hsPkgs, hoogleLocal, haskellLib, buildPackages, compiler }:
2
2
3{ packages ? ps:
3{ packages ? ps:
4 let
4 let
@@ -94,7 +94,7 @@ in
94 nativeBuildInputs = [ ghcEnv ]
94 nativeBuildInputs = [ ghcEnv ]
95 ++ nativeBuildInputs
95 ++ nativeBuildInputs
96 ++ mkDrvArgs.nativeBuildInputs or []
96 ++ mkDrvArgs.nativeBuildInputs or []
97− ++ lib.attrValues (buildPackages.haskell-nix.toolsForGhc buildGHC tools);
97+ ++ lib.attrValues (buildPackages.haskell-nix.tools compiler.nix-name tools);
98 phases = ["installPhase"];
98 phases = ["installPhase"];
99 installPhase = "echo $nativeBuildInputs $buildInputs > $out";
99 installPhase = "echo $nativeBuildInputs $buildInputs > $out";
100 LANG = "en_US.UTF-8";
100 LANG = "en_US.UTF-8";
changelog.md+22
@@ -1,6 +1,28 @@
1This file contains a summary of changes to Haskell.nix and `nix-tools`
1This file contains a summary of changes to Haskell.nix and `nix-tools`
2that will impact users.
2that will impact users.
3
3
4+## July 8, 2019
5+* Removed `sources.nixpkgs-default`, use `sources.nixpkgs` instead.
6+* Removed `./nixpkgs` directory, use `(import ./. {}).sources`
7+ or `./nix/sources.nix` instead.
8+* Removes V1 interface for details on how to fix old code see:
9+ https://github.com/input-output-hk/haskell.nix/issues/709
10+* Removed defaultCompilerNixName.
11+* cabalProject, cabalProject', hackage-project and hackage-package
12+ now require a `compiler-nix-name` argument.
13+* `haskell-nix.tool` and `.tools` now require a `compiler-nix-name` argument.
14+ New functions `p.tool` and `p.tools` (where p is a project) do not.
15+ Like `shellFor { tools = ... }` they will use the compiler nix name
16+ from the project (including stack projects where it is derived from
17+ the resolver).
18+* `haskell-nix.alex` and `haskell-nix.happy` have been removed. Use
19+ `p.tool "alex" "3.2.5"` or `shellFor { tools = { alex = "3.2.5"; } }`.
20+* `haskell-nix.nix-tools` -> `haskell-nix.nix-tools.ghc883` (it includes
21+ the hpack exe now).
22+* `haskell-nix.cabal-install` ->
23+ `p.tool "cabal" "3.2.0.0"` or `shellFor { tools = { cabal = "3.2.0.0"; } }`
24+* `haskell-nix.haskellNixRoots` -> `haskell-nix.roots ghc883` or `p.roots`
25+
4## June 25, 2019
26## June 25, 2019
5* Haddock docs are now built in their own derivation when needed (not as part
27* Haddock docs are now built in their own derivation when needed (not as part
6 of the component build).
28 of the component build).
ci-lib.nix+1−1
@@ -1,6 +1,6 @@
1let
1let
2 # Generic nixpkgs, use *only* for lib functions that are stable across versions
2 # Generic nixpkgs, use *only* for lib functions that are stable across versions
3− pkgs = import (import ./nixpkgs/default.nix).nixpkgs-default {};
3+ pkgs = import (import ./nix/sources.nix).nixpkgs {};
4 lib = pkgs.lib;
4 lib = pkgs.lib;
5in rec {
5in rec {
6 inherit (import ./dimension.nix) dimension;
6 inherit (import ./dimension.nix) dimension;
ci.nix+17−17
@@ -12,8 +12,8 @@
12 "R1909" = "nixpkgs-1909";
12 "R1909" = "nixpkgs-1909";
13 "R2003" = "nixpkgs-2003";
13 "R2003" = "nixpkgs-2003";
14 };
14 };
15− compilerNixNames = nixpkgsName: nixpkgs: builtins.mapAttrs (defaultCompilerNixName: _:
15+ compilerNixNames = nixpkgsName: nixpkgs: builtins.mapAttrs (compiler-nix-name: _:
16− (import ./default.nix { inherit checkMaterialization defaultCompilerNixName; }).nixpkgsArgs) ({
16+ (import ./default.nix { inherit checkMaterialization; }).nixpkgsArgs) ({
17 ghc865 = {};
17 ghc865 = {};
18 } // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2003") {
18 } // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2003") {
19 ghc883 = {};
19 ghc883 = {};
@@ -24,11 +24,11 @@
24 linux = "x86_64-linux";
24 linux = "x86_64-linux";
25 darwin = "x86_64-darwin";
25 darwin = "x86_64-darwin";
26 };
26 };
27− crossSystems = nixpkgsName: nixpkgs: compilerNixName: system:
27+ crossSystems = nixpkgsName: nixpkgs: compiler-nix-name: system:
28 # We need to use the actual nixpkgs version we're working with here, since the values
28 # We need to use the actual nixpkgs version we're working with here, since the values
29 # of 'lib.systems.examples' are not understood between all versions
29 # of 'lib.systems.examples' are not understood between all versions
30 let lib = nixpkgs.lib;
30 let lib = nixpkgs.lib;
31− in lib.optionalAttrs (system == "x86_64-linux" && compilerNixName != "ghc8101") {
31+ in lib.optionalAttrs (system == "x86_64-linux" && compiler-nix-name != "ghc8101") {
32 # Windows cross compilation is currently broken on macOS
32 # Windows cross compilation is currently broken on macOS
33 inherit (lib.systems.examples) mingwW64;
33 inherit (lib.systems.examples) mingwW64;
34 } // lib.optionalAttrs (system == "x86_64-linux") {
34 } // lib.optionalAttrs (system == "x86_64-linux") {
@@ -41,32 +41,32 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
41 let pinnedNixpkgsSrc = sources.${nixpkgs-pin};
41 let pinnedNixpkgsSrc = sources.${nixpkgs-pin};
42 # We need this for generic nixpkgs stuff at the right version
42 # We need this for generic nixpkgs stuff at the right version
43 genericPkgs = import pinnedNixpkgsSrc {};
43 genericPkgs = import pinnedNixpkgsSrc {};
44− in dimension "GHC version" (compilerNixNames nixpkgsName genericPkgs) (compilerNixName: nixpkgsArgs:
44+ in dimension "GHC version" (compilerNixNames nixpkgsName genericPkgs) (compiler-nix-name: nixpkgsArgs:
45 dimension "System" (systems genericPkgs) (systemName: system:
45 dimension "System" (systems genericPkgs) (systemName: system:
46 let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; });
46 let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; });
47− build = import ./build.nix { inherit pkgs ifdLevel; };
47+ build = import ./build.nix { inherit pkgs ifdLevel compiler-nix-name; };
48 platformFilter = platformFilterGeneric pkgs system;
48 platformFilter = platformFilterGeneric pkgs system;
49 in filterAttrsOnlyRecursive (_: v: platformFilter v) {
49 in filterAttrsOnlyRecursive (_: v: platformFilter v) {
50 # Native builds
50 # Native builds
51 # TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
51 # TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
52 native = pkgs.recurseIntoAttrs ({
52 native = pkgs.recurseIntoAttrs ({
53 inherit (build) tests tools maintainer-scripts maintainer-script-cache;
53 inherit (build) tests tools maintainer-scripts maintainer-script-cache;
54− ghc = pkgs.buildPackages.haskell-nix.compiler."${compilerNixName}";
54+ ghc = pkgs.buildPackages.haskell-nix.compiler."${compiler-nix-name}";
55 } // pkgs.lib.optionalAttrs (ifdLevel >= 1) {
55 } // pkgs.lib.optionalAttrs (ifdLevel >= 1) {
56− iserv-proxy = pkgs.ghc-extra-packages."${compilerNixName}".iserv-proxy.components.exes.iserv-proxy;
56+ iserv-proxy = pkgs.ghc-extra-packages."${compiler-nix-name}".iserv-proxy.components.exes.iserv-proxy;
57 } // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
57 } // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
58− hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; }).components.exes.hello;
58+ hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; inherit compiler-nix-name; }).components.exes.hello;
59 });
59 });
60 }
60 }
61 //
61 //
62− dimension "Cross system" (crossSystems nixpkgsName genericPkgs compilerNixName system) (crossSystemName: crossSystem:
62+ dimension "Cross system" (crossSystems nixpkgsName genericPkgs compiler-nix-name system) (crossSystemName: crossSystem:
63 # Cross builds
63 # Cross builds
64 let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system crossSystem; });
64 let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system crossSystem; });
65− build = import ./build.nix { inherit pkgs ifdLevel; };
65+ build = import ./build.nix { inherit pkgs ifdLevel compiler-nix-name; };
66 in pkgs.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) {
66 in pkgs.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) {
67− ghc = pkgs.buildPackages.haskell-nix.compiler."${compilerNixName}";
67+ ghc = pkgs.buildPackages.haskell-nix.compiler."${compiler-nix-name}";
68 # TODO: look into cross compiling ghc itself
68 # TODO: look into cross compiling ghc itself
69− # ghc = pkgs.haskell-nix.compiler."${compilerNixName}";
69+ # ghc = pkgs.haskell-nix.compiler."${compiler-nix-name}";
70 # TODO: look into making tools work when cross compiling
70 # TODO: look into making tools work when cross compiling
71 # inherit (build) tools;
71 # inherit (build) tools;
72 # Tests are broken on aarch64 cross https://github.com/input-output-hk/haskell.nix/issues/513
72 # Tests are broken on aarch64 cross https://github.com/input-output-hk/haskell.nix/issues/513
@@ -75,13 +75,13 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
75 then build.tests
75 then build.tests
76 else pkgs.recurseIntoAttrs {
76 else pkgs.recurseIntoAttrs {
77 # Even on aarch64 we still want to build the pinned files
77 # Even on aarch64 we still want to build the pinned files
78− inherit (build.tests) haskellNixRoots;
78+ inherit (build.tests) roots;
79 };
79 };
80 } // pkgs.lib.optionalAttrs (ifdLevel >= 2) {
80 } // pkgs.lib.optionalAttrs (ifdLevel >= 2) {
81− remote-iserv = pkgs.ghc-extra-packages."${compilerNixName}".remote-iserv.components.exes.remote-iserv;
81+ remote-iserv = pkgs.ghc-extra-packages."${compiler-nix-name}".remote-iserv.components.exes.remote-iserv;
82− iserv-proxy = pkgs.ghc-extra-packages."${compilerNixName}".iserv-proxy.components.exes.iserv-proxy;
82+ iserv-proxy = pkgs.ghc-extra-packages."${compiler-nix-name}".iserv-proxy.components.exes.iserv-proxy;
83 } // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
83 } // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
84− hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; }).components.exes.hello;
84+ hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; inherit compiler-nix-name; }).components.exes.hello;
85 })
85 })
86 )
86 )
87 )
87 )
default.nix+27−55
@@ -1,56 +1,28 @@
1−let haskellNix = {
2− checkMaterialization ? false, # Allows us to easily switch on materialization checking
1+{ checkMaterialization ? false # Allows us to easily switch on materialization checking
3− defaultCompilerNixName ? null, # Quick way to override the default compiler e.g. "ghc883"
4− system ? builtins.currentSystem,
2+, system ? builtins.currentSystem
5− sourcesOverride ? {},
3+, sourcesOverride ? {}
6− ... }@args: rec {
4+, ... }@args: rec {
7− sources = (import ./nix/sources.nix) // sourcesOverride;
5+ sources = (import ./nix/sources.nix) // sourcesOverride;
8−
9− config = import ./config.nix;
6+ config = import ./config.nix;
10− overlays = [ allOverlays.combined ] ++ (
7+ overlays = [ allOverlays.combined ] ++ (
11− if checkMaterialization == true
8+ if checkMaterialization == true
12− then [(
9+ then [(
13− final: prev: {
10+ final: prev: {
14− haskell-nix = prev.haskell-nix // {
11+ haskell-nix = prev.haskell-nix // {
15− checkMaterialization = true;
12+ checkMaterialization = true;
16− };
13+ };
17− }
14+ }
18− )]
15+ )]
19− else []
16+ else []
20− ) ++ (
17+ ) ++ [(
21− if defaultCompilerNixName != null
22− then [(
23− final: prev: {
18+ final: prev: {
24− haskell-nix = prev.haskell-nix // {
19+ haskell-nix = prev.haskell-nix // {
25− inherit defaultCompilerNixName;
20+ inherit overlays;
21+ sources = prev.haskell-nix.sources // sourcesOverride;
26− };
22+ };
27− }
23+ }
28− )]
24+ )];
29− else []
30− );
31− allOverlays = import ./overlays args;
25+ allOverlays = import ./overlays args;
32− nixpkgsArgs = { inherit config overlays system; };
26+ nixpkgsArgs = { inherit config overlays system; };
33− pkgs = import sources.nixpkgs-default nixpkgsArgs;
27+ pkgs = import sources.nixpkgs nixpkgsArgs;
34− };
35−
36− v1DeprecationMessage = "Version 1 is deprecated: use version 2 (nixpkgs arguments are available as the `nixpkgsArgs` attribute of version 2)";
37− haskellNixV1 = (haskellNix {}).nixpkgsArgs // {
38− overlays = builtins.trace v1DeprecationMessage (haskellNix {}).nixpkgsArgs.overlays;
39− };
40− haskellNixV2 = haskellNix;
41−
42−# If no arguments, then you get V1
43−in haskellNixV1 // {
44− __functor = _: {
45− version ? 2,
46− checkMaterialization ? false, # Allows us to easily switch on materialization checking
47− defaultCompilerNixName ? null, # Quick way to override the default compiler e.g. "ghc883"
48− system ? builtins.currentSystem,
49− sourcesOverride ? {},
50− ... }@args:
51− if version == 1
52− then haskellNixV1
53− else if version == 2
54− then haskellNixV2 args
55− else builtins.throw ("haskell.nix: unknown version: " + (builtins.toString version));
56}
28}
docs/reference/library.md+16−13
@@ -266,19 +266,22 @@ needed for `importAndFilterProject`.
266 })).pkgs;
266 })).pkgs;
267```
267```
268
268
269−| Argument | Type | Description |
269+| Argument | Type | Description |
270−|------------------|------|---------------------|
270+|----------------------|------|---------------------|
271−| `name` | String | Optional name for better error messages. |
271+| `name` | String | Optional name for better error messages. |
272−| `src` | Path | Location of the cabal project files. |
272+| `src` | Path | Location of the cabal project files. |
273+| `compiler-nix-name` | String | The name of the ghc compiler to use eg. "ghc883" |
273−| `index-state` | Timestamp | Optional hackage index-state, eg. "2019-10-10T00:00:00Z". |
274+| `index-state` | Timestamp | Optional hackage index-state, eg. "2019-10-10T00:00:00Z". |
274−| `index-sha256` | Sha256 | Optional hash of the truncated hackage index-state. |
275+| `index-sha256` | Sha256 | Optional hash of the truncated hackage index-state. |
275−| `plan-sha256` | Sha256 | Optional hash of the plan-to-nix output (makes the plan-to-nix step a fixed output derivation). |
276+| `plan-sha256` | Sha256 | Optional hash of the plan-to-nix output (makes the plan-to-nix step a fixed output derivation). |
277+| `cabalProject` | String | Optional cabal project file contents (defaults to readFile "${src}/cabal.project"). |
278+| `cabalProjectLocal` | String | Optional cabal project file contents (defaults to readFile "${src}/cabal.project.local"). |
276−| `cabalProject` | Path | Optional cabal project file (defaults to "${src}/cabal.project"). |
279+| `cabalProjectFreeze` | String | Optional cabal project file contents (defaults to readFile "${src}/cabal.project.freeze"). |
277−| `ghc` | | Optional ghc to use |
280+| `ghc` | | Deprecated. Use `compiler-nix-name` instead. Optional ghc to use |
278−| `nix-tools` | | Optional nix-tools to use |
281+| `nix-tools` | | Optional nix-tools to use |
279−| `hpack` | | Optional hpack to use |
282+| `hpack` | | Optional hpack to use |
280−| `cabal-install` | | Optional cabal-install to use |
283+| `cabal-install` | | Optional cabal-install to use |
281−| `configureArgs` | String | Optional extra arguments to pass to `cabal new-configure` (--enable-tests is included by default, include `--disable-tests` to override that). |
284+| `configureArgs` | String | Optional extra arguments to pass to `cabal new-configure` (--enable-tests is included by default, include `--disable-tests` to override that). |
282
285
283## importAndFilterProject
286## importAndFilterProject
284
287
docs/troubleshooting.md+2−1
@@ -66,6 +66,7 @@ So this is expected, unfortunately.
66
66
67### How do I prevent the evaluation-time dependencies of my project from being garbage-collected?
67### How do I prevent the evaluation-time dependencies of my project from being garbage-collected?
68
68
69−The `haskellNixRoots` attribute should include all the evaluation-time dependencies.
69+The `haskell-nix.roots "ghc883"` should include all the evaluation-time dependencies
70+and the main build time dependecies of a project using ghc 8.8.3.
70So you can add that to the relevant GC root.
71So you can add that to the relevant GC root.
71In practice, if you're using a CI system like Hydra/Hercules, this means adding it to a job in `release.nix`/`ci.nix`.
72In practice, if you're using a CI system like Hydra/Hercules, this means adding it to a job in `release.nix`/`ci.nix`.
docs/tutorials/getting-started.md+2
@@ -52,6 +52,8 @@ Add `default.nix`:
52 name = "haskell-nix-project";
52 name = "haskell-nix-project";
53 src = ./.;
53 src = ./.;
54 };
54 };
55+ # For `cabal.project` based projects specify the GHC version to use.
56+ compiler-nix-name = "ghc883"; # Not used for `stack.yaml` based projects.
55}
57}
56```
58```
57
59
docs/tutorials/materialization.md+14−7
@@ -40,8 +40,9 @@ file that looks like this:
40
40
41```nix
41```nix
42let inherit (import ./. {}) sources nixpkgsArgs;
42let inherit (import ./. {}) sources nixpkgsArgs;
43− pkgs = import sources.nixpkgs-default nixpkgsArgs;
43+ pkgs = import sources.nixpkgs nixpkgsArgs;
44 hlint = pkgs.haskell-nix.hackage-package {
44 hlint = pkgs.haskell-nix.hackage-package {
45+ compiler-nix-name = "ghc883";
45 name = "hlint";
46 name = "hlint";
46 version = "2.2.11";
47 version = "2.2.11";
47 };
48 };
@@ -64,8 +65,9 @@ inputs. For cabal projects this means we must specify the
64
65
65```nix
66```nix
66let inherit (import ./. {}) sources nixpkgsArgs;
67let inherit (import ./. {}) sources nixpkgsArgs;
67− pkgs = import sources.nixpkgs-default nixpkgsArgs;
68+ pkgs = import sources.nixpkgs nixpkgsArgs;
68 hlint = pkgs.haskell-nix.hackage-package {
69 hlint = pkgs.haskell-nix.hackage-package {
70+ compiler-nix-name = "ghc883";
69 name = "hlint";
71 name = "hlint";
70 version = "2.2.11";
72 version = "2.2.11";
71 index-state = "2020-04-15T00:00:00Z";
73 index-state = "2020-04-15T00:00:00Z";
@@ -92,8 +94,9 @@ stack projects)
92
94
93```nix
95```nix
94let inherit (import ./. {}) sources nixpkgsArgs;
96let inherit (import ./. {}) sources nixpkgsArgs;
95− pkgs = import sources.nixpkgs-default nixpkgsArgs;
97+ pkgs = import sources.nixpkgs nixpkgsArgs;
96 hlint = pkgs.haskell-nix.hackage-package {
98 hlint = pkgs.haskell-nix.hackage-package {
99+ compiler-nix-name = "ghc883";
97 name = "hlint";
100 name = "hlint";
98 version = "2.2.11";
101 version = "2.2.11";
99 index-state = "2020-04-15T00:00:00Z";
102 index-state = "2020-04-15T00:00:00Z";
@@ -121,8 +124,9 @@ To capture the nix we can do something like:
121
124
122```nix
125```nix
123let inherit (import ./. {}) sources nixpkgsArgs;
126let inherit (import ./. {}) sources nixpkgsArgs;
124− pkgs = import sources.nixpkgs-default nixpkgsArgs;
127+ pkgs = import sources.nixpkgs nixpkgsArgs;
125 hlint = pkgs.haskell-nix.hackage-package {
128 hlint = pkgs.haskell-nix.hackage-package {
129+ compiler-nix-name = "ghc883";
126 name = "hlint";
130 name = "hlint";
127 version = "2.2.11";
131 version = "2.2.11";
128 index-state = "2020-04-15T00:00:00Z";
132 index-state = "2020-04-15T00:00:00Z";
@@ -155,8 +159,9 @@ If we choose to add the `checkMaterialization` flag you would have:
155
159
156```nix
160```nix
157let inherit (import ./. {}) sources nixpkgsArgs;
161let inherit (import ./. {}) sources nixpkgsArgs;
158− pkgs = import sources.nixpkgs-default nixpkgsArgs;
162+ pkgs = import sources.nixpkgs nixpkgsArgs;
159 hlint = pkgs.haskell-nix.hackage-package {
163 hlint = pkgs.haskell-nix.hackage-package {
164+ compiler-nix-name = "ghc883";
160 name = "hlint";
165 name = "hlint";
161 version = "2.2.10";
166 version = "2.2.10";
162 index-state = "2020-04-15T00:00:00Z";
167 index-state = "2020-04-15T00:00:00Z";
@@ -199,8 +204,9 @@ For instance:
199
204
200```nix
205```nix
201let inherit (import ./. {}) sources nixpkgsArgs;
206let inherit (import ./. {}) sources nixpkgsArgs;
202− pkgs = import sources.nixpkgs-default nixpkgsArgs;
207+ pkgs = import sources.nixpkgs nixpkgsArgs;
203 hlint = pkgs.haskell-nix.hackage-project {
208 hlint = pkgs.haskell-nix.hackage-project {
209+ compiler-nix-name = "ghc883";
204 name = "hlint";
210 name = "hlint";
205 version = "2.2.10";
211 version = "2.2.10";
206 index-state = "2020-04-15T00:00:00Z";
212 index-state = "2020-04-15T00:00:00Z";
@@ -236,9 +242,10 @@ a non-existing path is now an error:
236
242
237```nix
243```nix
238let inherit (import ./. {}) sources nixpkgsArgs;
244let inherit (import ./. {}) sources nixpkgsArgs;
239− pkgs = import sources.nixpkgs-default nixpkgsArgs;
245+ pkgs = import sources.nixpkgs nixpkgsArgs;
240 hlintPlan = /nix/store/kk047cqsjvbj4w8psv4l05abdcnyrqdc-hlint-plan-to-nix-pkgs;
246 hlintPlan = /nix/store/kk047cqsjvbj4w8psv4l05abdcnyrqdc-hlint-plan-to-nix-pkgs;
241 hlint = pkgs.haskell-nix.hackage-package {
247 hlint = pkgs.haskell-nix.hackage-package {
248+ compiler-nix-name = "ghc883";
242 name = "hlint";
249 name = "hlint";
243 version = "2.2.11";
250 version = "2.2.11";
244 index-state = "2020-04-15T00:00:00Z";
251 index-state = "2020-04-15T00:00:00Z";
examples/cardano-sl-mingw32.nix+1−1
@@ -1,3 +1,3 @@
1let inherit (import ../. {}) sources nixpkgsArgs;
1let inherit (import ../. {}) sources nixpkgsArgs;
2− pkgs = import sources.nixpkgs-default (nixpkgsArgs // { crossSystem.config = "x86_64-pc-mingw32"; });
2+ pkgs = import sources.nixpkgs (nixpkgsArgs // { crossSystem.config = "x86_64-pc-mingw32"; });
3in (pkgs.haskell-nix.stackProject (import ./cardano-sl-args.nix)).cardano-sl.components.all
3in (pkgs.haskell-nix.stackProject (import ./cardano-sl-args.nix)).cardano-sl.components.all
examples/cardano-sl.nix+1−1
@@ -1,3 +1,3 @@
1let inherit (import ../. {}) sources nixpkgsArgs;
1let inherit (import ../. {}) sources nixpkgsArgs;
2− pkgs = import sources.nixpkgs-default nixpkgsArgs;
2+ pkgs = import sources.nixpkgs nixpkgsArgs;
3in (pkgs.haskell-nix.stackProject (import ./cardano-sl-args.nix)).cardano-sl.components.all
3in (pkgs.haskell-nix.stackProject (import ./cardano-sl-args.nix)).cardano-sl.components.all
examples/cardano-wallet-ghcjs.nix+1−1
@@ -1,5 +1,5 @@
1let inherit (import ../. {}) sources nixpkgsArgs;
1let inherit (import ../. {}) sources nixpkgsArgs;
2− pkgs = import sources.nixpkgs-default (nixpkgsArgs // { crossSystem.config = "js-unknown-ghcjs"; });
2+ pkgs = import sources.nixpkgs (nixpkgsArgs // { crossSystem.config = "js-unknown-ghcjs"; });
3 Cabal = pkgs.buildPackages.haskell-nix.hackage-package {
3 Cabal = pkgs.buildPackages.haskell-nix.hackage-package {
4 name = "Cabal"; version = "2.4.1.0";
4 name = "Cabal"; version = "2.4.1.0";
5 modules = [
5 modules = [
examples/cardano-wallet-mingw32.nix+1−1
@@ -1,3 +1,3 @@
1let inherit (import ../. {}) sources nixpkgsArgs;
1let inherit (import ../. {}) sources nixpkgsArgs;
2− pkgs = import sources.nixpkgs-default (nixpkgsArgs // { crossSystem.config = "x86_64-pc-mingw32"; });
2+ pkgs = import sources.nixpkgs (nixpkgsArgs // { crossSystem.config = "x86_64-pc-mingw32"; });
3in (pkgs.haskell-nix.stackProject (import ./cardano-wallet-args.nix)).cardano-wallet.components.all
3in (pkgs.haskell-nix.stackProject (import ./cardano-wallet-args.nix)).cardano-wallet.components.all
examples/cardano-wallet-rpi.nix+1−1
@@ -1,5 +1,5 @@
1let inherit (import ../. {}) sources nixpkgsArgs;
1let inherit (import ../. {}) sources nixpkgsArgs;
2− pkgs = import sources.nixpkgs-default (nixpkgsArgs // { crossSystem.config = "armv6l-unknown-linux-gnueabihf"; });
2+ pkgs = import sources.nixpkgs (nixpkgsArgs // { crossSystem.config = "armv6l-unknown-linux-gnueabihf"; });
3 Cabal = pkgs.buildPackages.haskell-nix.hackage-package {
3 Cabal = pkgs.buildPackages.haskell-nix.hackage-package {
4 name = "Cabal"; version = "2.4.1.0";
4 name = "Cabal"; version = "2.4.1.0";
5 modules = [
5 modules = [
examples/cardano-wallet.nix+1−1
@@ -1,3 +1,3 @@
1let inherit (import ../. {}) sources nixpkgsArgs;
1let inherit (import ../. {}) sources nixpkgsArgs;
2− pkgs = import sources.nixpkgs-default nixpkgsArgs;
2+ pkgs = import sources.nixpkgs nixpkgsArgs;
3in (pkgs.haskell-nix.stackProject (import ./cardano-wallet-args.nix)).cardano-wallet.components.all
3in (pkgs.haskell-nix.stackProject (import ./cardano-wallet-args.nix)).cardano-wallet.components.all
examples/plutus-mingw32.nix+1−1
@@ -1,3 +1,3 @@
1let inherit (import ../. {}) sources nixpkgsArgs;
1let inherit (import ../. {}) sources nixpkgsArgs;
2− pkgs = import sources.nixpkgs-default (nixpkgsArgs // { crossSystem.config = "x86_64-pc-mingw32"; });
2+ pkgs = import sources.nixpkgs (nixpkgsArgs // { crossSystem.config = "x86_64-pc-mingw32"; });
3in (pkgs.haskell-nix.stackProject (import ./plutus-args.nix)).language-plutus-core.components.all
3in (pkgs.haskell-nix.stackProject (import ./plutus-args.nix)).language-plutus-core.components.all
examples/plutus.nix+1−1
@@ -1,3 +1,3 @@
1let inherit (import ../. {}) sources nixpkgsArgs;
1let inherit (import ../. {}) sources nixpkgsArgs;
2− pkgs = import sources.nixpkgs-default nixpkgsArgs;
2+ pkgs = import sources.nixpkgs nixpkgsArgs;
3in (pkgs.haskell-nix.stackProject (import ./plutus-args.nix)).language-plutus-core.components.all
3in (pkgs.haskell-nix.stackProject (import ./plutus-args.nix)).language-plutus-core.components.all
flake.nix+1−1
@@ -22,7 +22,7 @@
22 value = f name;
22 value = f name;
23 }) lst);
23 }) lst);
24 in genAttrs [ "x86_64-linux" "x86_64-darwin" ] (system:
24 in genAttrs [ "x86_64-linux" "x86_64-darwin" ] (system:
25− import self.sources.nixpkgs-default
25+ import self.sources.nixpkgs
26 (self.nixpkgsArgs // { localSystem = { inherit system; }; }));
26 (self.nixpkgsArgs // { localSystem = { inherit system; }; }));
27 };
27 };
28}
28}
lib/cabal-licenses.nix+1
@@ -12,6 +12,7 @@ lib: with lib.licenses;
12 "AGPL-3.0-only" = agpl3;
12 "AGPL-3.0-only" = agpl3;
13 "AGPL-3.0-or-later" = agpl3Plus;
13 "AGPL-3.0-or-later" = agpl3Plus;
14 "Apache-2.0" = asl20;
14 "Apache-2.0" = asl20;
15+ "GPL-2.0-or-later AND BSD-3-Clause" = [gpl2Plus bsd3];
15 # Generic
16 # Generic
16 LicenseRef-Apache = "Apache";
17 LicenseRef-Apache = "Apache";
17 LicenseRef-GPL = "GPL";
18 LicenseRef-GPL = "GPL";
lib/call-cabal-project-to-nix.nix+7−9
@@ -1,4 +1,4 @@
1−{ dotCabal, pkgs, runCommand, nix-tools, cabal-install, ghc, hpack, symlinkJoin, cacert, index-state-hashes, haskellLib, materialize }@defaults:
1+{ dotCabal, pkgs, runCommand, evalPackages, symlinkJoin, cacert, index-state-hashes, haskellLib, materialize }@defaults:
2let readIfExists = src: fileName:
2let readIfExists = src: fileName:
3 let origSrcDir = src.origSrcSubDir or src;
3 let origSrcDir = src.origSrcSubDir or src;
4 in
4 in
@@ -8,6 +8,7 @@ let readIfExists = src: fileName:
8in
8in
9{ name ? src.name or null # optional name for better error messages
9{ name ? src.name or null # optional name for better error messages
10, src
10, src
11+, compiler-nix-name # The name of the ghc compiler to use eg. "ghc883"
11, index-state ? null # Hackage index-state, eg. "2019-10-10T00:00:00Z"
12, index-state ? null # Hackage index-state, eg. "2019-10-10T00:00:00Z"
12, index-sha256 ? null # The hash of the truncated hackage index-state
13, index-sha256 ? null # The hash of the truncated hackage index-state
13, plan-sha256 ? null # The hash of the plan-to-nix output (makes the plan-to-nix step a fixed output derivation)
14, plan-sha256 ? null # The hash of the plan-to-nix output (makes the plan-to-nix step a fixed output derivation)
@@ -17,12 +18,11 @@ in
17, cabalProject ? readIfExists src cabalProjectFileName
18, cabalProject ? readIfExists src cabalProjectFileName
18, cabalProjectLocal ? readIfExists src "${cabalProjectFileName}.local"
19, cabalProjectLocal ? readIfExists src "${cabalProjectFileName}.local"
19, cabalProjectFreeze ? readIfExists src "${cabalProjectFileName}.freeze"
20, cabalProjectFreeze ? readIfExists src "${cabalProjectFileName}.freeze"
20−, compiler-nix-name ? null # Nix name of the ghc compiler as a string eg. "ghc883"
21+, caller ? "callCabalProjectToNix" # Name of the calling funcion for better warning messages
21, ghc ? null # Deprecated in favour of `compiler-nix-name`
22, ghc ? null # Deprecated in favour of `compiler-nix-name`
22, ghcOverride ? null # Used when we need to set ghc explicitly during bootstrapping
23, ghcOverride ? null # Used when we need to set ghc explicitly during bootstrapping
23−, nix-tools ? defaults.nix-tools
24+, nix-tools ? evalPackages.haskell-nix.nix-tools.${compiler-nix-name} # When building cabal projects we use the nix-tools
24−, hpack ? defaults.hpack
25+, cabal-install ? evalPackages.haskell-nix.cabal-install.${compiler-nix-name} # and cabal-install compiled with matching ghc version
25−, cabal-install ? defaults.cabal-install
26, configureArgs ? "" # Extra arguments to pass to `cabal v2-configure`.
26, configureArgs ? "" # Extra arguments to pass to `cabal v2-configure`.
27 # `--enable-tests --enable-benchmarks` are included by default.
27 # `--enable-tests --enable-benchmarks` are included by default.
28 # If the tests and benchmarks are not needed and they
28 # If the tests and benchmarks are not needed and they
@@ -56,7 +56,6 @@ let
56 + "pick the correct `ghc` package from the respective buildPackages. "
56 + "pick the correct `ghc` package from the respective buildPackages. "
57 + "For example use `compiler-nix-name = \"ghc865\";` for ghc 8.6.5") ghc
57 + "For example use `compiler-nix-name = \"ghc865\";` for ghc 8.6.5") ghc
58 else
58 else
59− if compiler-nix-name != null
60 # Do note that `pkgs = final.buildPackages` in the `overlays/haskell.nix`
59 # Do note that `pkgs = final.buildPackages` in the `overlays/haskell.nix`
61 # call to this file. And thus `pkgs` here is the proper `buildPackages`
60 # call to this file. And thus `pkgs` here is the proper `buildPackages`
62 # set and we do not need, nor should pick the compiler from another level
61 # set and we do not need, nor should pick the compiler from another level
@@ -65,8 +64,7 @@ let
65 #
64 #
66 # > The option `packages.Win32.package.identifier.name' is used but not defined.
65 # > The option `packages.Win32.package.identifier.name' is used but not defined.
67 #
66 #
68− then pkgs.haskell-nix.compiler."${compiler-nix-name}"
67+ pkgs.haskell-nix.compiler."${compiler-nix-name}";
69− else defaults.ghc;
70
68
71in
69in
72 assert (if ghc'.isHaskellNixCompiler or false then true
70 assert (if ghc'.isHaskellNixCompiler or false then true
@@ -386,7 +384,7 @@ let
386 } // pkgs.lib.optionalAttrs (checkMaterialization != null) {
384 } // pkgs.lib.optionalAttrs (checkMaterialization != null) {
387 inherit checkMaterialization;
385 inherit checkMaterialization;
388 }) (pkgs.evalPackages.runCommand (if name == null then "plan-to-nix-pkgs" else name + "-plan-to-nix-pkgs") {
386 }) (pkgs.evalPackages.runCommand (if name == null then "plan-to-nix-pkgs" else name + "-plan-to-nix-pkgs") {
389− nativeBuildInputs = [ nix-tools dummy-ghc dummy-ghc-pkg hpack cabal-install pkgs.evalPackages.rsync ];
387+ nativeBuildInputs = [ nix-tools dummy-ghc dummy-ghc-pkg cabal-install pkgs.evalPackages.rsync ];
390 # Needed or stack-to-nix will die on unicode inputs
388 # Needed or stack-to-nix will die on unicode inputs
391 LOCALE_ARCHIVE = pkgs.lib.optionalString (pkgs.stdenv.hostPlatform.libc == "glibc") "${pkgs.glibcLocales}/lib/locale/locale-archive";
389 LOCALE_ARCHIVE = pkgs.lib.optionalString (pkgs.stdenv.hostPlatform.libc == "glibc") "${pkgs.glibcLocales}/lib/locale/locale-archive";
392 LANG = "en_US.UTF-8";
390 LANG = "en_US.UTF-8";
lib/call-stack-to-nix.nix+2−1
@@ -5,7 +5,7 @@
5 *
5 *
6 * see also `call-cabal-project-to-nix`!
6 * see also `call-cabal-project-to-nix`!
7 */
7 */
8−{ runCommand, nix-tools, pkgs, mkCacheFile, materialize, haskellLib }:
8+{ runCommand, pkgs, mkCacheFile, materialize, haskellLib }:
9{ name ? src.name or null # optional name for better error messages
9{ name ? src.name or null # optional name for better error messages
10, src
10, src
11, stackYaml ? "stack.yaml"
11, stackYaml ? "stack.yaml"
@@ -15,6 +15,7 @@
15, resolverSha256 ? null
15, resolverSha256 ? null
16, materialized ? null # Location of a materialized copy of the nix files
16, materialized ? null # Location of a materialized copy of the nix files
17, checkMaterialization ? null # If true the nix files will be generated used to check plan-sha256 and material
17, checkMaterialization ? null # If true the nix files will be generated used to check plan-sha256 and material
18+, nix-tools ? pkgs.haskell-nix.internal-nix-tools # When building stack projects we use the internal nix-tools (compiled with a fixed GHC version)
18, ... }:
19, ... }:
19let
20let
20 inherit (haskellLib.fetchResolver {
21 inherit (haskellLib.fetchResolver {
lib/stack-cache-generator.nix+2−1
@@ -1,6 +1,6 @@
1# Generate cache entries for dependencies of package defined in `src`
1# Generate cache entries for dependencies of package defined in `src`
2
2
3−{ pkgs, haskellLib, nix-tools }:
3+{ pkgs, haskellLib }:
4{ src
4{ src
5, stackYaml ? "stack.yaml"
5, stackYaml ? "stack.yaml"
6, sha256map ? null
6, sha256map ? null
@@ -14,6 +14,7 @@
14 then { location, tag, ...}: sha256map."${location}"."${tag}"
14 then { location, tag, ...}: sha256map."${location}"."${tag}"
15 else _: null
15 else _: null
16, resolverSha256 ? null
16, resolverSha256 ? null
17+, nix-tools ? pkgs.haskell-nix.internal-nix-tools # When building stack projects we use the internal nix-tools (compiled with a fixed GHC version)
17, ...
18, ...
18}:
19}:
19let
20let
materialized/ghc8101/happy/.plan.nix/happy.nix → materialized/bootstrap/ghc844/happy-1.19.12/.plan.nix/happy.nixrenamed

The content is the same.

materialized/ghc865/happy/default.nix → materialized/bootstrap/ghc844/happy-1.19.12/default.nixrenamed+20−20
@@ -2,40 +2,40 @@
2 pkgs = hackage:
2 pkgs = hackage:
3 {
3 {
4 packages = {
4 packages = {
5− "ghc-prim".revision = (((hackage."ghc-prim")."0.5.3").revisions).default;
5+ "ghc-prim".revision = (((hackage."ghc-prim")."0.5.2.0").revisions).default;
6 "unix".revision = (((hackage."unix")."2.7.2.2").revisions).default;
6 "unix".revision = (((hackage."unix")."2.7.2.2").revisions).default;
7 "mtl".revision = (((hackage."mtl")."2.2.2").revisions).default;
7 "mtl".revision = (((hackage."mtl")."2.2.2").revisions).default;
8 "rts".revision = (((hackage."rts")."1.0").revisions).default;
8 "rts".revision = (((hackage."rts")."1.0").revisions).default;
9− "deepseq".revision = (((hackage."deepseq")."1.4.4.0").revisions).default;
9+ "deepseq".revision = (((hackage."deepseq")."1.4.3.0").revisions).default;
10− "directory".revision = (((hackage."directory")."1.3.3.0").revisions).default;
10+ "directory".revision = (((hackage."directory")."1.3.1.5").revisions).default;
11− "containers".revision = (((hackage."containers")."0.6.0.1").revisions).default;
11+ "containers".revision = (((hackage."containers")."0.5.11.0").revisions).default;
12 "bytestring".revision = (((hackage."bytestring")."0.10.8.2").revisions).default;
12 "bytestring".revision = (((hackage."bytestring")."0.10.8.2").revisions).default;
13− "base".revision = (((hackage."base")."4.12.0.0").revisions).default;
13+ "base".revision = (((hackage."base")."4.11.1.0").revisions).default;
14 "time".revision = (((hackage."time")."1.8.0.2").revisions).default;
14 "time".revision = (((hackage."time")."1.8.0.2").revisions).default;
15− "transformers".revision = (((hackage."transformers")."0.5.6.2").revisions).default;
15+ "transformers".revision = (((hackage."transformers")."0.5.5.0").revisions).default;
16− "filepath".revision = (((hackage."filepath")."1.4.2.1").revisions).default;
16+ "filepath".revision = (((hackage."filepath")."1.4.2").revisions).default;
17− "process".revision = (((hackage."process")."1.6.5.0").revisions).default;
17+ "process".revision = (((hackage."process")."1.6.3.0").revisions).default;
18− "array".revision = (((hackage."array")."0.5.3.0").revisions).default;
18+ "array".revision = (((hackage."array")."0.5.2.0").revisions).default;
19 "integer-gmp".revision = (((hackage."integer-gmp")."1.0.2.0").revisions).default;
19 "integer-gmp".revision = (((hackage."integer-gmp")."1.0.2.0").revisions).default;
20 };
20 };
21 compiler = {
21 compiler = {
22− version = "8.6.5";
22+ version = "8.4.4";
23− nix-name = "ghc865";
23+ nix-name = "ghc844";
24 packages = {
24 packages = {
25− "ghc-prim" = "0.5.3";
25+ "ghc-prim" = "0.5.2.0";
26 "unix" = "2.7.2.2";
26 "unix" = "2.7.2.2";
27 "mtl" = "2.2.2";
27 "mtl" = "2.2.2";
28 "rts" = "1.0";
28 "rts" = "1.0";
29− "deepseq" = "1.4.4.0";
29+ "deepseq" = "1.4.3.0";
30− "directory" = "1.3.3.0";
30+ "directory" = "1.3.1.5";
31− "containers" = "0.6.0.1";
31+ "containers" = "0.5.11.0";
32 "bytestring" = "0.10.8.2";
32 "bytestring" = "0.10.8.2";
33− "base" = "4.12.0.0";
33+ "base" = "4.11.1.0";
34 "time" = "1.8.0.2";
34 "time" = "1.8.0.2";
35− "transformers" = "0.5.6.2";
35+ "transformers" = "0.5.5.0";
36− "filepath" = "1.4.2.1";
36+ "filepath" = "1.4.2";
37− "process" = "1.6.5.0";
37+ "process" = "1.6.3.0";
38− "array" = "0.5.3.0";
38+ "array" = "0.5.2.0";
39 "integer-gmp" = "1.0.2.0";
39 "integer-gmp" = "1.0.2.0";
40 };
40 };
41 };
41 };
materialized/ghc-extra-projects/cross/ghc865/.plan.nix/ghc.nix+1
@@ -14,6 +14,7 @@
14 stage1 = false;
14 stage1 = false;
15 stage2 = true;
15 stage2 = true;
16 stage3 = false;
16 stage3 = false;
17+ dynamic-system-linker = true;
17 };
18 };
18 package = {
19 package = {
19 specVersion = "1.10";
20 specVersion = "1.10";
materialized/ghc-extra-projects/cross/ghc865/default.nix+1
@@ -73,6 +73,7 @@
73 "stage1" = lib.mkOverride 900 false;
73 "stage1" = lib.mkOverride 900 false;
74 "stage2" = lib.mkOverride 900 true;
74 "stage2" = lib.mkOverride 900 true;
75 "stage3" = lib.mkOverride 900 false;
75 "stage3" = lib.mkOverride 900 false;
76+ "dynamic-system-linker" = lib.mkOverride 900 true;
76 "ghci" = lib.mkOverride 900 true;
77 "ghci" = lib.mkOverride 900 true;
77 "terminfo" = lib.mkOverride 900 true;
78 "terminfo" = lib.mkOverride 900 true;
78 };
79 };
materialized/ghc-extra-projects/default/ghc865/.plan.nix/ghc.nix+1
@@ -14,6 +14,7 @@
14 stage1 = false;
14 stage1 = false;
15 stage2 = true;
15 stage2 = true;
16 stage3 = false;
16 stage3 = false;
17+ dynamic-system-linker = true;
17 };
18 };
18 package = {
19 package = {
19 specVersion = "1.10";
20 specVersion = "1.10";
materialized/ghc-extra-projects/default/ghc865/default.nix+1
@@ -74,6 +74,7 @@
74 "stage1" = lib.mkOverride 900 false;
74 "stage1" = lib.mkOverride 900 false;
75 "stage2" = lib.mkOverride 900 true;
75 "stage2" = lib.mkOverride 900 true;
76 "stage3" = lib.mkOverride 900 false;
76 "stage3" = lib.mkOverride 900 false;
77+ "dynamic-system-linker" = lib.mkOverride 900 true;
77 "ghci" = lib.mkOverride 900 true;
78 "ghci" = lib.mkOverride 900 true;
78 "terminfo" = lib.mkOverride 900 true;
79 "terminfo" = lib.mkOverride 900 true;
79 };
80 };
materialized/ghc-extra-projects/windows/ghc865/.plan.nix/ghc.nix+1
@@ -14,6 +14,7 @@
14 stage1 = false;
14 stage1 = false;
15 stage2 = true;
15 stage2 = true;
16 stage3 = false;
16 stage3 = false;
17+ dynamic-system-linker = true;
17 };
18 };
18 package = {
19 package = {
19 specVersion = "1.10";
20 specVersion = "1.10";
materialized/ghc-extra-projects/windows/ghc865/default.nix+1
@@ -71,6 +71,7 @@
71 "stage1" = lib.mkOverride 900 false;
71 "stage1" = lib.mkOverride 900 false;
72 "stage2" = lib.mkOverride 900 true;
72 "stage2" = lib.mkOverride 900 true;
73 "stage3" = lib.mkOverride 900 false;
73 "stage3" = lib.mkOverride 900 false;
74+ "dynamic-system-linker" = lib.mkOverride 900 true;
74 "ghci" = lib.mkOverride 900 true;
75 "ghci" = lib.mkOverride 900 true;
75 "terminfo" = lib.mkOverride 900 true;
76 "terminfo" = lib.mkOverride 900 true;
76 };
77 };
materialized/ghc8101/alex/.plan.nix/alex.nixdeleted−160
@@ -1,160 +0,0 @@
1−{ system
2− , compiler
3− , flags
4− , pkgs
5− , hsPkgs
6− , pkgconfPkgs
7− , errorHandler
8− , config
9− , ... }:
10− {
11− flags = { small_base = true; };
12− package = {
13− specVersion = "1.8";
14− identifier = { name = "alex"; version = "3.2.5"; };
15− license = "BSD-3-Clause";
16− copyright = "(c) Chis Dornan, Simon Marlow";
17− maintainer = "Simon Marlow <marlowsd@gmail.com>";
18− author = "Chris Dornan and Simon Marlow";
19− homepage = "http://www.haskell.org/alex/";
20− url = "";
21− synopsis = "Alex is a tool for generating lexical analysers in Haskell";
22− description = "Alex is a tool for generating lexical analysers in Haskell.\nIt takes a description of tokens based on regular\nexpressions and generates a Haskell module containing code\nfor scanning text efficiently. It is similar to the tool\nlex or flex for C/C++.";
23− buildType = "Simple";
24− isLocal = true;
25− detailLevel = "FullDetails";
26− licenseFiles = [ "LICENSE" ];
27− dataDir = "data/";
28− dataFiles = [
29− "AlexTemplate"
30− "AlexTemplate-ghc"
31− "AlexTemplate-ghc-nopred"
32− "AlexTemplate-ghc-debug"
33− "AlexTemplate-debug"
34− "AlexWrapper-basic"
35− "AlexWrapper-basic-bytestring"
36− "AlexWrapper-strict-bytestring"
37− "AlexWrapper-posn"
38− "AlexWrapper-posn-bytestring"
39− "AlexWrapper-monad"
40− "AlexWrapper-monad-bytestring"
41− "AlexWrapper-monadUserState"
42− "AlexWrapper-monadUserState-bytestring"
43− "AlexWrapper-gscan"
44− ];
45− extraSrcFiles = [
46− "CHANGELOG.md"
47− "README.md"
48− "TODO"
49− "alex.spec"
50− "doc/Makefile"
51− "doc/aclocal.m4"
52− "doc/alex.1.in"
53− "doc/alex.xml"
54− "doc/config.mk.in"
55− "doc/configure.ac"
56− "doc/docbook-xml.mk"
57− "doc/fptools.css"
58− "examples/Makefile"
59− "examples/Tokens.x"
60− "examples/Tokens_gscan.x"
61− "examples/Tokens_posn.x"
62− "examples/examples.x"
63− "examples/haskell.x"
64− "examples/lit.x"
65− "examples/pp.x"
66− "examples/state.x"
67− "examples/tiny.y"
68− "examples/words.x"
69− "examples/words_monad.x"
70− "examples/words_posn.x"
71− "src/Parser.y.boot"
72− "src/Scan.x.boot"
73− "src/ghc_hooks.c"
74− "templates/GenericTemplate.hs"
75− "templates/wrappers.hs"
76− "tests/Makefile"
77− "tests/simple.x"
78− "tests/null.x"
79− "tests/tokens.x"
80− "tests/tokens_gscan.x"
81− "tests/tokens_posn.x"
82− "tests/tokens_bytestring.x"
83− "tests/tokens_posn_bytestring.x"
84− "tests/tokens_scan_user.x"
85− "tests/tokens_strict_bytestring.x"
86− "tests/tokens_monad_bytestring.x"
87− "tests/tokens_monadUserState_bytestring.x"
88− "tests/tokens_bytestring_unicode.x"
89− "tests/basic_typeclass.x"
90− "tests/basic_typeclass_bytestring.x"
91− "tests/default_typeclass.x"
92− "tests/gscan_typeclass.x"
93− "tests/posn_typeclass.x"
94− "tests/monad_typeclass.x"
95− "tests/monad_typeclass_bytestring.x"
96− "tests/monadUserState_typeclass.x"
97− "tests/monadUserState_typeclass_bytestring.x"
98− "tests/posn_typeclass_bytestring.x"
99− "tests/strict_typeclass.x"
100− "tests/unicode.x"
101− ];
102− extraTmpFiles = [];
103− extraDocFiles = [];
104− };
105− components = {
106− exes = {
107− "alex" = {
108− depends = [
109− (hsPkgs."base" or (errorHandler.buildDepError "base"))
110− ] ++ (if flags.small_base
111− then [
112− (hsPkgs."base" or (errorHandler.buildDepError "base"))
113− (hsPkgs."array" or (errorHandler.buildDepError "array"))
114− (hsPkgs."containers" or (errorHandler.buildDepError "containers"))
115− (hsPkgs."directory" or (errorHandler.buildDepError "directory"))
116− ]
117− else [ (hsPkgs."base" or (errorHandler.buildDepError "base")) ]);
118− buildable = true;
119− modules = [
120− "AbsSyn"
121− "CharSet"
122− "DFA"
123− "DFAMin"
124− "DFS"
125− "Info"
126− "Map"
127− "NFA"
128− "Output"
129− "Paths_alex"
130− "Parser"
131− "ParseMonad"
132− "Scan"
133− "Set"
134− "Sort"
135− "Util"
136− "UTF8"
137− "Data/Ranged"
138− "Data/Ranged/Boundaries"
139− "Data/Ranged/RangedSet"
140− "Data/Ranged/Ranges"
141− ];
142− hsSourceDirs = [ "src" ];
143− mainPath = [ "Main.hs" ] ++ [ "" ];
144− };
145− };
146− tests = {
147− "tests" = {
148− depends = [
149− (hsPkgs."base" or (errorHandler.buildDepError "base"))
150− (hsPkgs."process" or (errorHandler.buildDepError "process"))
151− ];
152− build-tools = [
153− (hsPkgs.buildPackages.alex or (pkgs.buildPackages.alex or (errorHandler.buildToolDepError "alex")))
154− ];
155− buildable = true;
156− mainPath = [ "test.hs" ];
157− };
158− };
159− };
160− } // rec { src = (pkgs.lib).mkDefault ../.; }
materialized/ghc8101/alex/default.nixdeleted−49
@@ -1,49 +0,0 @@
1−{
2− pkgs = hackage:
3− {
4− packages = {
5− "ghc-prim".revision = (((hackage."ghc-prim")."0.6.1").revisions).default;
6− "unix".revision = (((hackage."unix")."2.7.2.2").revisions).default;
7− "rts".revision = (((hackage."rts")."1.0").revisions).default;
8− "deepseq".revision = (((hackage."deepseq")."1.4.4.0").revisions).default;
9− "directory".revision = (((hackage."directory")."1.3.6.0").revisions).default;
10− "containers".revision = (((hackage."containers")."0.6.2.1").revisions).default;
11− "bytestring".revision = (((hackage."bytestring")."0.10.10.0").revisions).default;
12− "base".revision = (((hackage."base")."4.14.0.0").revisions).default;
13− "time".revision = (((hackage."time")."1.9.3").revisions).default;
14− "filepath".revision = (((hackage."filepath")."1.4.2.1").revisions).default;
15− "process".revision = (((hackage."process")."1.6.8.2").revisions).default;
16− "array".revision = (((hackage."array")."0.5.4.0").revisions).default;
17− "integer-gmp".revision = (((hackage."integer-gmp")."1.0.3.0").revisions).default;
18− };
19− compiler = {
20− version = "8.10.1";
21− nix-name = "ghc8101";
22− packages = {
23− "ghc-prim" = "0.6.1";
24− "unix" = "2.7.2.2";
25− "rts" = "1.0";
26− "deepseq" = "1.4.4.0";
27− "directory" = "1.3.6.0";
28− "containers" = "0.6.2.1";
29− "bytestring" = "0.10.10.0";
30− "base" = "4.14.0.0";
31− "time" = "1.9.3";
32− "filepath" = "1.4.2.1";
33− "process" = "1.6.8.2";
34− "array" = "0.5.4.0";
35− "integer-gmp" = "1.0.3.0";
36− };
37− };
38− };
39− extras = hackage:
40− { packages = { alex = ./.plan.nix/alex.nix; }; };
41− modules = [
42− ({ lib, ... }:
43− {
44− packages = {
45− "alex" = { flags = { "small_base" = lib.mkOverride 900 true; }; };
46− };
47− })
48− ];
49− }
materialized/ghc8101/cabal-install/default.nix+1−1
@@ -35,7 +35,7 @@
35 "bytestring".revision = (((hackage."bytestring")."0.10.10.0").revisions).default;
35 "bytestring".revision = (((hackage."bytestring")."0.10.10.0").revisions).default;
36 "text".revision = (((hackage."text")."1.2.3.2").revisions).default;
36 "text".revision = (((hackage."text")."1.2.3.2").revisions).default;
37 "Cabal".revision = (((hackage."Cabal")."3.2.0.0").revisions).default;
37 "Cabal".revision = (((hackage."Cabal")."3.2.0.0").revisions).default;
38− "base64-bytestring".revision = (((hackage."base64-bytestring")."1.1.0.0").revisions).default;
38+ "base64-bytestring".revision = (((hackage."base64-bytestring")."1.0.0.3").revisions).default;
39 "base".revision = (((hackage."base")."4.14.0.0").revisions).default;
39 "base".revision = (((hackage."base")."4.14.0.0").revisions).default;
40 "time".revision = (((hackage."time")."1.9.3").revisions).default;
40 "time".revision = (((hackage."time")."1.9.3").revisions).default;
41 "base16-bytestring".revision = (((hackage."base16-bytestring")."0.1.1.6").revisions).default;
41 "base16-bytestring".revision = (((hackage."base16-bytestring")."0.1.1.6").revisions).default;
materialized/ghc8101/happy/default.nixdeleted−53
@@ -1,53 +0,0 @@
1−{
2− pkgs = hackage:
3− {
4− packages = {
5− "ghc-prim".revision = (((hackage."ghc-prim")."0.6.1").revisions).default;
6− "unix".revision = (((hackage."unix")."2.7.2.2").revisions).default;
7− "mtl".revision = (((hackage."mtl")."2.2.2").revisions).default;
8− "rts".revision = (((hackage."rts")."1.0").revisions).default;
9− "deepseq".revision = (((hackage."deepseq")."1.4.4.0").revisions).default;
10− "directory".revision = (((hackage."directory")."1.3.6.0").revisions).default;
11− "containers".revision = (((hackage."containers")."0.6.2.1").revisions).default;
12− "bytestring".revision = (((hackage."bytestring")."0.10.10.0").revisions).default;
13− "base".revision = (((hackage."base")."4.14.0.0").revisions).default;
14− "time".revision = (((hackage."time")."1.9.3").revisions).default;
15− "transformers".revision = (((hackage."transformers")."0.5.6.2").revisions).default;
16− "filepath".revision = (((hackage."filepath")."1.4.2.1").revisions).default;
17− "process".revision = (((hackage."process")."1.6.8.2").revisions).default;
18− "array".revision = (((hackage."array")."0.5.4.0").revisions).default;
19− "integer-gmp".revision = (((hackage."integer-gmp")."1.0.3.0").revisions).default;
20− };
21− compiler = {
22− version = "8.10.1";
23− nix-name = "ghc8101";
24− packages = {
25− "ghc-prim" = "0.6.1";
26− "unix" = "2.7.2.2";
27− "mtl" = "2.2.2";
28− "rts" = "1.0";
29− "deepseq" = "1.4.4.0";
30− "directory" = "1.3.6.0";
31− "containers" = "0.6.2.1";
32− "bytestring" = "0.10.10.0";
33− "base" = "4.14.0.0";
34− "time" = "1.9.3";
35− "transformers" = "0.5.6.2";
36− "filepath" = "1.4.2.1";
37− "process" = "1.6.8.2";
38− "array" = "0.5.4.0";
39− "integer-gmp" = "1.0.3.0";
40− };
41− };
42− };
43− extras = hackage:
44− { packages = { happy = ./.plan.nix/happy.nix; }; };
45− modules = [
46− ({ lib, ... }:
47− {
48− packages = {
49− "happy" = { flags = { "small_base" = lib.mkOverride 900 true; }; };
50− };
51− })
52− ];
53− }
materialized/ghc865/alex/.plan.nix/alex.nixdeleted−160
@@ -1,160 +0,0 @@
1−{ system
2− , compiler
3− , flags
4− , pkgs
5− , hsPkgs
6− , pkgconfPkgs
7− , errorHandler
8− , config
9− , ... }:
10− {
11− flags = { small_base = true; };
12− package = {
13− specVersion = "1.8";
14− identifier = { name = "alex"; version = "3.2.5"; };
15− license = "BSD-3-Clause";
16− copyright = "(c) Chis Dornan, Simon Marlow";
17− maintainer = "Simon Marlow <marlowsd@gmail.com>";
18− author = "Chris Dornan and Simon Marlow";
19− homepage = "http://www.haskell.org/alex/";
20− url = "";
21− synopsis = "Alex is a tool for generating lexical analysers in Haskell";
22− description = "Alex is a tool for generating lexical analysers in Haskell.\nIt takes a description of tokens based on regular\nexpressions and generates a Haskell module containing code\nfor scanning text efficiently. It is similar to the tool\nlex or flex for C/C++.";
23− buildType = "Simple";
24− isLocal = true;
25− detailLevel = "FullDetails";
26− licenseFiles = [ "LICENSE" ];
27− dataDir = "data/";
28− dataFiles = [
29− "AlexTemplate"
30− "AlexTemplate-ghc"
31− "AlexTemplate-ghc-nopred"
32− "AlexTemplate-ghc-debug"
33− "AlexTemplate-debug"
34− "AlexWrapper-basic"
35− "AlexWrapper-basic-bytestring"
36− "AlexWrapper-strict-bytestring"
37− "AlexWrapper-posn"
38− "AlexWrapper-posn-bytestring"
39− "AlexWrapper-monad"
40− "AlexWrapper-monad-bytestring"
41− "AlexWrapper-monadUserState"
42− "AlexWrapper-monadUserState-bytestring"
43− "AlexWrapper-gscan"
44− ];
45− extraSrcFiles = [
46− "CHANGELOG.md"
47− "README.md"
48− "TODO"
49− "alex.spec"
50− "doc/Makefile"
51− "doc/aclocal.m4"
52− "doc/alex.1.in"
53− "doc/alex.xml"
54− "doc/config.mk.in"
55− "doc/configure.ac"
56− "doc/docbook-xml.mk"
57− "doc/fptools.css"
58− "examples/Makefile"
59− "examples/Tokens.x"
60− "examples/Tokens_gscan.x"
61− "examples/Tokens_posn.x"
62− "examples/examples.x"
63− "examples/haskell.x"
64− "examples/lit.x"
65− "examples/pp.x"
66− "examples/state.x"
67− "examples/tiny.y"
68− "examples/words.x"
69− "examples/words_monad.x"
70− "examples/words_posn.x"
71− "src/Parser.y.boot"
72− "src/Scan.x.boot"
73− "src/ghc_hooks.c"
74− "templates/GenericTemplate.hs"
75− "templates/wrappers.hs"
76− "tests/Makefile"
77− "tests/simple.x"
78− "tests/null.x"
79− "tests/tokens.x"
80− "tests/tokens_gscan.x"
81− "tests/tokens_posn.x"
82− "tests/tokens_bytestring.x"
83− "tests/tokens_posn_bytestring.x"
84− "tests/tokens_scan_user.x"
85− "tests/tokens_strict_bytestring.x"
86− "tests/tokens_monad_bytestring.x"
87− "tests/tokens_monadUserState_bytestring.x"
88− "tests/tokens_bytestring_unicode.x"
89− "tests/basic_typeclass.x"
90− "tests/basic_typeclass_bytestring.x"
91− "tests/default_typeclass.x"
92− "tests/gscan_typeclass.x"
93− "tests/posn_typeclass.x"
94− "tests/monad_typeclass.x"
95− "tests/monad_typeclass_bytestring.x"
96− "tests/monadUserState_typeclass.x"
97− "tests/monadUserState_typeclass_bytestring.x"
98− "tests/posn_typeclass_bytestring.x"
99− "tests/strict_typeclass.x"
100− "tests/unicode.x"
101− ];
102− extraTmpFiles = [];
103− extraDocFiles = [];
104− };
105− components = {
106− exes = {
107− "alex" = {
108− depends = [
109− (hsPkgs."base" or (errorHandler.buildDepError "base"))
110− ] ++ (if flags.small_base
111− then [
112− (hsPkgs."base" or (errorHandler.buildDepError "base"))
113− (hsPkgs."array" or (errorHandler.buildDepError "array"))
114− (hsPkgs."containers" or (errorHandler.buildDepError "containers"))
115− (hsPkgs."directory" or (errorHandler.buildDepError "directory"))
116− ]
117− else [ (hsPkgs."base" or (errorHandler.buildDepError "base")) ]);
118− buildable = true;
119− modules = [
120− "AbsSyn"
121− "CharSet"
122− "DFA"
123− "DFAMin"
124− "DFS"
125− "Info"
126− "Map"
127− "NFA"
128− "Output"
129− "Paths_alex"
130− "Parser"
131− "ParseMonad"
132− "Scan"
133− "Set"
134− "Sort"
135− "Util"
136− "UTF8"
137− "Data/Ranged"
138− "Data/Ranged/Boundaries"
139− "Data/Ranged/RangedSet"
140− "Data/Ranged/Ranges"
141− ];
142− hsSourceDirs = [ "src" ];
143− mainPath = [ "Main.hs" ] ++ [ "" ];
144− };
145− };
146− tests = {
147− "tests" = {
148− depends = [
149− (hsPkgs."base" or (errorHandler.buildDepError "base"))
150− (hsPkgs."process" or (errorHandler.buildDepError "process"))
151− ];
152− build-tools = [
153− (hsPkgs.buildPackages.alex or (pkgs.buildPackages.alex or (errorHandler.buildToolDepError "alex")))
154− ];
155− buildable = true;
156− mainPath = [ "test.hs" ];
157− };
158− };
159− };
160− } // rec { src = (pkgs.lib).mkDefault ../.; }
materialized/ghc865/alex/default.nixdeleted−49
@@ -1,49 +0,0 @@
1−{
2− pkgs = hackage:
3− {
4− packages = {
5− "ghc-prim".revision = (((hackage."ghc-prim")."0.5.3").revisions).default;
6− "unix".revision = (((hackage."unix")."2.7.2.2").revisions).default;
7− "rts".revision = (((hackage."rts")."1.0").revisions).default;
8− "deepseq".revision = (((hackage."deepseq")."1.4.4.0").revisions).default;
9− "directory".revision = (((hackage."directory")."1.3.3.0").revisions).default;
10− "containers".revision = (((hackage."containers")."0.6.0.1").revisions).default;
11− "bytestring".revision = (((hackage."bytestring")."0.10.8.2").revisions).default;
12− "base".revision = (((hackage."base")."4.12.0.0").revisions).default;
13− "time".revision = (((hackage."time")."1.8.0.2").revisions).default;
14− "filepath".revision = (((hackage."filepath")."1.4.2.1").revisions).default;
15− "process".revision = (((hackage."process")."1.6.5.0").revisions).default;
16− "array".revision = (((hackage."array")."0.5.3.0").revisions).default;
17− "integer-gmp".revision = (((hackage."integer-gmp")."1.0.2.0").revisions).default;
18− };
19− compiler = {
20− version = "8.6.5";
21− nix-name = "ghc865";
22− packages = {
23− "ghc-prim" = "0.5.3";
24− "unix" = "2.7.2.2";
25− "rts" = "1.0";
26− "deepseq" = "1.4.4.0";
27− "directory" = "1.3.3.0";
28− "containers" = "0.6.0.1";
29− "bytestring" = "0.10.8.2";
30− "base" = "4.12.0.0";
31− "time" = "1.8.0.2";
32− "filepath" = "1.4.2.1";
33− "process" = "1.6.5.0";
34− "array" = "0.5.3.0";
35− "integer-gmp" = "1.0.2.0";
36− };
37− };
38− };
39− extras = hackage:
40− { packages = { alex = ./.plan.nix/alex.nix; }; };
41− modules = [
42− ({ lib, ... }:
43− {
44− packages = {
45− "alex" = { flags = { "small_base" = lib.mkOverride 900 true; }; };
46− };
47− })
48− ];
49− }
materialized/ghc865/happy/.plan.nix/happy.nixdeleted−200
@@ -1,200 +0,0 @@
1−{ system
2− , compiler
3− , flags
4− , pkgs
5− , hsPkgs
6− , pkgconfPkgs
7− , errorHandler
8− , config
9− , ... }:
10− {
11− flags = { small_base = true; };
12− package = {
13− specVersion = "1.8";
14− identifier = { name = "happy"; version = "1.19.12"; };
15− license = "BSD-2-Clause";
16− copyright = "(c) Andy Gill, Simon Marlow";
17− maintainer = "Simon Marlow <marlowsd@gmail.com>";
18− author = "Andy Gill and Simon Marlow";
19− homepage = "https://www.haskell.org/happy/";
20− url = "";
21− synopsis = "Happy is a parser generator for Haskell";
22− description = "Happy is a parser generator for Haskell. Given a grammar\nspecification in BNF, Happy generates Haskell code to parse the\ngrammar. Happy works in a similar way to the @yacc@ tool for C.";
23− buildType = "Simple";
24− isLocal = true;
25− detailLevel = "FullDetails";
26− licenseFiles = [ "LICENSE" ];
27− dataDir = "data/";
28− dataFiles = [
29− "HappyTemplate"
30− "HappyTemplate-arrays"
31− "HappyTemplate-arrays-coerce"
32− "HappyTemplate-arrays-coerce-debug"
33− "HappyTemplate-arrays-debug"
34− "HappyTemplate-arrays-ghc"
35− "HappyTemplate-arrays-ghc-debug"
36− "HappyTemplate-coerce"
37− "HappyTemplate-ghc"
38− "GLR_Base"
39− "GLR_Lib"
40− "GLR_Lib-ghc"
41− "GLR_Lib-ghc-debug"
42− ];
43− extraSrcFiles = [
44− "ANNOUNCE"
45− "CHANGES"
46− "Makefile"
47− "README.md"
48− "TODO"
49− "doc/Makefile"
50− "doc/aclocal.m4"
51− "doc/config.mk.in"
52− "doc/configure.ac"
53− "doc/docbook-xml.mk"
54− "doc/fptools.css"
55− "doc/happy.1.in"
56− "doc/happy.xml"
57− "examples/glr/nlp/Main.lhs"
58− "examples/glr/nlp/Makefile"
59− "examples/glr/nlp/README"
60− "examples/glr/nlp/English.y"
61− "examples/glr/nlp/Hugs.lhs"
62− "examples/glr/Makefile"
63− "examples/glr/Makefile.defs"
64− "examples/glr/expr-eval/Main.lhs"
65− "examples/glr/expr-eval/Makefile"
66− "examples/glr/expr-eval/Expr.y"
67− "examples/glr/expr-eval/README"
68− "examples/glr/expr-eval/Hugs.lhs"
69− "examples/glr/expr-tree/Main.lhs"
70− "examples/glr/expr-tree/Makefile"
71− "examples/glr/expr-tree/Expr.y"
72− "examples/glr/expr-tree/README"
73− "examples/glr/expr-tree/Tree.lhs"
74− "examples/glr/expr-tree/Hugs.lhs"
75− "examples/glr/highly-ambiguous/Main.lhs"
76− "examples/glr/highly-ambiguous/Makefile"
77− "examples/glr/highly-ambiguous/Expr.y"
78− "examples/glr/highly-ambiguous/README"
79− "examples/glr/highly-ambiguous/Hugs.lhs"
80− "examples/glr/hidden-leftrec/Main.lhs"
81− "examples/glr/hidden-leftrec/Makefile"
82− "examples/glr/hidden-leftrec/Expr.y"
83− "examples/glr/hidden-leftrec/README"
84− "examples/glr/hidden-leftrec/Hugs.lhs"
85− "examples/glr/expr-monad/Main.lhs"
86− "examples/glr/expr-monad/Makefile"
87− "examples/glr/expr-monad/Expr.y"
88− "examples/glr/expr-monad/README"
89− "examples/glr/expr-monad/Hugs.lhs"
90− "examples/glr/bio-eg/Main.lhs"
91− "examples/glr/bio-eg/Makefile"
92− "examples/glr/bio-eg/Bio.y"
93− "examples/glr/bio-eg/README"
94− "examples/glr/bio-eg/1-1200.dna"
95− "examples/glr/bio-eg/1-600.dna"
96− "examples/glr/common/DV_lhs"
97− "examples/glr/common/DaVinciTypes.hs"
98− "examples/glr/packing/Main.lhs"
99− "examples/glr/packing/Makefile"
100− "examples/glr/packing/Expr.y"
101− "examples/glr/packing/README"
102− "examples/glr/packing/Hugs.lhs"
103− "examples/PgnParser.ly"
104− "examples/MonadTest.ly"
105− "examples/igloo/ParserM.hs"
106− "examples/igloo/Makefile"
107− "examples/igloo/Parser.y"
108− "examples/igloo/Foo.hs"
109− "examples/igloo/README"
110− "examples/igloo/Lexer.x"
111− "examples/README"
112− "examples/Calc.ly"
113− "examples/DavesExample.ly"
114− "examples/ErrorTest.ly"
115− "examples/ErlParser.ly"
116− "examples/SimonsExample.ly"
117− "examples/LexerTest.ly"
118− "happy.spec"
119− "src/ARRAY-NOTES"
120− "tests/AttrGrammar001.y"
121− "tests/AttrGrammar002.y"
122− "tests/Makefile"
123− "tests/Partial.ly"
124− "tests/Test.ly"
125− "tests/TestMulti.ly"
126− "tests/TestPrecedence.ly"
127− "tests/bogus-token.y"
128− "tests/bug001.ly"
129− "tests/bug002.y"
130− "tests/error001.stderr"
131− "tests/error001.stdout"
132− "tests/error001.y"
133− "tests/monad001.y"
134− "tests/monad002.ly"
135− "tests/monaderror.y"
136− "tests/precedence001.ly"
137− "tests/precedence002.y"
138− "tests/test_rules.y"
139− "tests/issue91.y"
140− "tests/issue93.y"
141− "tests/issue94.y"
142− "tests/issue95.y"
143− "tests/monaderror-explist.y"
144− "tests/typeclass_monad001.y"
145− "tests/typeclass_monad002.ly"
146− "tests/typeclass_monad_lexer.y"
147− "tests/rank2.y"
148− ];
149− extraTmpFiles = [];
150− extraDocFiles = [];
151− };
152− components = {
153− exes = {
154− "happy" = {
155− depends = [
156− (hsPkgs."base" or (errorHandler.buildDepError "base"))
157− (hsPkgs."array" or (errorHandler.buildDepError "array"))
158− (hsPkgs."containers" or (errorHandler.buildDepError "containers"))
159− (hsPkgs."mtl" or (errorHandler.buildDepError "mtl"))
160− ];
161− buildable = true;
162− modules = [
163− "Paths_happy"
164− "AbsSyn"
165− "First"
166− "GenUtils"
167− "Grammar"
168− "Info"
169− "LALR"
170− "Lexer"
171− "ParseMonad"
172− "Parser"
173− "ProduceCode"
174− "ProduceGLRCode"
175− "NameSet"
176− "Target"
177− "AttrGrammar"
178− "AttrGrammarParser"
179− "ParamRules"
180− "PrettyGrammar"
181− ];
182− hsSourceDirs = [ "src" ];
183− mainPath = [ "Main.lhs" ];
184− };
185− };
186− tests = {
187− "tests" = {
188− depends = [
189− (hsPkgs."base" or (errorHandler.buildDepError "base"))
190− (hsPkgs."process" or (errorHandler.buildDepError "process"))
191− ];
192− build-tools = [
193− (hsPkgs.buildPackages.happy or (pkgs.buildPackages.happy or (errorHandler.buildToolDepError "happy")))
194− ];
195− buildable = true;
196− mainPath = [ "test.hs" ];
197− };
198− };
199− };
200− } // rec { src = (pkgs.lib).mkDefault ../.; }
materialized/ghc883/alex/.plan.nix/alex.nixdeleted−160
@@ -1,160 +0,0 @@
1−{ system
2− , compiler
3− , flags
4− , pkgs
5− , hsPkgs
6− , pkgconfPkgs
7− , errorHandler
8− , config
9− , ... }:
10− {
11− flags = { small_base = true; };
12− package = {
13− specVersion = "1.8";
14− identifier = { name = "alex"; version = "3.2.5"; };
15− license = "BSD-3-Clause";
16− copyright = "(c) Chis Dornan, Simon Marlow";
17− maintainer = "Simon Marlow <marlowsd@gmail.com>";
18− author = "Chris Dornan and Simon Marlow";
19− homepage = "http://www.haskell.org/alex/";
20− url = "";
21− synopsis = "Alex is a tool for generating lexical analysers in Haskell";
22− description = "Alex is a tool for generating lexical analysers in Haskell.\nIt takes a description of tokens based on regular\nexpressions and generates a Haskell module containing code\nfor scanning text efficiently. It is similar to the tool\nlex or flex for C/C++.";
23− buildType = "Simple";
24− isLocal = true;
25− detailLevel = "FullDetails";
26− licenseFiles = [ "LICENSE" ];
27− dataDir = "data/";
28− dataFiles = [
29− "AlexTemplate"
30− "AlexTemplate-ghc"
31− "AlexTemplate-ghc-nopred"
32− "AlexTemplate-ghc-debug"
33− "AlexTemplate-debug"
34− "AlexWrapper-basic"
35− "AlexWrapper-basic-bytestring"
36− "AlexWrapper-strict-bytestring"
37− "AlexWrapper-posn"
38− "AlexWrapper-posn-bytestring"
39− "AlexWrapper-monad"
40− "AlexWrapper-monad-bytestring"
41− "AlexWrapper-monadUserState"
42− "AlexWrapper-monadUserState-bytestring"
43− "AlexWrapper-gscan"
44− ];
45− extraSrcFiles = [
46− "CHANGELOG.md"
47− "README.md"
48− "TODO"
49− "alex.spec"
50− "doc/Makefile"
51− "doc/aclocal.m4"
52− "doc/alex.1.in"
53− "doc/alex.xml"
54− "doc/config.mk.in"
55− "doc/configure.ac"
56− "doc/docbook-xml.mk"
57− "doc/fptools.css"
58− "examples/Makefile"
59− "examples/Tokens.x"
60− "examples/Tokens_gscan.x"
61− "examples/Tokens_posn.x"
62− "examples/examples.x"
63− "examples/haskell.x"
64− "examples/lit.x"
65− "examples/pp.x"
66− "examples/state.x"
67− "examples/tiny.y"
68− "examples/words.x"
69− "examples/words_monad.x"
70− "examples/words_posn.x"
71− "src/Parser.y.boot"
72− "src/Scan.x.boot"
73− "src/ghc_hooks.c"
74− "templates/GenericTemplate.hs"
75− "templates/wrappers.hs"
76− "tests/Makefile"
77− "tests/simple.x"
78− "tests/null.x"
79− "tests/tokens.x"
80− "tests/tokens_gscan.x"
81− "tests/tokens_posn.x"
82− "tests/tokens_bytestring.x"
83− "tests/tokens_posn_bytestring.x"
84− "tests/tokens_scan_user.x"
85− "tests/tokens_strict_bytestring.x"
86− "tests/tokens_monad_bytestring.x"
87− "tests/tokens_monadUserState_bytestring.x"
88− "tests/tokens_bytestring_unicode.x"
89− "tests/basic_typeclass.x"
90− "tests/basic_typeclass_bytestring.x"
91− "tests/default_typeclass.x"
92− "tests/gscan_typeclass.x"
93− "tests/posn_typeclass.x"
94− "tests/monad_typeclass.x"
95− "tests/monad_typeclass_bytestring.x"
96− "tests/monadUserState_typeclass.x"
97− "tests/monadUserState_typeclass_bytestring.x"
98− "tests/posn_typeclass_bytestring.x"
99− "tests/strict_typeclass.x"
100− "tests/unicode.x"
101− ];
102− extraTmpFiles = [];
103− extraDocFiles = [];
104− };
105− components = {
106− exes = {
107− "alex" = {
108− depends = [
109− (hsPkgs."base" or (errorHandler.buildDepError "base"))
110− ] ++ (if flags.small_base
111− then [
112− (hsPkgs."base" or (errorHandler.buildDepError "base"))
113− (hsPkgs."array" or (errorHandler.buildDepError "array"))
114− (hsPkgs."containers" or (errorHandler.buildDepError "containers"))
115− (hsPkgs."directory" or (errorHandler.buildDepError "directory"))
116− ]
117− else [ (hsPkgs."base" or (errorHandler.buildDepError "base")) ]);
118− buildable = true;
119− modules = [
120− "AbsSyn"
121− "CharSet"
122− "DFA"
123− "DFAMin"
124− "DFS"
125− "Info"
126− "Map"
127− "NFA"
128− "Output"
129− "Paths_alex"
130− "Parser"
131− "ParseMonad"
132− "Scan"
133− "Set"
134− "Sort"
135− "Util"
136− "UTF8"
137− "Data/Ranged"
138− "Data/Ranged/Boundaries"
139− "Data/Ranged/RangedSet"
140− "Data/Ranged/Ranges"
141− ];
142− hsSourceDirs = [ "src" ];
143− mainPath = [ "Main.hs" ] ++ [ "" ];
144− };
145− };
146− tests = {
147− "tests" = {
148− depends = [
149− (hsPkgs."base" or (errorHandler.buildDepError "base"))
150− (hsPkgs."process" or (errorHandler.buildDepError "process"))
151− ];
152− build-tools = [
153− (hsPkgs.buildPackages.alex or (pkgs.buildPackages.alex or (errorHandler.buildToolDepError "alex")))
154− ];
155− buildable = true;
156− mainPath = [ "test.hs" ];
157− };
158− };
159− };
160− } // rec { src = (pkgs.lib).mkDefault ../.; }
materialized/ghc883/alex/default.nixdeleted−49
@@ -1,49 +0,0 @@
1−{
2− pkgs = hackage:
3− {
4− packages = {
5− "ghc-prim".revision = (((hackage."ghc-prim")."0.5.3").revisions).default;
6− "unix".revision = (((hackage."unix")."2.7.2.2").revisions).default;
7− "rts".revision = (((hackage."rts")."1.0").revisions).default;
8− "deepseq".revision = (((hackage."deepseq")."1.4.4.0").revisions).default;
9− "directory".revision = (((hackage."directory")."1.3.6.0").revisions).default;
10− "containers".revision = (((hackage."containers")."0.6.2.1").revisions).default;
11− "bytestring".revision = (((hackage."bytestring")."0.10.10.0").revisions).default;
12− "base".revision = (((hackage."base")."4.13.0.0").revisions).default;
13− "time".revision = (((hackage."time")."1.9.3").revisions).default;
14− "filepath".revision = (((hackage."filepath")."1.4.2.1").revisions).default;
15− "process".revision = (((hackage."process")."1.6.8.0").revisions).default;
16− "array".revision = (((hackage."array")."0.5.4.0").revisions).default;
17− "integer-gmp".revision = (((hackage."integer-gmp")."1.0.2.0").revisions).default;
18− };
19− compiler = {
20− version = "8.8.3";
21− nix-name = "ghc883";
22− packages = {
23− "ghc-prim" = "0.5.3";
24− "unix" = "2.7.2.2";
25− "rts" = "1.0";
26− "deepseq" = "1.4.4.0";
27− "directory" = "1.3.6.0";
28− "containers" = "0.6.2.1";
29− "bytestring" = "0.10.10.0";
30− "base" = "4.13.0.0";
31− "time" = "1.9.3";
32− "filepath" = "1.4.2.1";
33− "process" = "1.6.8.0";
34− "array" = "0.5.4.0";
35− "integer-gmp" = "1.0.2.0";
36− };
37− };
38− };
39− extras = hackage:
40− { packages = { alex = ./.plan.nix/alex.nix; }; };
41− modules = [
42− ({ lib, ... }:
43− {
44− packages = {
45− "alex" = { flags = { "small_base" = lib.mkOverride 900 true; }; };
46− };
47− })
48− ];
49− }
materialized/ghc883/happy/.plan.nix/happy.nixdeleted−200
@@ -1,200 +0,0 @@
1−{ system
2− , compiler
3− , flags
4− , pkgs
5− , hsPkgs
6− , pkgconfPkgs
7− , errorHandler
8− , config
9− , ... }:
10− {
11− flags = { small_base = true; };
12− package = {
13− specVersion = "1.8";
14− identifier = { name = "happy"; version = "1.19.12"; };
15− license = "BSD-2-Clause";
16− copyright = "(c) Andy Gill, Simon Marlow";
17− maintainer = "Simon Marlow <marlowsd@gmail.com>";
18− author = "Andy Gill and Simon Marlow";
19− homepage = "https://www.haskell.org/happy/";
20− url = "";
21− synopsis = "Happy is a parser generator for Haskell";
22− description = "Happy is a parser generator for Haskell. Given a grammar\nspecification in BNF, Happy generates Haskell code to parse the\ngrammar. Happy works in a similar way to the @yacc@ tool for C.";
23− buildType = "Simple";
24− isLocal = true;
25− detailLevel = "FullDetails";
26− licenseFiles = [ "LICENSE" ];
27− dataDir = "data/";
28− dataFiles = [
29− "HappyTemplate"
30− "HappyTemplate-arrays"
31− "HappyTemplate-arrays-coerce"
32− "HappyTemplate-arrays-coerce-debug"
33− "HappyTemplate-arrays-debug"
34− "HappyTemplate-arrays-ghc"
35− "HappyTemplate-arrays-ghc-debug"
36− "HappyTemplate-coerce"
37− "HappyTemplate-ghc"
38− "GLR_Base"
39− "GLR_Lib"
40− "GLR_Lib-ghc"
41− "GLR_Lib-ghc-debug"
42− ];
43− extraSrcFiles = [
44− "ANNOUNCE"
45− "CHANGES"
46− "Makefile"
47− "README.md"
48− "TODO"
49− "doc/Makefile"
50− "doc/aclocal.m4"
51− "doc/config.mk.in"
52− "doc/configure.ac"
53− "doc/docbook-xml.mk"
54− "doc/fptools.css"
55− "doc/happy.1.in"
56− "doc/happy.xml"
57− "examples/glr/nlp/Main.lhs"
58− "examples/glr/nlp/Makefile"
59− "examples/glr/nlp/README"
60− "examples/glr/nlp/English.y"
61− "examples/glr/nlp/Hugs.lhs"
62− "examples/glr/Makefile"
63− "examples/glr/Makefile.defs"
64− "examples/glr/expr-eval/Main.lhs"
65− "examples/glr/expr-eval/Makefile"
66− "examples/glr/expr-eval/Expr.y"
67− "examples/glr/expr-eval/README"
68− "examples/glr/expr-eval/Hugs.lhs"
69− "examples/glr/expr-tree/Main.lhs"
70− "examples/glr/expr-tree/Makefile"
71− "examples/glr/expr-tree/Expr.y"
72− "examples/glr/expr-tree/README"
73− "examples/glr/expr-tree/Tree.lhs"
74− "examples/glr/expr-tree/Hugs.lhs"
75− "examples/glr/highly-ambiguous/Main.lhs"
76− "examples/glr/highly-ambiguous/Makefile"
77− "examples/glr/highly-ambiguous/Expr.y"
78− "examples/glr/highly-ambiguous/README"
79− "examples/glr/highly-ambiguous/Hugs.lhs"
80− "examples/glr/hidden-leftrec/Main.lhs"
81− "examples/glr/hidden-leftrec/Makefile"
82− "examples/glr/hidden-leftrec/Expr.y"
83− "examples/glr/hidden-leftrec/README"
84− "examples/glr/hidden-leftrec/Hugs.lhs"
85− "examples/glr/expr-monad/Main.lhs"
86− "examples/glr/expr-monad/Makefile"
87− "examples/glr/expr-monad/Expr.y"
88− "examples/glr/expr-monad/README"
89− "examples/glr/expr-monad/Hugs.lhs"
90− "examples/glr/bio-eg/Main.lhs"
91− "examples/glr/bio-eg/Makefile"
92− "examples/glr/bio-eg/Bio.y"
93− "examples/glr/bio-eg/README"
94− "examples/glr/bio-eg/1-1200.dna"
95− "examples/glr/bio-eg/1-600.dna"
96− "examples/glr/common/DV_lhs"
97− "examples/glr/common/DaVinciTypes.hs"
98− "examples/glr/packing/Main.lhs"
99− "examples/glr/packing/Makefile"
100− "examples/glr/packing/Expr.y"
101− "examples/glr/packing/README"
102− "examples/glr/packing/Hugs.lhs"
103− "examples/PgnParser.ly"
104− "examples/MonadTest.ly"
105− "examples/igloo/ParserM.hs"
106− "examples/igloo/Makefile"
107− "examples/igloo/Parser.y"
108− "examples/igloo/Foo.hs"
109− "examples/igloo/README"
110− "examples/igloo/Lexer.x"
111− "examples/README"
112− "examples/Calc.ly"
113− "examples/DavesExample.ly"
114− "examples/ErrorTest.ly"
115− "examples/ErlParser.ly"
116− "examples/SimonsExample.ly"
117− "examples/LexerTest.ly"
118− "happy.spec"
119− "src/ARRAY-NOTES"
120− "tests/AttrGrammar001.y"
121− "tests/AttrGrammar002.y"
122− "tests/Makefile"
123− "tests/Partial.ly"
124− "tests/Test.ly"
125− "tests/TestMulti.ly"
126− "tests/TestPrecedence.ly"
127− "tests/bogus-token.y"
128− "tests/bug001.ly"
129− "tests/bug002.y"
130− "tests/error001.stderr"
131− "tests/error001.stdout"
132− "tests/error001.y"
133− "tests/monad001.y"
134− "tests/monad002.ly"
135− "tests/monaderror.y"
136− "tests/precedence001.ly"
137− "tests/precedence002.y"
138− "tests/test_rules.y"
139− "tests/issue91.y"
140− "tests/issue93.y"
141− "tests/issue94.y"
142− "tests/issue95.y"
143− "tests/monaderror-explist.y"
144− "tests/typeclass_monad001.y"
145− "tests/typeclass_monad002.ly"
146− "tests/typeclass_monad_lexer.y"
147− "tests/rank2.y"
148− ];
149− extraTmpFiles = [];
150− extraDocFiles = [];
151− };
152− components = {
153− exes = {
154− "happy" = {
155− depends = [
156− (hsPkgs."base" or (errorHandler.buildDepError "base"))
157− (hsPkgs."array" or (errorHandler.buildDepError "array"))
158− (hsPkgs."containers" or (errorHandler.buildDepError "containers"))
159− (hsPkgs."mtl" or (errorHandler.buildDepError "mtl"))
160− ];
161− buildable = true;
162− modules = [
163− "Paths_happy"
164− "AbsSyn"
165− "First"
166− "GenUtils"
167− "Grammar"
168− "Info"
169− "LALR"
170− "Lexer"
171− "ParseMonad"
172− "Parser"
173− "ProduceCode"
174− "ProduceGLRCode"
175− "NameSet"
176− "Target"
177− "AttrGrammar"
178− "AttrGrammarParser"
179− "ParamRules"
180− "PrettyGrammar"
181− ];
182− hsSourceDirs = [ "src" ];
183− mainPath = [ "Main.lhs" ];
184− };
185− };
186− tests = {
187− "tests" = {
188− depends = [
189− (hsPkgs."base" or (errorHandler.buildDepError "base"))
190− (hsPkgs."process" or (errorHandler.buildDepError "process"))
191− ];
192− build-tools = [
193− (hsPkgs.buildPackages.happy or (pkgs.buildPackages.happy or (errorHandler.buildToolDepError "happy")))
194− ];
195− buildable = true;
196− mainPath = [ "test.hs" ];
197− };
198− };
199− };
200− } // rec { src = (pkgs.lib).mkDefault ../.; }
materialized/ghc883/happy/default.nixdeleted−53
@@ -1,53 +0,0 @@
1−{
2− pkgs = hackage:
3− {
4− packages = {
5− "ghc-prim".revision = (((hackage."ghc-prim")."0.5.3").revisions).default;
6− "unix".revision = (((hackage."unix")."2.7.2.2").revisions).default;
7− "mtl".revision = (((hackage."mtl")."2.2.2").revisions).default;
8− "rts".revision = (((hackage."rts")."1.0").revisions).default;
9− "deepseq".revision = (((hackage."deepseq")."1.4.4.0").revisions).default;
10− "directory".revision = (((hackage."directory")."1.3.6.0").revisions).default;
11− "containers".revision = (((hackage."containers")."0.6.2.1").revisions).default;
12− "bytestring".revision = (((hackage."bytestring")."0.10.10.0").revisions).default;
13− "base".revision = (((hackage."base")."4.13.0.0").revisions).default;
14− "time".revision = (((hackage."time")."1.9.3").revisions).default;
15− "transformers".revision = (((hackage."transformers")."0.5.6.2").revisions).default;
16− "filepath".revision = (((hackage."filepath")."1.4.2.1").revisions).default;
17− "process".revision = (((hackage."process")."1.6.8.0").revisions).default;
18− "array".revision = (((hackage."array")."0.5.4.0").revisions).default;
19− "integer-gmp".revision = (((hackage."integer-gmp")."1.0.2.0").revisions).default;
20− };
21− compiler = {
22− version = "8.8.3";
23− nix-name = "ghc883";
24− packages = {
25− "ghc-prim" = "0.5.3";
26− "unix" = "2.7.2.2";
27− "mtl" = "2.2.2";
28− "rts" = "1.0";
29− "deepseq" = "1.4.4.0";
30− "directory" = "1.3.6.0";
31− "containers" = "0.6.2.1";
32− "bytestring" = "0.10.10.0";
33− "base" = "4.13.0.0";
34− "time" = "1.9.3";
35− "transformers" = "0.5.6.2";
36− "filepath" = "1.4.2.1";
37− "process" = "1.6.8.0";
38− "array" = "0.5.4.0";
39− "integer-gmp" = "1.0.2.0";
40− };
41− };
42− };
43− extras = hackage:
44− { packages = { happy = ./.plan.nix/happy.nix; }; };
45− modules = [
46− ({ lib, ... }:
47− {
48− packages = {
49− "happy" = { flags = { "small_base" = lib.mkOverride 900 true; }; };
50− };
51− })
52− ];
53− }
modules/component-driver.nix+1−1
@@ -3,7 +3,7 @@ let
3 builder = haskellLib.weakCallPackage pkgs ../builder {
3 builder = haskellLib.weakCallPackage pkgs ../builder {
4 inherit haskellLib;
4 inherit haskellLib;
5 ghc = config.ghc.package;
5 ghc = config.ghc.package;
6− inherit (config) nonReinstallablePkgs hsPkgs;
6+ inherit (config) nonReinstallablePkgs hsPkgs compiler;
7 };
7 };
8
8
9in
9in
nix-tools/regenerate.nix+2−1
@@ -25,7 +25,7 @@ let
25 inherit (import ../default.nix {}) sources nixpkgsArgs;
25 inherit (import ../default.nix {}) sources nixpkgsArgs;
26in
26in
27{ specJSON ? ./nix-tools-src.json }:
27{ specJSON ? ./nix-tools-src.json }:
28−with import sources.nixpkgs-default nixpkgsArgs;
28+with import sources.nixpkgs nixpkgsArgs;
29let
29let
30 src = haskell-nix.cleanSourceHaskell {
30 src = haskell-nix.cleanSourceHaskell {
31 src = haskell-nix.fetchExternal {
31 src = haskell-nix.fetchExternal {
@@ -36,6 +36,7 @@ let
36 };
36 };
37in
37in
38 let plan-to-nix = (haskell-nix.cabalProject {
38 let plan-to-nix = (haskell-nix.cabalProject {
39+ compiler-nix-name = "ghc865";
39 name = "nix-tools";
40 name = "nix-tools";
40 inherit src;
41 inherit src;
41 modules = [{
42 modules = [{
nix/sources.json+19−1
@@ -1,6 +1,20 @@
1{
1{
2+ "cabal-32": {
3+ "branch": "3.2",
4+ "builtin": false,
5+ "description": "Official upstream development repository for Cabal and cabal-install",
6+ "homepage": "https://haskell.org/cabal",
7+ "owner": "haskell",
8+ "repo": "cabal",
9+ "rev": "94aaa8e4720081f9c75497e2735b90f6a819b08e",
10+ "sha256": "09m59w794zk4mxk1m3qkkmf5ydi0zhh89a7jk1wglrgxxadfndmh",
11+ "type": "tarball",
12+ "url": "https://github.com/haskell/cabal/archive/94aaa8e4720081f9c75497e2735b90f6a819b08e.tar.gz",
13+ "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
14+ },
2 "niv": {
15 "niv": {
3 "branch": "master",
16 "branch": "master",
17+ "builtin": false,
4 "description": "Easy dependency management for Nix projects",
18 "description": "Easy dependency management for Nix projects",
5 "homepage": "https://github.com/nmattia/niv",
19 "homepage": "https://github.com/nmattia/niv",
6 "owner": "nmattia",
20 "owner": "nmattia",
@@ -13,6 +27,7 @@
13 },
27 },
14 "nix-tools": {
28 "nix-tools": {
15 "branch": "master",
29 "branch": "master",
30+ "builtin": false,
16 "description": "Translate Cabals Generic Package Description to a Nix expression",
31 "description": "Translate Cabals Generic Package Description to a Nix expression",
17 "homepage": null,
32 "homepage": null,
18 "owner": "input-output-hk",
33 "owner": "input-output-hk",
@@ -25,6 +40,7 @@
25 },
40 },
26 "nixpkgs-1909": {
41 "nixpkgs-1909": {
27 "branch": "nixpkgs-19.09-darwin",
42 "branch": "nixpkgs-19.09-darwin",
43+ "builtin": false,
28 "description": "Nix Packages collection",
44 "description": "Nix Packages collection",
29 "homepage": null,
45 "homepage": null,
30 "owner": "NixOS",
46 "owner": "NixOS",
@@ -37,6 +53,7 @@
37 },
53 },
38 "nixpkgs-2003": {
54 "nixpkgs-2003": {
39 "branch": "nixpkgs-20.03-darwin",
55 "branch": "nixpkgs-20.03-darwin",
56+ "builtin": false,
40 "description": "Nix Packages collection",
57 "description": "Nix Packages collection",
41 "homepage": null,
58 "homepage": null,
42 "owner": "NixOS",
59 "owner": "NixOS",
@@ -47,8 +64,9 @@
47 "url": "https://github.com/NixOS/nixpkgs/archive/db31e48c5c8d99dcaf4e5883a96181f6ac4ad6f6.tar.gz",
64 "url": "https://github.com/NixOS/nixpkgs/archive/db31e48c5c8d99dcaf4e5883a96181f6ac4ad6f6.tar.gz",
48 "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
65 "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
49 },
66 },
50− "nixpkgs-default": {
67+ "nixpkgs": {
51 "branch": "nixpkgs-20.03-darwin",
68 "branch": "nixpkgs-20.03-darwin",
69+ "builtin": false,
52 "description": "Nix Packages collection",
70 "description": "Nix Packages collection",
53 "homepage": null,
71 "homepage": null,
54 "owner": "NixOS",
72 "owner": "NixOS",
nixpkgs/default.nixdeleted−4
@@ -1,4 +0,0 @@
1−# This file is for backwards compatibility only
2−{
3− inherit (import ../nix/sources.nix) nixpkgs-2003 nixpkgs-1909 nixpkgs-default;
4−}
overlays/bootstrap.nix+104−84
@@ -28,18 +28,14 @@ let
28 fi
28 fi
29 done
29 done
30 '';
30 '';
31− # For each architecture, we need to know two (somewhat ad-hoc) things:
32− # - What GHC version we should use for bootstrapping.
31+ # For each architecture, what GHC version we should use for bootstrapping.
33− # - What Happy version we should use for bootstrapping.
34 buildBootstrapper =
32 buildBootstrapper =
35 if final.targetPlatform.isAarch64 && final.buildPlatform.isAarch64
33 if final.targetPlatform.isAarch64 && final.buildPlatform.isAarch64
36 then {
34 then {
37 compilerNixName = "ghc882";
35 compilerNixName = "ghc882";
38− happyVersion = "1.19.12";
39 }
36 }
40 else {
37 else {
41 compilerNixName = "ghc844";
38 compilerNixName = "ghc844";
42− happyVersion = "1.19.11";
43 };
39 };
44in {
40in {
45 haskell-nix = prev.haskell-nix // {
41 haskell-nix = prev.haskell-nix // {
@@ -47,15 +43,9 @@ in {
47 compiler =
43 compiler =
48 let bootPkgs = with final.buildPackages; {
44 let bootPkgs = with final.buildPackages; {
49 ghc = final.buildPackages.buildPackages.haskell-nix.bootstrap.compiler."${buildBootstrapper.compilerNixName}";
45 ghc = final.buildPackages.buildPackages.haskell-nix.bootstrap.compiler."${buildBootstrapper.compilerNixName}";
50− alex = final.haskell-nix.bootstrap.packages.alex-tool {
46+ alex = final.haskell-nix.bootstrap.packages.alex-unchecked;
51− checkMaterialization = false;
52− };
53− happy = final.haskell-nix.bootstrap.packages.happy-tool {
47+ happy = final.haskell-nix.bootstrap.packages.happy-unchecked;
54− checkMaterialization = false;
55− };
56− hscolour = final.haskell-nix.bootstrap.packages.hscolour-tool {
48+ hscolour = final.haskell-nix.bootstrap.packages.hscolour-unchecked;
57− checkMaterialization = false;
58− };
59 };
49 };
60 sphinx = with final.buildPackages; (python3Packages.sphinx_1_7_9 or python3Packages.sphinx);
50 sphinx = with final.buildPackages; (python3Packages.sphinx_1_7_9 or python3Packages.sphinx);
61 hsc2hs-align-conditionals-patch = final.fetchpatch {
51 hsc2hs-align-conditionals-patch = final.fetchpatch {
@@ -147,7 +137,11 @@ in {
147 ghc844 = final.callPackage ../compiler/ghc {
137 ghc844 = final.callPackage ../compiler/ghc {
148 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc844; };
138 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc844; };
149
139
150− inherit bootPkgs sphinx installDeps;
140+ inherit sphinx installDeps;
141+ bootPkgs = bootPkgs // {
142+ # GHC 8.6.5 and earlier need happy 1.19.11
143+ happy = final.haskell-nix.bootstrap.packages.happy-old-unchecked;
144+ };
151
145
152 buildLlvmPackages = final.buildPackages.llvmPackages_5;
146 buildLlvmPackages = final.buildPackages.llvmPackages_5;
153 llvmPackages = final.llvmPackages_5;
147 llvmPackages = final.llvmPackages_5;
@@ -165,7 +159,11 @@ in {
165 ghc861 = final.callPackage ../compiler/ghc {
159 ghc861 = final.callPackage ../compiler/ghc {
166 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc861; };
160 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc861; };
167
161
168− inherit bootPkgs sphinx installDeps;
162+ inherit sphinx installDeps;
163+ bootPkgs = bootPkgs // {
164+ # GHC 8.6.5 and earlier need happy 1.19.11
165+ happy = final.haskell-nix.bootstrap.packages.happy-old-unchecked;
166+ };
169
167
170 buildLlvmPackages = final.buildPackages.llvmPackages_6;
168 buildLlvmPackages = final.buildPackages.llvmPackages_6;
171 llvmPackages = final.llvmPackages_6;
169 llvmPackages = final.llvmPackages_6;
@@ -181,7 +179,11 @@ in {
181 ghc862 = final.callPackage ../compiler/ghc {
179 ghc862 = final.callPackage ../compiler/ghc {
182 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc862; };
180 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc862; };
183
181
184− inherit bootPkgs sphinx installDeps;
182+ inherit sphinx installDeps;
183+ bootPkgs = bootPkgs // {
184+ # GHC 8.6.5 and earlier need happy 1.19.11
185+ happy = final.haskell-nix.bootstrap.packages.happy-old-unchecked;
186+ };
185
187
186 buildLlvmPackages = final.buildPackages.llvmPackages_6;
188 buildLlvmPackages = final.buildPackages.llvmPackages_6;
187 llvmPackages = final.llvmPackages_6;
189 llvmPackages = final.llvmPackages_6;
@@ -198,7 +200,11 @@ in {
198 ghc863 = final.callPackage ../compiler/ghc {
200 ghc863 = final.callPackage ../compiler/ghc {
199 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc863; };
201 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc863; };
200
202
201− inherit bootPkgs sphinx installDeps;
203+ inherit sphinx installDeps;
204+ bootPkgs = bootPkgs // {
205+ # GHC 8.6.5 and earlier need happy 1.19.11
206+ happy = final.haskell-nix.bootstrap.packages.happy-old-unchecked;
207+ };
202
208
203 buildLlvmPackages = final.buildPackages.llvmPackages_6;
209 buildLlvmPackages = final.buildPackages.llvmPackages_6;
204 llvmPackages = final.llvmPackages_6;
210 llvmPackages = final.llvmPackages_6;
@@ -215,7 +221,11 @@ in {
215 ghc864 = final.callPackage ../compiler/ghc {
221 ghc864 = final.callPackage ../compiler/ghc {
216 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc864; };
222 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc864; };
217
223
218− inherit bootPkgs sphinx installDeps;
224+ inherit sphinx installDeps;
225+ bootPkgs = bootPkgs // {
226+ # GHC 8.6.5 and earlier need happy 1.19.11
227+ happy = final.haskell-nix.bootstrap.packages.happy-old-unchecked;
228+ };
219
229
220 buildLlvmPackages = final.buildPackages.llvmPackages_6;
230 buildLlvmPackages = final.buildPackages.llvmPackages_6;
221 llvmPackages = final.llvmPackages_6;
231 llvmPackages = final.llvmPackages_6;
@@ -232,7 +242,11 @@ in {
232 ghc865 = final.callPackage ../compiler/ghc {
242 ghc865 = final.callPackage ../compiler/ghc {
233 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc865; };
243 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc865; };
234
244
235− inherit bootPkgs sphinx installDeps;
245+ inherit sphinx installDeps;
246+ bootPkgs = bootPkgs // {
247+ # GHC 8.6.5 and earlier need happy 1.19.11
248+ happy = final.haskell-nix.bootstrap.packages.happy-old-unchecked;
249+ };
236
250
237 buildLlvmPackages = final.buildPackages.llvmPackages_6;
251 buildLlvmPackages = final.buildPackages.llvmPackages_6;
238 llvmPackages = final.llvmPackages_6;
252 llvmPackages = final.llvmPackages_6;
@@ -302,8 +316,6 @@ in {
302
316
303 bootPkgs = bootPkgs // {
317 bootPkgs = bootPkgs // {
304 ghc = buildPkgs.haskell-nix.compiler.ghc883;
318 ghc = buildPkgs.haskell-nix.compiler.ghc883;
305− alex = buildPkgs.haskell-nix.haskellPackages.alex.components.exes.alex;
306− happy = buildPkgs.haskell-nix.haskellPackages.happy.components.exes.happy;
307 };
319 };
308 inherit sphinx installDeps;
320 inherit sphinx installDeps;
309
321
@@ -365,41 +377,27 @@ in {
365 '' + installDeps targetPrefix);
377 '' + installDeps targetPrefix);
366 })));
378 })));
367
379
368− # Need to use something from 8.8.x as the default to build aarch64 native compiler:
369− defaultCompilerNixName =
370− if final.targetPlatform.isAarch64 && final.buildPlatform.isAarch64
371− then "ghc883"
372− else "ghc865";
373− ghc = final.haskell-nix.compiler."${final.haskell-nix.defaultCompilerNixName}";
374 # Both `cabal-install` and `nix-tools` are needed for `cabalProject`
380 # Both `cabal-install` and `nix-tools` are needed for `cabalProject`
375 # to check materialized results. We need to take care that when
381 # to check materialized results. We need to take care that when
376 # it is doing this we do not check the materialization of the
382 # it is doing this we do not check the materialization of the
377 # tools used or there will be infinite recursion.
383 # tools used or there will be infinite recursion.
378 # always has `checkMaterialization = false` to avoid infinite
384 # always has `checkMaterialization = false` to avoid infinite
379 # recursion.
385 # recursion.
380− cabal-install-tool = args:
386+ cabal-install-tool = {compiler-nix-name, ...}@args:
381− # Hackage version of cabal-install does not compiler with ghc 8.10.1 yet.
382− let compiler-nix-name = args.compiler-nix-name or
383− (if final.haskell-nix.defaultCompilerNixName == "ghc8101"
387+ (final.haskell-nix.hackage-package ({
384− then "ghc883"
388+ name = "cabal-install";
385− else final.haskell-nix.defaultCompilerNixName);
386− in final.haskell-nix.tool "cabal" ({
387 version = "3.2.0.0";
389 version = "3.2.0.0";
388 index-state = final.haskell-nix.internalHackageIndexState;
390 index-state = final.haskell-nix.internalHackageIndexState;
389− inherit compiler-nix-name;
390 # When building cabal-install (only happens when checking materialization)
391 # When building cabal-install (only happens when checking materialization)
391 # disable checking of the tools used to avoid infinite recursion.
392 # disable checking of the tools used to avoid infinite recursion.
392− cabal-install = final.evalPackages.haskell-nix.cabal-install-tool
393+ cabal-install = final.evalPackages.haskell-nix.cabal-install-unchecked.${compiler-nix-name};
393− (args // { checkMaterialization = false; });
394− nix-tools = final.evalPackages.haskell-nix.nix-tools-set
394+ nix-tools = final.evalPackages.haskell-nix.nix-tools-unchecked.${compiler-nix-name};
395− (args // { checkMaterialization = false; });
396 materialized = ../materialized + "/${compiler-nix-name}/cabal-install";
395 materialized = ../materialized + "/${compiler-nix-name}/cabal-install";
397− } // args);
396+ } // args)).components.exes.cabal;
398− cabal-install = final.buildPackages.haskell-nix.cabal-install-tool {};
399− nix-tools-set = args:
397+ nix-tools-set = { compiler-nix-name, ... }@args:
400 let
398 let
401− exes =
399+ project =
402− (final.haskell-nix.cabalProject ({
400+ final.haskell-nix.cabalProject ({
403 name = "nix-tools";
401 name = "nix-tools";
404 src = final.haskell-nix.sources.nix-tools;
402 src = final.haskell-nix.sources.nix-tools;
405 index-state = final.haskell-nix.internalHackageIndexState;
403 index-state = final.haskell-nix.internalHackageIndexState;
@@ -409,13 +407,9 @@ in {
409 '';
407 '';
410 # When building cabal-install (only happens when checking materialization)
408 # When building cabal-install (only happens when checking materialization)
411 # disable checking of the tools used to avoid infinite recursion.
409 # disable checking of the tools used to avoid infinite recursion.
412− cabal-install = final.evalPackages.haskell-nix.cabal-install-tool
410+ cabal-install = final.evalPackages.haskell-nix.cabal-install-unchecked.${compiler-nix-name};
413− (args // { checkMaterialization = false; });
414− nix-tools = final.evalPackages.haskell-nix.nix-tools-set
411+ nix-tools = final.evalPackages.haskell-nix.nix-tools-unchecked.${compiler-nix-name};
415− (args // { checkMaterialization = false; });
416− materialized = ../materialized + "/${
412+ materialized = ../materialized + "/${compiler-nix-name}/nix-tools";
417− args.compiler-nix-name or final.haskell-nix.defaultCompilerNixName
418− }/nix-tools";
419 modules = [{
413 modules = [{
420 packages.transformers-compat.components.library.doExactConfig = true;
414 packages.transformers-compat.components.library.doExactConfig = true;
421 packages.time-compat.components.library.doExactConfig = true;
415 packages.time-compat.components.library.doExactConfig = true;
@@ -432,7 +426,8 @@ in {
432 "unix" "xhtml"
426 "unix" "xhtml"
433 ];
427 ];
434 }];
428 }];
429+ } // args);
435− } // args)).nix-tools.components.exes;
430+ exes = project.nix-tools.components.exes // project.hpack.components.exes;
436 tools = [
431 tools = [
437 final.buildPackages.nix
432 final.buildPackages.nix
438 # Double buildPackages is intentional, see comment in lib/default.nix for details.
433 # Double buildPackages is intentional, see comment in lib/default.nix for details.
@@ -452,23 +447,39 @@ in {
452 done
447 done
453 '';
448 '';
454 };
449 };
455− nix-tools = final.buildPackages.haskell-nix.nix-tools-set {};
450+
456− alex-tool = args: final.haskell-nix.tool "alex" ({
451+ # Memoize the cabal-install and nix-tools derivations by adding:
457− version = "3.2.5";
452+ # haskell-nix.cabal-install.ghcXXX
458− index-state = final.haskell-nix.internalHackageIndexState;
453+ # haskell-nix.cabal-install-unchecked.ghcXXX
459− materialized = ../materialized + "/${
454+ # haskell-nix.nix-tools.ghcXXX
460− args.compiler-nix-name or final.haskell-nix.defaultCompilerNixName
455+ # haskell-nix.nix-tools-unchecked.ghcXXX
461− }/alex";
456+ # Using these avoids unecessary calls to mkDerivation.
462− } // args);
457+ # For cabal projects we match the versions used to the compiler
463− alex = final.buildPackages.haskell-nix.alex-tool {};
458+ # selected for the project to avoid the chance of a dependency
464− happy-tool = args: final.haskell-nix.tool "happy" ({
459+ # another GHC version (particularly useful on macOS where
465− version = "1.19.12";
460+ # executables are dynamically linked to GHC itself, which means
466− index-state = final.haskell-nix.internalHackageIndexState;
461+ # that if you use a tool built with a different GHC you will get
467− materialized = ../materialized + "/${
462+ # that GHC itself in your closure).
468− args.compiler-nix-name or final.haskell-nix.defaultCompilerNixName
463+ cabal-install = final.lib.mapAttrs (compiler-nix-name: _:
469− }/happy";
464+ final.haskell-nix.cabal-install-tool { inherit compiler-nix-name; }) final.haskell-nix.compiler;
470− } // args);
465+ cabal-install-unchecked = final.lib.mapAttrs (compiler-nix-name: _:
471− happy = final.buildPackages.haskell-nix.happy-tool {};
466+ final.haskell-nix.cabal-install-tool { inherit compiler-nix-name; checkMaterialization = false; }) final.haskell-nix.compiler;
467+ nix-tools = final.lib.mapAttrs (compiler-nix-name: _:
468+ final.haskell-nix.nix-tools-set { inherit compiler-nix-name; }) final.haskell-nix.compiler;
469+ nix-tools-unchecked = final.lib.mapAttrs (compiler-nix-name: _:
470+ final.haskell-nix.nix-tools-set { inherit compiler-nix-name; checkMaterialization = false; }) final.haskell-nix.compiler;
471+
472+ # These `internal` versions are used for:
473+ # * `nix-tools` for stack projects (since we use `nix-tools` to process
474+ # the `stack.yaml` file we cannot match the ghc of the project the
475+ # way we do for cabal projects).
476+ # * Scripts are used to update stackage and hackage
477+ # Updating the version of GHC selected here should be fairly safe as
478+ # there should be no difference in the behaviour of these tools.
479+ # (stack projects on macOS may see a significant change in the
480+ # closure size of their build dependencies due to dynamic linking).
481+ internal-cabal-install = final.haskell-nix.cabal-install.ghc883;
482+ internal-nix-tools = final.haskell-nix.nix-tools.ghc883;
472
483
473 # WARN: The `import ../. {}` will prevent
484 # WARN: The `import ../. {}` will prevent
474 # any cross to work, as we will loose
485 # any cross to work, as we will loose
@@ -497,7 +508,16 @@ in {
497
508
498 # the bootstrap infra structure (pre-compiled ghc; bootstrapped cabal-install, ...)
509 # the bootstrap infra structure (pre-compiled ghc; bootstrapped cabal-install, ...)
499 bootstrap = with final.haskell-nix;
510 bootstrap = with final.haskell-nix;
511+ let
512+ # This compiler-nix-name will only be used to build nix-tools and cabal-install
513+ # when checking materialization of alex, happy and hscolour.
514+ compiler-nix-name = "ghc865";
515+ nix-tools = final.evalPackages.haskell-nix.nix-tools.${compiler-nix-name};
516+ cabal-install = final.evalPackages.haskell-nix.cabal-install.${compiler-nix-name};
517+ # The ghc boot compiler to use to compile alex, happy and hscolour
500− let ghc = final.buildPackages.haskell-nix.bootstrap.compiler."${buildBootstrapper.compilerNixName}";
518+ ghc = final.buildPackages.haskell-nix.bootstrap.compiler."${buildBootstrapper.compilerNixName}";
519+ ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
520+ index-state = final.haskell-nix.internalHackageIndexState;
501 in {
521 in {
502 # XXX: import ../. will throw away all other overlays, config values, ...
522 # XXX: import ../. will throw away all other overlays, config values, ...
503 # this is not ideal!
523 # this is not ideal!
@@ -525,31 +545,31 @@ in {
525 # building ghc itself (since GHC is a dependency
545 # building ghc itself (since GHC is a dependency
526 # of the materialization check it would cause
546 # of the materialization check it would cause
527 # infinite recusion).
547 # infinite recusion).
528− alex-tool = args: tool "alex" ({
548+ alex-tool = args: tool buildBootstrapper.compilerNixName "alex" ({
529 version = "3.2.4";
549 version = "3.2.4";
530− # Only a boot compiler is suitable here
550+ inherit ghcOverride nix-tools cabal-install index-state;
531− ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
532− index-state = final.haskell-nix.internalHackageIndexState;
533 materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/alex";
551 materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/alex";
534 } // args);
552 } // args);
535 alex = bootstrap.packages.alex-tool {};
553 alex = bootstrap.packages.alex-tool {};
554+ alex-unchecked = bootstrap.packages.alex-tool { checkMaterialization = false; };
536− happy-tool = args: tool "happy" ({
555+ happy-tool = { version ? "1.19.12", ... }@args: tool buildBootstrapper.compilerNixName "happy" ({
537− version = buildBootstrapper.happyVersion;
556+ inherit version ghcOverride nix-tools cabal-install index-state;
538− # Only a boot compiler is suitable here
539− ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
540− index-state = final.haskell-nix.internalHackageIndexState;
541− materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/happy-${buildBootstrapper.happyVersion}";
557+ materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/happy-${version}";
542 } // args);
558 } // args);
543 happy = bootstrap.packages.happy-tool {};
559 happy = bootstrap.packages.happy-tool {};
560+ happy-unchecked = bootstrap.packages.happy-tool { checkMaterialization = false; };
561+ # Older version needed when building ghc 8.6.5
562+ happy-old = bootstrap.packages.happy-tool { version = "1.19.11"; };
563+ happy-old-unchecked = bootstrap.packages.happy-tool { version = "1.19.11"; checkMaterialization = false; };
544 hscolour-tool = args: (hackage-package ({
564 hscolour-tool = args: (hackage-package ({
565+ compiler-nix-name = buildBootstrapper.compilerNixName;
545 name = "hscolour";
566 name = "hscolour";
546 version = "1.24.4";
567 version = "1.24.4";
547− # Only a boot compiler is suitable here
568+ inherit ghcOverride nix-tools cabal-install index-state;
548− ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
549− index-state = final.haskell-nix.internalHackageIndexState;
550 materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/hscolour";
569 materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/hscolour";
551 } // args)).components.exes.HsColour;
570 } // args)).components.exes.HsColour;
552 hscolour = bootstrap.packages.hscolour-tool {};
571 hscolour = bootstrap.packages.hscolour-tool {};
572+ hscolour-unchecked = bootstrap.packages.hscolour-tool { checkMaterialization = false; };
553 };
573 };
554 };
574 };
555 };
575 };
overlays/eval-on-current.nix+3−3
@@ -2,7 +2,7 @@ final: prev: {
2 # This overlay makes `evalPackages` is like `buildPackages`, but on
2 # This overlay makes `evalPackages` is like `buildPackages`, but on
3 # `builtins.currentSystem`.
3 # `builtins.currentSystem`.
4 # See `eval-on-build.nix` for alternative that just uses `buildPackages`.
4 # See `eval-on-build.nix` for alternative that just uses `buildPackages`.
5− evalPackages = (import final.path (import ../. {
5+ evalPackages = (import final.path {
6− inherit (final.haskell-nix) defaultCompilerNixName;
6+ inherit (final.haskell-nix) overlays;
7− }).nixpkgsArgs).buildPackages;
7+ }).buildPackages;
8}
8}
overlays/ghc-packages.nix+8−8
@@ -1,14 +1,14 @@
1final: prev:
1final: prev:
2let
2let
3− callCabal2Nix = name: src: final.stdenv.mkDerivation {
3+ callCabal2Nix = compiler-nix-name: name: src: final.evalPackages.stdenv.mkDerivation {
4 name = "${name}-package.nix";
4 name = "${name}-package.nix";
5 inherit src;
5 inherit src;
6− nativeBuildInputs = [ (final.buildPackages.haskell-nix.nix-tools-set {
6+ nativeBuildInputs = [
7− # It is not safe to checkk the nix-tools materialization here
7+ # It is not safe to check the nix-tools materialization here
8 # as we would need to run this code to do so leading to
8 # as we would need to run this code to do so leading to
9− # infinite recursion.
9+ # infinite recursion (so using nix-tools-unchecked).
10− checkMaterialization = false;
10+ final.evalPackages.haskell-nix.nix-tools-unchecked.${compiler-nix-name}
11− }) ];
11+ ];
12 phases = [ "unpackPhase" "buildPhase" ];
12 phases = [ "unpackPhase" "buildPhase" ];
13
13
14 LOCALE_ARCHIVE = final.lib.optionalString (final.stdenv.hostPlatform.libc == "glibc") "${final.glibcLocales}/lib/locale/locale-archive";
14 LOCALE_ARCHIVE = final.lib.optionalString (final.stdenv.hostPlatform.libc == "glibc") "${final.glibcLocales}/lib/locale/locale-archive";
@@ -117,7 +117,7 @@ in rec {
117 fi
117 fi
118 ''
118 ''
119 else "${value.passthru.configured-src}/${dir}";
119 else "${value.passthru.configured-src}/${dir}";
120− nix = callCabal2Nix "${ghcName}-${pkgName}" src;
120+ nix = callCabal2Nix ghcName "${ghcName}-${pkgName}" src;
121 }) ghc-extra-pkgs)
121 }) ghc-extra-pkgs)
122 final.buildPackages.haskell-nix.compiler;
122 final.buildPackages.haskell-nix.compiler;
123
123
@@ -178,7 +178,7 @@ in rec {
178 if __pathExists materializedPath
178 if __pathExists materializedPath
179 then materializedPath
179 then materializedPath
180 else null;
180 else null;
181− ghcOverride = final.buildPackages.haskell-nix.compiler.${ghcName};
181+ compiler-nix-name = ghcName;
182 configureArgs = "--disable-tests --allow-newer='terminfo:base'"; # avoid failures satisfying bytestring package tests dependencies
182 configureArgs = "--disable-tests --allow-newer='terminfo:base'"; # avoid failures satisfying bytestring package tests dependencies
183 })
183 })
184 ghc-extra-pkgs-cabal-projects;
184 ghc-extra-pkgs-cabal-projects;
overlays/hackage-quirks.nix+14
@@ -13,6 +13,20 @@ in { haskell-nix = prev.haskell-nix // {
13 # but also for
13 # but also for
14 # https://github.com/input-output-hk/haskell.nix/issues/422
14 # https://github.com/input-output-hk/haskell.nix/issues/422
15 cabal-install = {
15 cabal-install = {
16+ cabalProject = ''
17+ packages: .
18+ allow-newer: cabal-install:base
19+ '';
20+ modules = [
21+ { reinstallableLibGhc = true; }
22+ # Version of of cabal-install in hacakge is borken for GHC 8.10.1
23+ (lib.optionalAttrs (version == "3.2.0.0") {
24+ packages.cabal-install.src = final.haskell-nix.sources.cabal-32 + "/cabal-install";
25+ })
26+ ];
27+ };
28+
29+ hpack = {
16 modules = [ { reinstallableLibGhc = true; } ];
30 modules = [ { reinstallableLibGhc = true; } ];
17 };
31 };
18
32
overlays/haskell.nix+55−33
@@ -252,22 +252,26 @@ final: prev: {
252 };
252 };
253
253
254 update-index-state-hashes = import ../scripts/update-index-state-hashes.nix {
254 update-index-state-hashes = import ../scripts/update-index-state-hashes.nix {
255− inherit (final.haskell-nix) indexStateHashesPath nix-tools;
255+ inherit (final.haskell-nix) indexStateHashesPath;
256 inherit (final) coreutils nix writeShellScriptBin stdenv curl;
256 inherit (final) coreutils nix writeShellScriptBin stdenv curl;
257+ # Update scripts use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
258+ nix-tools = final.haskell-nix.internal-nix-tools;
257 };
259 };
258
260
259 # Function to call stackToNix
261 # Function to call stackToNix
260 callStackToNix = import ../lib/call-stack-to-nix.nix {
262 callStackToNix = import ../lib/call-stack-to-nix.nix {
261 pkgs = final.evalPackages.pkgs;
263 pkgs = final.evalPackages.pkgs;
262 inherit (final.evalPackages.pkgs) runCommand;
264 inherit (final.evalPackages.pkgs) runCommand;
263− inherit (final.evalPackages.haskell-nix) nix-tools mkCacheFile materialize haskellLib;
265+ inherit (final.evalPackages.haskell-nix) mkCacheFile materialize haskellLib;
264 };
266 };
265
267
266 # given a source location call `cabal-to-nix` (from nix-tools) on it
268 # given a source location call `cabal-to-nix` (from nix-tools) on it
267 # to produce the nix representation of it.
269 # to produce the nix representation of it.
268 callCabalToNix = { name, src, cabal-file ? "${name}.cabal" }:
270 callCabalToNix = { name, src, cabal-file ? "${name}.cabal" }:
269 final.buildPackages.pkgs.runCommand "${name}.nix" {
271 final.buildPackages.pkgs.runCommand "${name}.nix" {
272+ # This function is only used when building stack projects (via mkCacheLine and mkCacheFile)
273+ # When building stack projects we use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
270− nativeBuildInputs = [ final.buildPackages.haskell-nix.nix-tools ];
274+ nativeBuildInputs = [ final.buildPackages.haskell-nix.internal-nix-tools ];
271
275
272 LOCALE_ARCHIVE = final.lib.optionalString (final.stdenv.buildPlatform.libc == "glibc") "${final.buildPackages.glibcLocales}/lib/locale/locale-archive";
276 LOCALE_ARCHIVE = final.lib.optionalString (final.stdenv.buildPlatform.libc == "glibc") "${final.buildPackages.glibcLocales}/lib/locale/locale-archive";
273 LANG = "en_US.UTF-8";
277 LANG = "en_US.UTF-8";
@@ -364,7 +368,7 @@ final: prev: {
364
368
365 genStackCache = import ../lib/stack-cache-generator.nix {
369 genStackCache = import ../lib/stack-cache-generator.nix {
366 inherit (final.evalPackages) pkgs;
370 inherit (final.evalPackages) pkgs;
367− inherit (final.evalPackages.haskell-nix) haskellLib nix-tools;
371+ inherit (final.evalPackages.haskell-nix) haskellLib;
368 };
372 };
369
373
370 mkCacheModule = cache:
374 mkCacheModule = cache:
@@ -410,9 +414,8 @@ final: prev: {
410 index-state-hashes = import indexStateHashesPath;
414 index-state-hashes = import indexStateHashesPath;
411 inherit (final.buildPackages.haskell-nix) haskellLib materialize;
415 inherit (final.buildPackages.haskell-nix) haskellLib materialize;
412 pkgs = final.buildPackages.pkgs;
416 pkgs = final.buildPackages.pkgs;
413− inherit (final.evalPackages.haskell-nix.haskellPackages.hpack.components.exes) hpack;
417+ inherit (final) evalPackages;
414− inherit (final.buildPackages.haskell-nix) ghc;
415− inherit (final.evalPackages.haskell-nix) cabal-install dotCabal nix-tools;
418+ inherit (final.evalPackages.haskell-nix) dotCabal;
416 inherit (final.buildPackages.pkgs) runCommand symlinkJoin cacert;
419 inherit (final.buildPackages.pkgs) runCommand symlinkJoin cacert;
417 };
420 };
418
421
@@ -436,12 +439,17 @@ final: prev: {
436 # the index-state-hashes is used. This guarantees reproducability wrt
439 # the index-state-hashes is used. This guarantees reproducability wrt
437 # to the haskell.nix revision. If reproducability beyond haskell.nix
440 # to the haskell.nix revision. If reproducability beyond haskell.nix
438 # is required, a specific index-state should be provided!
441 # is required, a specific index-state should be provided!
442+ hackage-package =
443+ { name, compiler-nix-name, ... }@args':
444+ let args = { caller = "hackage-package"; } // args';
439− hackage-package = { name, ... }@args: (hackage-project args).hsPkgs.${name};
445+ in (hackage-project args).hsPkgs.${name};
440 hackage-project =
446 hackage-project =
441 { name
447 { name
448+ , compiler-nix-name
442 , version
449 , version
443− , ... }@args:
450+ , ... }@args':
451+ let args = { caller = "hackage-project"; } // args';
444− let tarball = final.pkgs.fetchurl {
452+ tarball = final.pkgs.fetchurl {
445 url = "mirror://hackage/${name}-${version}.tar.gz";
453 url = "mirror://hackage/${name}-${version}.tar.gz";
446 inherit (hackage.${name}.${version}) sha256; };
454 inherit (hackage.${name}.${version}) sha256; };
447 in let src = final.buildPackages.pkgs.runCommand "${name}-${version}-src" { } ''
455 in let src = final.buildPackages.pkgs.runCommand "${name}-${version}-src" { } ''
@@ -458,8 +466,9 @@ final: prev: {
458 # separately from the hsPkgs. The advantage is that the you can get the
466 # separately from the hsPkgs. The advantage is that the you can get the
459 # plan-nix without building the project.
467 # plan-nix without building the project.
460 cabalProject' =
468 cabalProject' =
461− { ... }@args:
469+ { src, compiler-nix-name, ... }@args':
462 let
470 let
471+ args = { caller = "cabalProject'"; } // args';
463 callProjectResults = callCabalProjectToNix args;
472 callProjectResults = callCabalProjectToNix args;
464 in let pkg-set = mkCabalProjectPkgSet
473 in let pkg-set = mkCabalProjectPkgSet
465 { plan-pkgs = importAndFilterProject {
474 { plan-pkgs = importAndFilterProject {
@@ -478,6 +487,9 @@ final: prev: {
478 inherit pkg-set;
487 inherit pkg-set;
479 plan-nix = callProjectResults.projectNix;
488 plan-nix = callProjectResults.projectNix;
480 inherit (callProjectResults) index-state;
489 inherit (callProjectResults) index-state;
490+ tool = final.buildPackages.haskell-nix.tool pkg-set.config.compiler.nix-name;
491+ tools = final.buildPackages.haskell-nix.tools pkg-set.config.compiler.nix-name;
492+ roots = final.haskell-nix.roots pkg-set.config.compiler.nix-name;
481 };
493 };
482
494
483 # Take `hsPkgs` from the `rawProject` and update all the packages and
495 # Take `hsPkgs` from the `rawProject` and update all the packages and
@@ -507,16 +519,20 @@ final: prev: {
507 });
519 });
508 });
520 });
509
521
522+ cabalProject =
523+ { src, compiler-nix-name, ... }@args':
524+ let
525+ args = { caller = "hackage-package"; } // args';
510− cabalProject = args: let p = cabalProject' args;
526+ p = cabalProject' args;
511 in p.hsPkgs // {
527 in p.hsPkgs // {
512− inherit (p) plan-nix;
528+ inherit (p) plan-nix index-state tool tools roots;
513 # Provide `nix-shell -A shells.ghc` for users migrating from the reflex-platform.
529 # Provide `nix-shell -A shells.ghc` for users migrating from the reflex-platform.
514 # But we should encourage use of `nix-shell -A shellFor`
530 # But we should encourage use of `nix-shell -A shellFor`
515 shells.ghc = p.hsPkgs.shellFor {};
531 shells.ghc = p.hsPkgs.shellFor {};
516 };
532 };
517
533
518 stackProject' =
534 stackProject' =
519− { ... }@args:
535+ { src, ... }@args:
520 let callProjectResults = callStackToNix ({ inherit cache; } // args);
536 let callProjectResults = callStackToNix ({ inherit cache; } // args);
521 generatedCache = genStackCache args;
537 generatedCache = genStackCache args;
522 cache = args.cache or generatedCache;
538 cache = args.cache or generatedCache;
@@ -531,11 +547,14 @@ final: prev: {
531 inherit (pkg-set.config) hsPkgs;
547 inherit (pkg-set.config) hsPkgs;
532 inherit pkg-set;
548 inherit pkg-set;
533 stack-nix = callProjectResults.projectNix;
549 stack-nix = callProjectResults.projectNix;
550+ tool = final.buildPackages.haskell-nix.tool pkg-set.config.compiler.nix-name;
551+ tools = final.buildPackages.haskell-nix.tools pkg-set.config.compiler.nix-name;
552+ roots = final.haskell-nix.roots pkg-set.config.compiler.nix-name;
534− };
553+ };
535
554
536 stackProject = args: let p = stackProject' args;
555 stackProject = args: let p = stackProject' args;
537 in p.hsPkgs // {
556 in p.hsPkgs // {
538− inherit (p) stack-nix;
557+ inherit (p) stack-nix tool tools roots;
539 # Provide `nix-shell -A shells.ghc` for users migrating from the reflex-platform.
558 # Provide `nix-shell -A shells.ghc` for users migrating from the reflex-platform.
540 # But we should encourage use of `nix-shell -A shellFor`
559 # But we should encourage use of `nix-shell -A shellFor`
541 shells.ghc = p.hsPkgs.shellFor {};
560 shells.ghc = p.hsPkgs.shellFor {};
@@ -550,8 +569,9 @@ final: prev: {
550 # selected file ends in a `.yaml` it is assumed to be for `stackProject`.
569 # selected file ends in a `.yaml` it is assumed to be for `stackProject`.
551 # If niether `stack.yaml` nor `cabal.project` exist `cabalProject` is
570 # If niether `stack.yaml` nor `cabal.project` exist `cabalProject` is
552 # used (as it will use a default `cabal.project`).
571 # used (as it will use a default `cabal.project`).
553− project' = { src, projectFileName ? null, ... }@args:
572+ project' = { src, projectFileName ? null, ... }@args':
554 let
573 let
574+ args = { caller = "project'"; } // args';
555 dir = __readDir (src.origSrcSubDir or src);
575 dir = __readDir (src.origSrcSubDir or src);
556 exists = fileName: builtins.elem (dir.${fileName} or "") ["regular" "symlink"];
576 exists = fileName: builtins.elem (dir.${fileName} or "") ["regular" "symlink"];
557 stackYamlExists = exists "stack.yaml";
577 stackYamlExists = exists "stack.yaml";
@@ -574,8 +594,11 @@ final: prev: {
574
594
575 # This is the same as the `cabalPackage` and `stackPackage` wrappers
595 # This is the same as the `cabalPackage` and `stackPackage` wrappers
576 # for `cabalPackage` and `stackPackage`.
596 # for `cabalPackage` and `stackPackage`.
597+ project = args':
598+ let
599+ args = { caller = "project'"; } // args';
577− project = args: let p = project' args;
600+ p = project' args;
578− in p.hsPkgs // {
601+ in p.hsPkgs // {
579 # Provide `nix-shell -A shells.ghc` for users migrating from the reflex-platform.
602 # Provide `nix-shell -A shells.ghc` for users migrating from the reflex-platform.
580 # But we should encourage use of `nix-shell -A shellFor`
603 # But we should encourage use of `nix-shell -A shellFor`
581 shells.ghc = p.hsPkgs.shellFor {};
604 shells.ghc = p.hsPkgs.shellFor {};
@@ -598,17 +621,16 @@ final: prev: {
598
621
599 # Add this to your tests to make all the dependencies of haskell.nix
622 # Add this to your tests to make all the dependencies of haskell.nix
600 # are tested and cached.
623 # are tested and cached.
601− haskellNixRoots = final.recurseIntoAttrs {
624+ roots = compiler-nix-name: final.recurseIntoAttrs {
602− Level0 = haskellNixRoots' 0;
625+ Level0 = roots' compiler-nix-name 0;
603− Level1 = haskellNixRoots' 1;
626+ Level1 = roots' compiler-nix-name 1;
604 # Should be safe to use this now we have materialized everything
627 # Should be safe to use this now we have materialized everything
605 # except the tests
628 # except the tests
606− Level2 = haskellNixRoots' 2;
629+ Level2 = roots' compiler-nix-name 2;
607 };
630 };
608
631
609− haskellNixRoots' = ifdLevel:
632+ roots' = compiler-nix-name: ifdLevel:
610− let inherit (final.haskell-nix) defaultCompilerNixName;
611− in final.recurseIntoAttrs ({
633+ final.recurseIntoAttrs ({
612 # Things that require no IFD to build
634 # Things that require no IFD to build
613 inherit (final.buildPackages.haskell-nix) source-pins;
635 inherit (final.buildPackages.haskell-nix) source-pins;
614 # Double buildPackages is intentional,
636 # Double buildPackages is intentional,
@@ -624,20 +646,20 @@ final: prev: {
624 boot-alex = final.buildPackages.haskell-nix.bootstrap.packages.alex;
646 boot-alex = final.buildPackages.haskell-nix.bootstrap.packages.alex;
625 boot-happy = final.buildPackages.haskell-nix.bootstrap.packages.happy;
647 boot-happy = final.buildPackages.haskell-nix.bootstrap.packages.happy;
626 boot-hscolour = final.buildPackages.haskell-nix.bootstrap.packages.hscolour;
648 boot-hscolour = final.buildPackages.haskell-nix.bootstrap.packages.hscolour;
627− ghc = final.buildPackages.haskell-nix.ghc;
649+ ghc = final.buildPackages.haskell-nix.compiler.${compiler-nix-name};
628 ghc-boot-packages-nix = final.recurseIntoAttrs
650 ghc-boot-packages-nix = final.recurseIntoAttrs
629− final.ghc-boot-packages-nix."${defaultCompilerNixName}";
651+ final.ghc-boot-packages-nix.${compiler-nix-name};
630 ghc-extra-projects-nix =
652 ghc-extra-projects-nix =
631− final.ghc-extra-projects."${defaultCompilerNixName}".plan-nix;
653+ final.ghc-extra-projects.${compiler-nix-name}.plan-nix;
632 } // final.lib.optionalAttrs (ifdLevel > 1) {
654 } // final.lib.optionalAttrs (ifdLevel > 1) {
633 # Things that require two levels of IFD to build (inputs should be in level 1)
655 # Things that require two levels of IFD to build (inputs should be in level 1)
634− inherit (final.buildPackages.haskell-nix.haskellPackages.hpack.components.exes) hpack;
656+ nix-tools = final.buildPackages.haskell-nix.nix-tools.${compiler-nix-name};
635− inherit (final.buildPackages.haskell-nix) cabal-install dotCabal nix-tools alex happy;
657+ cabal-install = final.buildPackages.haskell-nix.cabal-install.${compiler-nix-name};
636 # These seem to be the only things we use from `ghc-extra-packages`
658 # These seem to be the only things we use from `ghc-extra-packages`
637 # in haskell.nix itself.
659 # in haskell.nix itself.
638− inherit (final.ghc-extra-packages."${defaultCompilerNixName}"
660+ inherit (final.ghc-extra-packages."${compiler-nix-name}"
639 .iserv-proxy.components.exes) iserv-proxy;
661 .iserv-proxy.components.exes) iserv-proxy;
640− inherit (final.ghc-extra-packages."${defaultCompilerNixName}"
662+ inherit (final.ghc-extra-packages."${compiler-nix-name}"
641 .remote-iserv.components.exes) remote-iserv;
663 .remote-iserv.components.exes) remote-iserv;
642 });
664 });
643 };
665 };
overlays/tools.nix+22−12
@@ -6,16 +6,17 @@
6# when it is not.
6# when it is not.
7#
7#
8# To get a single tool:
8# To get a single tool:
9−# haskell-nix.tool "cabal" "3.2.0.0"
9+# haskell-nix.tool "ghc883" "cabal" "3.2.0.0"
10#
10#
11# This does the same thing as:
11# This does the same thing as:
12# (haskell-nix.hackage-package {
12# (haskell-nix.hackage-package {
13+# compiler-nix-name = "ghc883";
13# name = "cabal-install"
14# name = "cabal-install"
14# version = "3.2.0.0"
15# version = "3.2.0.0"
15# }).components.exes.cabal
16# }).components.exes.cabal
16#
17#
17# To get an attr set containing multiple tools:
18# To get an attr set containing multiple tools:
18−# haskell-nix.tools { cabal = "3.2.0.0"; hlint = "2.2.11"; }
19+# haskell-nix.tools "ghc883" { cabal = "3.2.0.0"; hlint = "2.2.11"; }
19#
20#
20# To add tools to a shell:
21# To add tools to a shell:
21# shellFor { tools = { cabal = "3.2.0.0"; hlint = "2.2.11"; }; }
22# shellFor { tools = { cabal = "3.2.0.0"; hlint = "2.2.11"; }; }
@@ -23,13 +24,18 @@
23# When used in shellFor the tools will be compiled with the same version
24# When used in shellFor the tools will be compiled with the same version
24# of ghc used in the shell (the build ghc in the case of cross compilation).
25# of ghc used in the shell (the build ghc in the case of cross compilation).
25#
26#
27+# To get tools for use with project `p` without using shellFor:
28+# p.tool "cabal" "3.2.0.0"
29+# p.tools { cabal = "3.2.0.0"; hlint = "2.2.11"; }
30+# (the ghc version used to build it will match the one used in the project)
31+#
26# Instead of a version string we can use an attr set containing
32# Instead of a version string we can use an attr set containing
27# arguments that will be passed to `cabalProject`.
33# arguments that will be passed to `cabalProject`.
28#
34#
29−# For instance to specify the ghc used to compile. Use:
35+# For instance to add haskell.nix modules. Use:
30−# haskell-nix.tool "cabal" {
36+# haskell-nix.tool "ghc883" "cabal" {
31# version = "3.2.0.0";
37# version = "3.2.0.0";
32−# ghc = haskell-nix.compiler.ghc883;
38+# modules = [ ... ];
33# }
39# }
34#
40#
35final: prev:
41final: prev:
@@ -51,21 +57,25 @@ in { haskell-nix = prev.haskell-nix // {
51 cabal-install = "cabal";
57 cabal-install = "cabal";
52 };
58 };
53
59
54− hackage-tool = { name, ... }@args:
60+ hackage-tool = { name, ... }@args':
61+ let
62+ args = { caller = "hackage-tool"; } // args';
63+ in
55− (final.haskell-nix.hackage-package
64+ (final.haskell-nix.hackage-package
56− (args // { name = final.haskell-nix.toolPackageName.${name} or name; }))
65+ (args // { name = final.haskell-nix.toolPackageName.${name} or name; }))
57− .components.exes."${final.haskell-nix.packageToolName.${name} or name}";
66+ .components.exes."${final.haskell-nix.packageToolName.${name} or name}";
58
67
59− tool = name: versionOrArgs:
68+ tool = compiler-nix-name: name: versionOrArgs:
60 let
69 let
61− args = final.haskell-nix.haskellLib.versionOrArgsToArgs versionOrArgs;
70+ args' = final.haskell-nix.haskellLib.versionOrArgsToArgs versionOrArgs;
71+ args = { inherit compiler-nix-name; } // args';
62 in
72 in
63 (if final.haskell-nix.custom-tools ? "${name}"
73 (if final.haskell-nix.custom-tools ? "${name}"
64 && final.haskell-nix.custom-tools."${name}" ? "${args.version}"
74 && final.haskell-nix.custom-tools."${name}" ? "${args.version}"
65 then final.haskell-nix.custom-tools."${name}"."${args.version}"
75 then final.haskell-nix.custom-tools."${name}"."${args.version}"
66 else final.haskell-nix.hackage-tool) (args // { inherit name; });
76 else final.haskell-nix.hackage-tool) (args // { inherit name; });
67
77
68− tools = lib.mapAttrs final.haskell-nix.tool;
78+ tools = compiler-nix-name: lib.mapAttrs (final.haskell-nix.tool compiler-nix-name);
69
79
70 # Like `tools` but allows default ghc to be specified
80 # Like `tools` but allows default ghc to be specified
71 toolsForGhc = ghcOverride: toolSet:
81 toolsForGhc = ghcOverride: toolSet:
release.nix+1−1
@@ -6,7 +6,7 @@
6
6
7let
7let
8 inherit (import ./ci-lib.nix) stripAttrsForHydra filterDerivations;
8 inherit (import ./ci-lib.nix) stripAttrsForHydra filterDerivations;
9− genericPkgs = import (import ./nixpkgs/default.nix).nixpkgs-default {};
9+ genericPkgs = import (import ./nix/sources.nix).nixpkgs {};
10 lib = genericPkgs.lib;
10 lib = genericPkgs.lib;
11 ci = import ./ci.nix { inherit supportedSystems ifdLevel checkMaterialization; restrictEval = true; };
11 ci = import ./ci.nix { inherit supportedSystems ifdLevel checkMaterialization; restrictEval = true; };
12 allJobs = stripAttrsForHydra (filterDerivations ci);
12 allJobs = stripAttrsForHydra (filterDerivations ci);
scripts/check-path-support.nix+2−2
@@ -1,4 +1,4 @@
1−{ stdenv, writeScript, nix }:
1+{ stdenv, writeScript, coreutils, gnutar, gzip, nix }:
2
2
3with stdenv.lib;
3with stdenv.lib;
4
4
@@ -7,7 +7,7 @@ writeScript "check-path-supprot.sh" ''
7
7
8 set -euo pipefail
8 set -euo pipefail
9
9
10− export PATH="${makeBinPath [ nix ]}"
10+ export PATH="${makeBinPath [ coreutils gnutar gzip nix ]}"
11
11
12 nix-build -E '((import ./. {}).pkgs.haskell-nix.cabalProject { compiler-nix-name = "ghc865"; src = ./test/cabal-simple; }).cabal-simple.components.library'
12 nix-build -E '((import ./. {}).pkgs.haskell-nix.cabalProject { compiler-nix-name = "ghc865"; src = ./test/cabal-simple; }).cabal-simple.components.library'
13''
13''
shell.nix+1−1
@@ -1,6 +1,6 @@
1let
1let
2 inherit (import ./default.nix {}) sources nixpkgsArgs;
2 inherit (import ./default.nix {}) sources nixpkgsArgs;
3− pkgs = import sources.nixpkgs-default nixpkgsArgs;
3+ pkgs = import sources.nixpkgs nixpkgsArgs;
4in pkgs.stdenv.mkDerivation rec {
4in pkgs.stdenv.mkDerivation rec {
5 name = "env";
5 name = "env";
6 env = pkgs.buildEnv { name = name; paths = buildInputs; };
6 env = pkgs.buildEnv { name = name; paths = buildInputs; };
test/buildable/default.nix+2−1
@@ -1,9 +1,10 @@
1−{ stdenv, cabalProject', haskellLib, recurseIntoAttrs, testSrc }:
1+{ stdenv, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
2
2
3with stdenv.lib;
3with stdenv.lib;
4
4
5let
5let
6 project = cabalProject' {
6 project = cabalProject' {
7+ inherit compiler-nix-name;
7 index-state = "2020-05-25T00:00:00Z";
8 index-state = "2020-05-25T00:00:00Z";
8 src = testSrc "buildable";
9 src = testSrc "buildable";
9 modules = [ { packages.buildable-test.flags.exclude-broken = true; } ];
10 modules = [ { packages.buildable-test.flags.exclude-broken = true; } ];
test/cabal-22/default.nix+2−1
@@ -1,9 +1,10 @@
1−{ stdenv, mkCabalProjectPkgSet, cabalProject', haskellLib, util, recurseIntoAttrs, testSrc }:
1+{ stdenv, mkCabalProjectPkgSet, cabalProject', haskellLib, util, recurseIntoAttrs, testSrc, compiler-nix-name }:
2
2
3with stdenv.lib;
3with stdenv.lib;
4
4
5let
5let
6 project = cabalProject' {
6 project = cabalProject' {
7+ inherit compiler-nix-name;
7 src = testSrc "cabal-22";
8 src = testSrc "cabal-22";
8 };
9 };
9
10
test/cabal-hpack/Setup.hsnew file+2
@@ -0,0 +1,2 @@
1+import Distribution.Simple
2+main = defaultMain
test/cabal-hpack/app/Main.hsnew file+4
@@ -0,0 +1,4 @@
1+module Main where
2+
3+main :: IO ()
4+main = putStrLn "Hello, Haskell!"
test/cabal-hpack/default.nixnew file+74
@@ -0,0 +1,74 @@
1+# Test a package set
2+{ stdenv, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
3+
4+with stdenv.lib;
5+
6+let
7+ modules = [
8+ {
9+ # Package has no exposed modules which causes
10+ # haddock: No input file(s)
11+ packages.cabal-hpack.doHaddock = false;
12+ }
13+ ];
14+
15+ project = project' {
16+ inherit compiler-nix-name;
17+ src = testSrc "cabal-hpack";
18+ inherit modules;
19+ };
20+
21+ packages = project.hsPkgs;
22+
23+in recurseIntoAttrs {
24+ ifdInputs = {
25+ inherit (project) plan-nix;
26+ };
27+
28+ # Used for testing externally with nix-shell (../tests.sh).
29+ # This just adds cabal-install to the existing shells.
30+ test-shell = util.addCabalInstall packages.cabal-hpack.components.all;
31+
32+ run = stdenv.mkDerivation {
33+ name = "cabal-hpack-test";
34+
35+ buildCommand = ''
36+ exe="${packages.cabal-hpack.components.exes.cabal-hpack}/bin/cabal-hpack${stdenv.hostPlatform.extensions.executable}"
37+
38+ size=$(command stat --format '%s' "$exe")
39+ printf "size of executable $exe is $size. \n" >& 2
40+
41+ # fixme: run on target platform when cross-compiled
42+ printf "checking whether executable runs... " >& 2
43+ cat ${haskellLib.check packages.cabal-hpack.components.exes.cabal-hpack}
44+ '' + (if stdenv.hostPlatform.isMusl
45+ then ''
46+ printf "checking that executable is statically linked... " >& 2
47+ (ldd $exe 2>&1 || true) | grep -i "not a"
48+ ''
49+ else
50+ # Skip this on aarch as we do not have an `ldd` tool
51+ optionalString (!stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64) (''
52+ printf "checking that executable is dynamically linked to system libraries... " >& 2
53+ '' + optionalString stdenv.isLinux ''
54+ ldd $exe | grep libpthread
55+ '' + optionalString stdenv.isDarwin ''
56+ otool -L $exe |grep .dylib
57+ '')) + ''
58+
59+ printf "Checking that \"all\" component has the programs... " >& 2
60+ all_exe="${packages.cabal-hpack.components.all}/bin/cabal-hpack${stdenv.hostPlatform.extensions.executable}"
61+ test -f "$all_exe"
62+ echo "$all_exe" >& 2
63+
64+ touch $out
65+ '';
66+
67+ meta.platforms = platforms.all;
68+
69+ passthru = {
70+ # Used for debugging with nix repl
71+ inherit project packages;
72+ };
73+ };
74+}
test/cabal-hpack/package.yamlnew file+34
@@ -0,0 +1,34 @@
1+name: cabal-hpack
2+version: 0.1.0.0
3+github: "githubuser/cabal-hpack"
4+license: BSD3
5+author: "Author name here"
6+maintainer: "example@example.com"
7+copyright: "2019 Author name here"
8+
9+# Metadata used when publishing your package
10+# synopsis: Short description of your package
11+# category: Web
12+
13+# To avoid duplicated efforts in documentation and dealing with the
14+# complications of embedding Haddock markup inside cabal files, it is
15+# common to point users to the README.md file.
16+description: Please see the README on GitHub at <https://github.com/githubuser/stack-simple#readme>
17+
18+dependencies:
19+- base >= 4.7 && < 5
20+
21+library:
22+ source-dirs: src
23+
24+executables:
25+ cabal-hpack:
26+ main: Main.hs
27+ source-dirs: app
28+ ghc-options:
29+ - -threaded
30+ - -rtsopts
31+ - -with-rtsopts=-N
32+ dependencies:
33+ - cabal-hpack
34+
test/cabal-simple-prof/default.nix+2−1
@@ -1,5 +1,5 @@
1# Test a package set
1# Test a package set
2−{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc }:
2+{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
3
3
4with stdenv.lib;
4with stdenv.lib;
5
5
@@ -16,6 +16,7 @@ let
16 ];
16 ];
17
17
18 project = cabalProject' {
18 project = cabalProject' {
19+ inherit compiler-nix-name;
19 src = testSrc "cabal-simple-prof";
20 src = testSrc "cabal-simple-prof";
20 inherit modules;
21 inherit modules;
21 };
22 };
test/cabal-simple/default.nix+2−1
@@ -1,5 +1,5 @@
1# Test a package set
1# Test a package set
2−{ stdenv, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc }:
2+{ stdenv, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
3
3
4with stdenv.lib;
4with stdenv.lib;
5
5
@@ -13,6 +13,7 @@ let
13 ];
13 ];
14
14
15 project = project' {
15 project = project' {
16+ inherit compiler-nix-name;
16 src = testSrc "cabal-simple";
17 src = testSrc "cabal-simple";
17 inherit modules;
18 inherit modules;
18 };
19 };
test/cabal-source-repo/default.nix+2−1
@@ -1,9 +1,10 @@
1−{ stdenv, cabalProject', recurseIntoAttrs, haskellLib, testSrc }:
1+{ stdenv, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
2
2
3with stdenv.lib;
3with stdenv.lib;
4
4
5let
5let
6 project = cabalProject' {
6 project = cabalProject' {
7+ inherit compiler-nix-name;
7 index-state = "2020-05-25T00:00:00Z";
8 index-state = "2020-05-25T00:00:00Z";
8 src = testSrc "cabal-source-repo";
9 src = testSrc "cabal-source-repo";
9 };
10 };
test/cabal-sublib/default.nix+2−1
@@ -1,5 +1,5 @@
1# Test a package set
1# Test a package set
2−{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc }:
2+{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
3
3
4with stdenv.lib;
4with stdenv.lib;
5
5
@@ -14,6 +14,7 @@ let
14
14
15 # The ./pkgs.nix works for linux & darwin, but not for windows
15 # The ./pkgs.nix works for linux & darwin, but not for windows
16 project = cabalProject' {
16 project = cabalProject' {
17+ inherit compiler-nix-name;
17 src = testSrc "cabal-sublib";
18 src = testSrc "cabal-sublib";
18 inherit modules;
19 inherit modules;
19 };
20 };
test/call-cabal-project-to-nix/default.nix+2−1
@@ -1,4 +1,4 @@
1−{ stdenv, mkCabalProjectPkgSet, callCabalProjectToNix, importAndFilterProject, recurseIntoAttrs, haskellLib, testSrc }:
1+{ stdenv, mkCabalProjectPkgSet, callCabalProjectToNix, importAndFilterProject, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
2
2
3with stdenv.lib;
3with stdenv.lib;
4
4
@@ -6,6 +6,7 @@ let
6 # This test could use cabalProject', but it does so that it
6 # This test could use cabalProject', but it does so that it
7 # tests using callCabalProjectToNix and importAndFilterProject
7 # tests using callCabalProjectToNix and importAndFilterProject
8 callProjectResults = callCabalProjectToNix {
8 callProjectResults = callCabalProjectToNix {
9+ inherit compiler-nix-name;
9 index-state = "2020-05-25T00:00:00Z";
10 index-state = "2020-05-25T00:00:00Z";
10 # reuse the cabal-simple test project
11 # reuse the cabal-simple test project
11 src = testSrc "cabal-simple";
12 src = testSrc "cabal-simple";
test/default.nix+27−29
@@ -1,10 +1,10 @@
1−let
2− haskellNix = (import ../default.nix {});
1+{ haskellNix ? import ../default.nix { inherit checkMaterialization; }
3−in
4−{ pkgs ? import nixpkgs nixpkgsArgs
2+, pkgs ? import nixpkgs nixpkgsArgs
5−, nixpkgs ? haskellNix.sources.nixpkgs-default
3+, nixpkgs ? haskellNix.sources.nixpkgs
6, nixpkgsArgs ? haskellNix.nixpkgsArgs
4, nixpkgsArgs ? haskellNix.nixpkgsArgs
7, ifdLevel ? 1000
5, ifdLevel ? 1000
6+, compiler-nix-name
7+, checkMaterialization ? false
8}:
8}:
9
9
10with pkgs;
10with pkgs;
@@ -44,7 +44,7 @@ let
44 else val
44 else val
45 );
45 );
46
46
47− util = import ./util.nix { inherit (pkgs.haskell-nix) cabal-install; };
47+ util = import ./util.nix { cabal-install = pkgs.evalPackages.haskell-nix.cabal-install.${compiler-nix-name}; };
48
48
49 # Map the values in an association list over the withIfdInputs function.
49 # Map the values in an association list over the withIfdInputs function.
50 #
50 #
@@ -151,10 +151,10 @@ let
151
151
152 # All tests.
152 # All tests.
153 allTests = {
153 allTests = {
154− cabal-simple = callTest ./cabal-simple { inherit util; };
154+ cabal-simple = callTest ./cabal-simple { inherit util compiler-nix-name; };
155− cabal-simple-prof = callTest ./cabal-simple-prof { inherit util; };
155+ cabal-simple-prof = callTest ./cabal-simple-prof { inherit util compiler-nix-name; };
156− cabal-sublib = callTest ./cabal-sublib { inherit util; };
156+ cabal-sublib = callTest ./cabal-sublib { inherit util compiler-nix-name; };
157− cabal-22 = callTest ./cabal-22 { inherit util; };
157+ cabal-22 = callTest ./cabal-22 { inherit util compiler-nix-name; };
158 with-packages = callTest ./with-packages { inherit util; };
158 with-packages = callTest ./with-packages { inherit util; };
159 builder-haddock = callTest ./builder-haddock {};
159 builder-haddock = callTest ./builder-haddock {};
160 stack-simple = callTest ./stack-simple {};
160 stack-simple = callTest ./stack-simple {};
@@ -162,35 +162,33 @@ let
162 stack-remote-resolver = callTest ./stack-remote-resolver {};
162 stack-remote-resolver = callTest ./stack-remote-resolver {};
163 snapshots = callTest ./snapshots {};
163 snapshots = callTest ./snapshots {};
164 shell-for = callTest ./shell-for {};
164 shell-for = callTest ./shell-for {};
165− shell-for-setup-deps = callTest ./shell-for-setup-deps {};
165+ shell-for-setup-deps = callTest ./shell-for-setup-deps { inherit compiler-nix-name; };
166− setup-deps = import ./setup-deps { inherit pkgs; };
166+ setup-deps = import ./setup-deps { inherit pkgs compiler-nix-name; };
167 callStackToNix = callTest ./call-stack-to-nix {};
167 callStackToNix = callTest ./call-stack-to-nix {};
168− callCabalProjectToNix = callTest ./call-cabal-project-to-nix {};
168+ callCabalProjectToNix = callTest ./call-cabal-project-to-nix { inherit compiler-nix-name; };
169− cabal-source-repo = callTest ./cabal-source-repo {};
169+ cabal-source-repo = callTest ./cabal-source-repo { inherit compiler-nix-name; };
170− buildable = callTest ./buildable {};
170+ buildable = callTest ./buildable { inherit compiler-nix-name; };
171− project-flags-cabal = callTest ./project-flags/cabal.nix {};
171+ project-flags-cabal = callTest ./project-flags/cabal.nix { inherit compiler-nix-name; };
172 project-flags-stack = callTest ./project-flags/stack.nix {};
172 project-flags-stack = callTest ./project-flags/stack.nix {};
173− ghc-options-cabal = callTest ./ghc-options/cabal.nix {};
173+ ghc-options-cabal = callTest ./ghc-options/cabal.nix { inherit compiler-nix-name; };
174 ghc-options-stack = callTest ./ghc-options/stack.nix {};
174 ghc-options-stack = callTest ./ghc-options/stack.nix {};
175− exe-only = callTest ./exe-only { inherit util; };
175+ exe-only = callTest ./exe-only { inherit util compiler-nix-name; };
176 stack-source-repo = callTest ./stack-source-repo {};
176 stack-source-repo = callTest ./stack-source-repo {};
177− extra-hackage = callTest ./extra-hackage {};
177+ extra-hackage = callTest ./extra-hackage { inherit compiler-nix-name; };
178 compiler-nix-name = callTest ./compiler-nix-name {};
178 compiler-nix-name = callTest ./compiler-nix-name {};
179− hls-cabal = callTest ./haskell-language-server/cabal.nix {};
179+ hls-cabal = callTest ./haskell-language-server/cabal.nix { inherit compiler-nix-name; };
180− hls-stack = callTest ./haskell-language-server/stack.nix {};
180+ hls-stack = callTest ./haskell-language-server/stack.nix { inherit compiler-nix-name; };
181+ cabal-hpack = callTest ./cabal-hpack { inherit util compiler-nix-name; };
182+ index-state = callTest ./index-state { inherit compiler-nix-name; };
181
183
182 unit = unitTests;
184 unit = unitTests;
183− } // lib.optionalAttrs (!stdenv.hostPlatform.isGhcjs && pkgs.haskell-nix.defaultCompilerNixName != "ghc8101" ) {
185+ } // lib.optionalAttrs (!stdenv.hostPlatform.isGhcjs && compiler-nix-name != "ghc8101" ) {
184 # Pandoc does not build with ghcjs or ghc 8.10.1 yet (lookup-sha256 and fully-static build pandoc)
186 # Pandoc does not build with ghcjs or ghc 8.10.1 yet (lookup-sha256 and fully-static build pandoc)
185− lookup-sha256 = callTest ./lookup-sha256 {};
187+ lookup-sha256 = callTest ./lookup-sha256 { inherit compiler-nix-name; };
186 fully-static = callTest ./fully-static { inherit (pkgs) buildPackages; };
188 fully-static = callTest ./fully-static { inherit (pkgs) buildPackages; };
187− } // lib.optionalAttrs (pkgs.haskell-nix.defaultCompilerNixName != "ghc8101") {
188− # This test makes a plan for building cabal 3.2 using index-states that will
189− # never work with ghc 8.10.1
190− index-state = callTest ./index-state {};
191 } // lib.optionalAttrs (!pkgs.haskell-nix.haskellLib.isCrossHost) {
189 } // lib.optionalAttrs (!pkgs.haskell-nix.haskellLib.isCrossHost) {
192 # Haddock is not included with cross compilers currently
190 # Haddock is not included with cross compilers currently
193− sublib-docs = callTest ./sublib-docs { inherit util; };
191+ sublib-docs = callTest ./sublib-docs { inherit util compiler-nix-name; };
194 };
192 };
195
193
196 # This is the same as allTests, but filter out all the key/vaules from the
194 # This is the same as allTests, but filter out all the key/vaules from the
@@ -218,7 +216,7 @@ let
218in
216in
219
217
220pkgs.recurseIntoAttrs {
218pkgs.recurseIntoAttrs {
221− haskellNixRoots = haskell-nix.haskellNixRoots' ifdLevel;
219+ roots = haskell-nix.roots' compiler-nix-name ifdLevel;
222} // optionalIfdTests ifdLevel
220} // optionalIfdTests ifdLevel
223
221
224## more possible test cases
222## more possible test cases
test/exe-only/default.nix+2−1
@@ -1,10 +1,11 @@
1# Test a package set
1# Test a package set
2−{ stdenv, util, haskell-nix, recurseIntoAttrs, haskellLib, testSrc }:
2+{ stdenv, util, haskell-nix, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
3
3
4with stdenv.lib;
4with stdenv.lib;
5
5
6let
6let
7 project = haskell-nix.cabalProject' {
7 project = haskell-nix.cabalProject' {
8+ inherit compiler-nix-name;
8 src = testSrc "exe-only";
9 src = testSrc "exe-only";
9 };
10 };
10
11
test/extra-hackage/default.nix+4−3
@@ -1,4 +1,4 @@
1−{ stdenv, cabalProject', haskellLib, recurseIntoAttrs, testSrc }:
1+{ stdenv, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
2
2
3with stdenv.lib;
3with stdenv.lib;
4
4
@@ -14,6 +14,7 @@ let
14 demo-src = ./external-package-demo-0.1.0.0.tar.gz;
14 demo-src = ./external-package-demo-0.1.0.0.tar.gz;
15
15
16 project = cabalProject' {
16 project = cabalProject' {
17+ inherit compiler-nix-name;
17 src = testSrc "extra-hackage/external-package-user";
18 src = testSrc "extra-hackage/external-package-user";
18
19
19 extra-hackages = [ hackage ];
20 extra-hackages = [ hackage ];
@@ -27,7 +28,7 @@ let
27 };
28 };
28 packages = project.hsPkgs;
29 packages = project.hsPkgs;
29
30
30−in project // (recurseIntoAttrs {
31+in recurseIntoAttrs {
31 ifdInputs = {
32 ifdInputs = {
32 inherit (project) plan-nix;
33 inherit (project) plan-nix;
33 };
34 };
@@ -66,4 +67,4 @@ in project // (recurseIntoAttrs {
66 inherit project;
67 inherit project;
67 };
68 };
68 };
69 };
69−})
70+}
test/fully-static/cross.nix+1−1
@@ -1,5 +1,5 @@
1{ pkgs ? import nixpkgs { }
1{ pkgs ? import nixpkgs { }
2−, nixpkgs ? import (../../nixpkgs).nixpkgs-default
2+, nixpkgs ? import (../../nix/sources.nix).nixpkgs
3}:
3}:
4
4
5let
5let
test/ghc-options/cabal.nix+2−1
@@ -1,9 +1,10 @@
1−{ stdenv, cabalProject', recurseIntoAttrs, haskellLib, testSrc }:
1+{ stdenv, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
2
2
3with stdenv.lib;
3with stdenv.lib;
4
4
5let
5let
6 project = cabalProject' {
6 project = cabalProject' {
7+ inherit compiler-nix-name;
7 index-state = "2020-05-25T00:00:00Z";
8 index-state = "2020-05-25T00:00:00Z";
8 src = testSrc "ghc-options";
9 src = testSrc "ghc-options";
9 # TODO find a way to get the ghc-options into plan.json so we can use it in plan-to-nix
10 # TODO find a way to get the ghc-options into plan.json so we can use it in plan-to-nix
test/haskell-language-server/cabal.nix+2−1
@@ -1,6 +1,7 @@
1−{ testSrc, evalPackages, buildPackages }:
1+{ testSrc, evalPackages, buildPackages, compiler-nix-name }:
2
2
3(buildPackages.haskell-nix.project {
3(buildPackages.haskell-nix.project {
4+ inherit compiler-nix-name;
4 src = evalPackages.fetchgit {
5 src = evalPackages.fetchgit {
5 url = "https://github.com/haskell/haskell-language-server.git";
6 url = "https://github.com/haskell/haskell-language-server.git";
6 fetchSubmodules = true;
7 fetchSubmodules = true;
test/haskell-language-server/stack.nix+3−2
@@ -1,13 +1,14 @@
1−{ testSrc, haskell-nix, evalPackages, buildPackages }:
1+{ testSrc, haskell-nix, evalPackages, buildPackages, compiler-nix-name }:
2
2
3(buildPackages.haskell-nix.project {
3(buildPackages.haskell-nix.project {
4+ inherit compiler-nix-name;
4 src = evalPackages.fetchgit {
5 src = evalPackages.fetchgit {
5 url = "https://github.com/haskell/haskell-language-server.git";
6 url = "https://github.com/haskell/haskell-language-server.git";
6 fetchSubmodules = true;
7 fetchSubmodules = true;
7 rev = "d2654185eef1b0d703cebc694e85438e20600e37";
8 rev = "d2654185eef1b0d703cebc694e85438e20600e37";
8 sha256 = "0s0k2i0imkcn9zykhrlqq0r4ssv25mwbpdyc675xkzgl1vj1l8kd";
9 sha256 = "0s0k2i0imkcn9zykhrlqq0r4ssv25mwbpdyc675xkzgl1vj1l8kd";
9 };
10 };
10− projectFileName = "stack-${haskell-nix.ghc.version}.yaml";
11+ projectFileName = "stack-${haskell-nix.compiler.${compiler-nix-name}.version}.yaml";
11 sha256map = {
12 sha256map = {
12 "https://github.com/wz1000/shake.git"."fb3859dca2e54d1bbb2c873e68ed225fa179fbef" = "0sa0jiwgyvjsmjwpfcpvzg2p7277aa0dgra1mm6afh2rfnjphz8z";
13 "https://github.com/wz1000/shake.git"."fb3859dca2e54d1bbb2c873e68ed225fa179fbef" = "0sa0jiwgyvjsmjwpfcpvzg2p7277aa0dgra1mm6afh2rfnjphz8z";
13 "https://github.com/peti/cabal-plan.git"."894b76c0b6bf8f7d2f881431df1f13959a8fce87" = "06iklj51d9kh9bhc42lrayypcpgkjrjvna59w920ln41rskhjr4y";
14 "https://github.com/peti/cabal-plan.git"."894b76c0b6bf8f7d2f881431df1f13959a8fce87" = "06iklj51d9kh9bhc42lrayypcpgkjrjvna59w920ln41rskhjr4y";
test/index-state/default.nix+6−2
@@ -1,14 +1,18 @@
1# Test a package set
1# Test a package set
2−{ stdenv, testSrc, tool }:
2+{ stdenv, testSrc, tool, compiler-nix-name }:
3
3
4with stdenv.lib;
4with stdenv.lib;
5
5
6let
6let
7 # The hackage-security 0.6.0.1 was uploaded at 2020-04-06T20:54:35Z
7 # The hackage-security 0.6.0.1 was uploaded at 2020-04-06T20:54:35Z
8 # See https://hackage.haskell.org/package/hackage-security-0.6.0.1
8 # See https://hackage.haskell.org/package/hackage-security-0.6.0.1
9− version-used-at = index-state: (tool "cabal" {
9+ version-used-at = index-state: (tool compiler-nix-name "cabal" {
10 version = "3.2.0.0";
10 version = "3.2.0.0";
11 inherit index-state;
11 inherit index-state;
12+ cabalProject = ''
13+ packages: .
14+ allow-newer: cabal-install:base, hackage-security:*
15+ '';
12 }).project.hsPkgs.hackage-security.components.library.version;
16 }).project.hsPkgs.hackage-security.components.library.version;
13 version-before = version-used-at "2020-04-06T20:54:34Z";
17 version-before = version-used-at "2020-04-06T20:54:34Z";
14 version-after = version-used-at "2020-04-06T20:54:35Z";
18 version-after = version-used-at "2020-04-06T20:54:35Z";
test/lookup-sha256/default.nix+2−1
@@ -1,5 +1,6 @@
1−{ pkgs, lib, stdenv, haskell-nix, testSrc, zlib } :
1+{ pkgs, lib, stdenv, haskell-nix, testSrc, zlib, compiler-nix-name } :
2 (haskell-nix.hackage-package {
2 (haskell-nix.hackage-package {
3+ inherit compiler-nix-name;
3 name = "pandoc";
4 name = "pandoc";
4 version = "2.9.2.1";
5 version = "2.9.2.1";
5 index-state = "2020-05-25T00:00:00Z";
6 index-state = "2020-05-25T00:00:00Z";
test/project-flags/cabal.nix+2−1
@@ -1,9 +1,10 @@
1−{ stdenv, cabalProject', recurseIntoAttrs, haskellLib, testSrc }:
1+{ stdenv, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
2
2
3with stdenv.lib;
3with stdenv.lib;
4
4
5let
5let
6 project = cabalProject' {
6 project = cabalProject' {
7+ inherit compiler-nix-name;
7 index-state = "2020-05-25T00:00:00Z";
8 index-state = "2020-05-25T00:00:00Z";
8 src = testSrc "project-flags";
9 src = testSrc "project-flags";
9 };
10 };
test/regen.nix+1−1
@@ -3,7 +3,7 @@ let
3 haskellNix = (import ../default.nix {});
3 haskellNix = (import ../default.nix {});
4in
4in
5{ pkgs ? import nixpkgs nixpkgsArgs
5{ pkgs ? import nixpkgs nixpkgsArgs
6−, nixpkgs ? haskellNix.sources.nixpkgs-default
6+, nixpkgs ? haskellNix.sources.nixpkgs
7, nixpkgsArgs ? haskellNix.nixpkgsArgs
7, nixpkgsArgs ? haskellNix.nixpkgsArgs
8}:
8}:
9
9
test/setup-deps/default.nix+2−1
@@ -1,10 +1,11 @@
1−{ pkgs }:
1+{ pkgs, compiler-nix-name }:
2
2
3with pkgs;
3with pkgs;
4with stdenv.lib;
4with stdenv.lib;
5
5
6let
6let
7 project = haskell-nix.cabalProject' {
7 project = haskell-nix.cabalProject' {
8+ inherit compiler-nix-name;
8 src = pkgs.haskell-nix.haskellLib.cleanGit { src = ../..; name = "setup-deps"; subDir = "test/setup-deps"; };
9 src = pkgs.haskell-nix.haskellLib.cleanGit { src = ../..; name = "setup-deps"; subDir = "test/setup-deps"; };
9 modules = [{
10 modules = [{
10 # Package has no exposed modules which causes
11 # Package has no exposed modules which causes
test/shell-for-setup-deps/default.nix+2−1
@@ -1,9 +1,10 @@
1−{ stdenv, cabal-install, cabalProject', recurseIntoAttrs, runCommand, testSrc }:
1+{ stdenv, cabal-install, cabalProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name }:
2
2
3with stdenv.lib;
3with stdenv.lib;
4
4
5let
5let
6 project = cabalProject' {
6 project = cabalProject' {
7+ inherit compiler-nix-name;
7 src = testSrc "shell-for-setup-deps";
8 src = testSrc "shell-for-setup-deps";
8 modules = [{
9 modules = [{
9 # Package has no exposed modules which causes
10 # Package has no exposed modules which causes
test/shell-for/default.nix+3−3
@@ -22,7 +22,7 @@ let
22 packages = ps: with ps; [ pkga pkgb ];
22 packages = ps: with ps; [ pkga pkgb ];
23 # This adds cabal-install to the shell, which helps tests because
23 # This adds cabal-install to the shell, which helps tests because
24 # they use a nix-shell --pure. Normally you would BYO cabal-install.
24 # they use a nix-shell --pure. Normally you would BYO cabal-install.
25− buildInputs = [ cabal-install ];
25+ tools = { cabal = "3.2.0.0"; };
26 exactDeps = true;
26 exactDeps = true;
27 };
27 };
28
28
@@ -31,7 +31,7 @@ let
31 packages = ps: with ps; [ pkga ];
31 packages = ps: with ps; [ pkga ];
32 # This adds cabal-install to the shell, which helps tests because
32 # This adds cabal-install to the shell, which helps tests because
33 # they use a nix-shell --pure. Normally you would BYO cabal-install.
33 # they use a nix-shell --pure. Normally you would BYO cabal-install.
34− buildInputs = [ cabal-install ];
34+ tools = { cabal = "3.2.0.0"; };
35 exactDeps = true;
35 exactDeps = true;
36 };
36 };
37
37
@@ -41,7 +41,7 @@ let
41 # packages = ps: with ps; [ pkga pkgb ];
41 # packages = ps: with ps; [ pkga pkgb ];
42 # This adds cabal-install to the shell, which helps tests because
42 # This adds cabal-install to the shell, which helps tests because
43 # they use a nix-shell --pure. Normally you would BYO cabal-install.
43 # they use a nix-shell --pure. Normally you would BYO cabal-install.
44− buildInputs = [ cabal-install ];
44+ tools = { cabal = "3.2.0.0"; };
45 };
45 };
46
46
47in recurseIntoAttrs (if stdenv.hostPlatform.isWindows
47in recurseIntoAttrs (if stdenv.hostPlatform.isWindows
test/sublib-docs/default.nix+2−1
@@ -1,10 +1,11 @@
1# Test a package set
1# Test a package set
2−{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc }:
2+{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
3
3
4with stdenv.lib;
4with stdenv.lib;
5
5
6let
6let
7 project = cabalProject' {
7 project = cabalProject' {
8+ inherit compiler-nix-name;
8 src = testSrc "sublib-docs";
9 src = testSrc "sublib-docs";
9 };
10 };
10
11
test/tests.sh+25−9
@@ -7,6 +7,13 @@ NIX_BUILD_ARGS="${NIX_BUILD_ARGS:-}"
7
7
8cd $(dirname $0)
8cd $(dirname $0)
9
9
10+if [ "$#" != "1" ]; then
11+ echo "Please pass a compiler-nix-name to use. For example: ./test/test.sh ghc883"
12+ exit 1
13+fi
14+
15+GHC=$1
16+
10printf "*** Cleaning package build directories..." >& 2
17printf "*** Cleaning package build directories..." >& 2
11rm -rvf */cabal.project.local */.ghc.environment* */dist */dist-newstyle */.stack-work
18rm -rvf */cabal.project.local */.ghc.environment* */dist */dist-newstyle */.stack-work
12echo >& 2
19echo >& 2
@@ -16,11 +23,12 @@ nix build $NIX_BUILD_ARGS \
16 -I . -I .. \
23 -I . -I .. \
17 --option restrict-eval true \
24 --option restrict-eval true \
18 --option allowed-uris "https://github.com/NixOS https://github.com/input-output-hk" \
25 --option allowed-uris "https://github.com/NixOS https://github.com/input-output-hk" \
19− --no-link --keep-going -f default.nix
26+ --no-link --keep-going -f default.nix \
27+ --argstr compiler-nix-name $GHC
20echo >& 2
28echo >& 2
21
29
22printf "*** Running the unit tests... " >& 2
30printf "*** Running the unit tests... " >& 2
23−res=$(nix-instantiate --eval --json --strict ./default.nix -A unit.tests)
31+res=$(nix-instantiate --eval --json --strict ./default.nix --argstr compiler-nix-name $GHC -A unit.tests)
24num_failed=$(jq length <<< "$res")
32num_failed=$(jq length <<< "$res")
25if [ $num_failed -eq 0 ]; then
33if [ $num_failed -eq 0 ]; then
26 printf "PASSED\n" >& 2
34 printf "PASSED\n" >& 2
@@ -33,6 +41,7 @@ fi
33printf "*** Checking that a nix-shell works for runghc...\n" >& 2
41printf "*** Checking that a nix-shell works for runghc...\n" >& 2
34nix-shell $NIX_BUILD_ARGS \
42nix-shell $NIX_BUILD_ARGS \
35 --pure ./default.nix \
43 --pure ./default.nix \
44+ --argstr compiler-nix-name $GHC \
36 -A with-packages.test-shell \
45 -A with-packages.test-shell \
37 --run 'runghc with-packages/Point.hs'
46 --run 'runghc with-packages/Point.hs'
38echo >& 2
47echo >& 2
@@ -40,6 +49,7 @@ echo >& 2
40printf "*** Checking that a nix-shell works for cabal...\n" >& 2
49printf "*** Checking that a nix-shell works for cabal...\n" >& 2
41nix-shell $NIX_BUILD_ARGS \
50nix-shell $NIX_BUILD_ARGS \
42 --pure ./default.nix \
51 --pure ./default.nix \
52+ --argstr compiler-nix-name $GHC \
43 -A with-packages.test-shell \
53 -A with-packages.test-shell \
44 --run 'echo CABAL_CONFIG=$CABAL_CONFIG && type -p ghc && cd with-packages && cabal new-build'
54 --run 'echo CABAL_CONFIG=$CABAL_CONFIG && type -p ghc && cd with-packages && cabal new-build'
45echo >& 2
55echo >& 2
@@ -47,6 +57,7 @@ echo >& 2
47printf "*** Checking that a nix-shell works for cabal (doExactConfig component)...\n" >& 2
57printf "*** Checking that a nix-shell works for cabal (doExactConfig component)...\n" >& 2
48nix-shell $NIX_BUILD_ARGS \
58nix-shell $NIX_BUILD_ARGS \
49 --pure ./default.nix \
59 --pure ./default.nix \
60+ --argstr compiler-nix-name $GHC \
50 -A with-packages.test-shell-dec \
61 -A with-packages.test-shell-dec \
51 --run 'echo CABAL_CONFIG=$CABAL_CONFIG && echo GHC_ENVIRONMENT=$GHC_ENVIRONMENT && cd with-packages && cabal new-build'
62 --run 'echo CABAL_CONFIG=$CABAL_CONFIG && echo GHC_ENVIRONMENT=$GHC_ENVIRONMENT && cd with-packages && cabal new-build'
52echo >& 2
63echo >& 2
@@ -55,6 +66,7 @@ printf "*** Checking that a nix-shell works for a project with test-suite build-
55printf "!!! This is expected to fail until https://github.com/input-output-hk/haskell.nix/issues/231 is resolved! \n" >& 2
66printf "!!! This is expected to fail until https://github.com/input-output-hk/haskell.nix/issues/231 is resolved! \n" >& 2
56nix-shell $NIX_BUILD_ARGS \
67nix-shell $NIX_BUILD_ARGS \
57 --pure ./default.nix \
68 --pure ./default.nix \
69+ --argstr compiler-nix-name $GHC \
58 -A cabal-22.shell \
70 -A cabal-22.shell \
59 --run 'cd cabal-22 && cabal new-build all --enable-tests --enable-benchmarks' \
71 --run 'cd cabal-22 && cabal new-build all --enable-tests --enable-benchmarks' \
60 || true
72 || true
@@ -63,6 +75,7 @@ echo >& 2
63printf "*** Checking that a nix-shell works for a multi-target project...\n" >& 2
75printf "*** Checking that a nix-shell works for a multi-target project...\n" >& 2
64nix-shell $NIX_BUILD_ARGS \
76nix-shell $NIX_BUILD_ARGS \
65 --pure ./default.nix \
77 --pure ./default.nix \
78+ --argstr compiler-nix-name $GHC \
66 -A cabal-simple.test-shell \
79 -A cabal-simple.test-shell \
67 --run 'cd cabal-simple && cabal new-build'
80 --run 'cd cabal-simple && cabal new-build'
68echo >& 2
81echo >& 2
@@ -70,6 +83,7 @@ echo >& 2
70printf "*** Checking shellFor works for a cabal project, multiple packages...\n" >& 2
83printf "*** Checking shellFor works for a cabal project, multiple packages...\n" >& 2
71nix-shell $NIX_BUILD_ARGS \
84nix-shell $NIX_BUILD_ARGS \
72 --pure ./default.nix \
85 --pure ./default.nix \
86+ --argstr compiler-nix-name $GHC \
73 -A shell-for.env \
87 -A shell-for.env \
74 --run 'cd shell-for && cabal new-build all'
88 --run 'cd shell-for && cabal new-build all'
75echo >& 2
89echo >& 2
@@ -77,6 +91,7 @@ echo >& 2
77printf "*** Checking shellFor works for a cabal project, single package...\n" >& 2
91printf "*** Checking shellFor works for a cabal project, single package...\n" >& 2
78nix-shell $NIX_BUILD_ARGS \
92nix-shell $NIX_BUILD_ARGS \
79 --pure ./default.nix \
93 --pure ./default.nix \
94+ --argstr compiler-nix-name $GHC \
80 -A shell-for.envPkga \
95 -A shell-for.envPkga \
81 --run 'cd shell-for && cabal new-build --project=single.project all'
96 --run 'cd shell-for && cabal new-build --project=single.project all'
82echo >& 2
97echo >& 2
@@ -84,14 +99,15 @@ echo >& 2
84printf "*** Checking shellFor has a working hoogle index...\n" >& 2
99printf "*** Checking shellFor has a working hoogle index...\n" >& 2
85nix-shell $NIX_BUILD_ARGS \
100nix-shell $NIX_BUILD_ARGS \
86 --pure ./default.nix \
101 --pure ./default.nix \
102+ --argstr compiler-nix-name $GHC \
87 -A shell-for.env \
103 -A shell-for.env \
88 --run 'hoogle ConduitT | grep Data.Conduit'
104 --run 'hoogle ConduitT | grep Data.Conduit'
89echo >& 2
105echo >& 2
90
106
91printf "*** Checking shellFor does not depend on given packages...\n" >& 2
107printf "*** Checking shellFor does not depend on given packages...\n" >& 2
92−drva=$(nix-instantiate ./default.nix -A shell-for.env)
108+drva=$(nix-instantiate ./default.nix --argstr compiler-nix-name $GHC -A shell-for.env)
93echo "-- hello" >> shell-for/pkga/PkgA.hs
109echo "-- hello" >> shell-for/pkga/PkgA.hs
94−drvb=$(nix-instantiate ./default.nix -A shell-for.env)
110+drvb=$(nix-instantiate ./default.nix --argstr compiler-nix-name $GHC -A shell-for.env)
95sed -i -e '/-- hello/d' shell-for/pkga/PkgA.hs
111sed -i -e '/-- hello/d' shell-for/pkga/PkgA.hs
96if [ "$drva" != "$drvb" ]; then
112if [ "$drva" != "$drvb" ]; then
97 printf "FAIL\nShell derivations\n$drva\n$drvb\n are not identical.\n" >& 2
113 printf "FAIL\nShell derivations\n$drva\n$drvb\n are not identical.\n" >& 2
@@ -101,19 +117,19 @@ else
101fi
117fi
102
118
103printf "*** Checking the maintainer scripts...\n" >& 2
119printf "*** Checking the maintainer scripts...\n" >& 2
104−nix build $NIX_BUILD_ARGS --no-link --keep-going -f ../build.nix maintainer-scripts
120+nix build $NIX_BUILD_ARGS --no-link --keep-going -f ../build.nix --argstr compiler-nix-name $GHC maintainer-scripts
105echo >& 2
121echo >& 2
106
122
107printf "*** Checking that plan construction works with extra Hackages...\n" >& 2
123printf "*** Checking that plan construction works with extra Hackages...\n" >& 2
108nix build $NIX_BUILD_ARGS --no-link \
124nix build $NIX_BUILD_ARGS --no-link \
109− -f ./default.nix \
125+ -f ./default.nix --argstr compiler-nix-name $GHC \
110− extra-hackage.plan-nix
126+ extra-hackage.run.project.plan-nix
111echo >& 2
127echo >& 2
112
128
113printf "*** Checking that package with extra Hackages can be build...\n" >& 2
129printf "*** Checking that package with extra Hackages can be build...\n" >& 2
114nix build $NIX_BUILD_ARGS --no-link \
130nix build $NIX_BUILD_ARGS --no-link \
115− -f ./default.nix \
131+ -f ./default.nix --argstr compiler-nix-name $GHC \
116− extra-hackage.hsPkgs.external-package-user.components.all
132+ extra-hackage.run.project.hsPkgs.external-package-user.components.all
117echo >& 2
133echo >& 2
118
134
119printf "\n*** Finished successfully\n" >& 2
135printf "\n*** Finished successfully\n" >& 2