on iko/ghcjs-patch-master help sign in
Remove internal deps on default ghc and stackage (#738)

Changes to the interface of haskell.nix (from the changelog.md file): * Removed `sources.nixpkgs-default`, use `sources.nixpkgs` instead. * Removed `./nixpkgs` directory, use `(import ./. {}).sources` or `./nix/sources.nix` instead. * Removes V1 interface for details on how to fix old code see: https://github.com/input-output-hk/haskell.nix/issues/709 * Removed defaultCompilerNixName. * cabalProject, cabalProject', hackage-project and hackage-package now require a `compiler-nix-name` argument. * `haskell-nix.tool` and `.tools` now require a `compiler-nix-name` argument. New functions `p.tool` and `p.tools` (where p is a project) do not. Like `shellFor { tools = ... }` they will use the compiler nix name from the project (including stack projects where it is derived from the resolver). * `haskell-nix.alex` and `haskell-nix.happy` have been removed. Use `p.tool "alex" "3.2.5"` or `shellFor { tools = { alex = "3.2.5"; } }`. * `haskell-nix.nix-tools` -> `haskell-nix.nix-tools.ghc883` (it includes the hpack exe now). * `haskell-nix.cabal-install` -> `p.tool "cabal" "3.2.0.0"` or `shellFor { tools = { cabal = "3.2.0.0"; } }` * `haskell-nix.haskellNixRoots` -> `haskell-nix.roots ghc883` or `p.roots` Other changes: Adds hpack executable to the nix-tools derivations. Adds a `cabal-hpack` test to make sure `hpack` works with `cabalProject`. Reduces the number of calls to `cabalProject` (particularly when checking materialization), by giving internal tools a per-compiler attribute. Uses happy 1.19.12 when building newer ghc versions. Updates cabal-install 3.2.0.0 to use the source from github that is compatible with ghc 8.10.1. Updates the docs for callCabalProjectToNix. Adds a license mapping to fix a common warning.

commit4cac8bd00f4c70079a92adf9e341fde86c375e2a authorHamish Mackenzie <Hamish.Mackenzie@iohk.io> dateWed 8 Jul 2020, 22:54 (6 years ago) parent33445e4
84 files changed+630−1509
.buildkite/pipeline.yml+5−5 build.nix+25−14 builder/default.nix+3−4 builder/shell-for.nix+2−2 changelog.md+22 ci-lib.nix+1−1 ci.nix+17−17 default.nix+27−55 docs/reference/library.md+16−13 docs/troubleshooting.md+2−1 docs/tutorials/getting-started.md+2 docs/tutorials/materialization.md+14−7 examples/cardano-sl-mingw32.nix+1−1 examples/cardano-sl.nix+1−1 examples/cardano-wallet-ghcjs.nix+1−1 examples/cardano-wallet-mingw32.nix+1−1 examples/cardano-wallet-rpi.nix+1−1 examples/cardano-wallet.nix+1−1 examples/plutus-mingw32.nix+1−1 examples/plutus.nix+1−1 flake.nix+1−1 lib/cabal-licenses.nix+1 lib/call-cabal-project-to-nix.nix+7−9 lib/call-stack-to-nix.nix+2−1 lib/stack-cache-generator.nix+2−1 materialized/ghc8101/happy/.plan.nix/happy.nix → materialized/bootstrap/ghc844/happy-1.19.12/.plan.nix/happy.nix materialized/ghc865/happy/default.nix → materialized/bootstrap/ghc844/happy-1.19.12/default.nix+20−20 materialized/ghc-extra-projects/cross/ghc865/.plan.nix/ghc.nix+1 materialized/ghc-extra-projects/cross/ghc865/default.nix+1 materialized/ghc-extra-projects/default/ghc865/.plan.nix/ghc.nix+1 materialized/ghc-extra-projects/default/ghc865/default.nix+1 materialized/ghc-extra-projects/windows/ghc865/.plan.nix/ghc.nix+1 materialized/ghc-extra-projects/windows/ghc865/default.nix+1 materialized/ghc8101/alex/.plan.nix/alex.nix−160 materialized/ghc8101/alex/default.nix−49 materialized/ghc8101/cabal-install/default.nix+1−1 materialized/ghc8101/happy/default.nix−53 materialized/ghc865/alex/.plan.nix/alex.nix−160 materialized/ghc865/alex/default.nix−49 materialized/ghc865/happy/.plan.nix/happy.nix−200 materialized/ghc883/alex/.plan.nix/alex.nix−160 materialized/ghc883/alex/default.nix−49 materialized/ghc883/happy/.plan.nix/happy.nix−200 materialized/ghc883/happy/default.nix−53 modules/component-driver.nix+1−1 nix-tools/regenerate.nix+2−1 nix/sources.json+19−1 nixpkgs/default.nix−4 overlays/bootstrap.nix+104−84 overlays/eval-on-current.nix+3−3 overlays/ghc-packages.nix+8−8 overlays/hackage-quirks.nix+14 overlays/haskell.nix+55−33 overlays/tools.nix+22−12 release.nix+1−1 scripts/check-path-support.nix+2−2 shell.nix+1−1 test/buildable/default.nix+2−1 test/cabal-22/default.nix+2−1 test/cabal-hpack/Setup.hs+2 test/cabal-hpack/app/Main.hs+4 test/cabal-hpack/default.nix+74 test/cabal-hpack/package.yaml+34 test/cabal-simple-prof/default.nix+2−1 test/cabal-simple/default.nix+2−1 test/cabal-source-repo/default.nix+2−1 test/cabal-sublib/default.nix+2−1 test/call-cabal-project-to-nix/default.nix+2−1 test/default.nix+27−29 test/exe-only/default.nix+2−1 test/extra-hackage/default.nix+4−3 test/fully-static/cross.nix+1−1 test/ghc-options/cabal.nix+2−1 test/haskell-language-server/cabal.nix+2−1 test/haskell-language-server/stack.nix+3−2 test/index-state/default.nix+6−2 test/lookup-sha256/default.nix+2−1 test/project-flags/cabal.nix+2−1 test/regen.nix+1−1 test/setup-deps/default.nix+2−1 test/shell-for-setup-deps/default.nix+2−1 test/shell-for/default.nix+3−3 test/sublib-docs/default.nix+2−1 test/tests.sh+25−9
.buildkite/pipeline.yml+5−5
@@ -1,6 +1,6 @@
11steps:
2− - label: 'Run tests'
3− command: "./test/tests.sh"
2+ - label: 'Run tests with ghc883'
3+ command: "./test/tests.sh ghc883"
44 agents:
55 system: x86_64-linux
66
@@ -14,9 +14,9 @@ steps:
1414 agents:
1515 system: x86_64-linux
1616
17− - label: 'Check closure size'
17+ - label: 'Check closure size with ghc883'
1818 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
2020 - echo "+++ Closure size (MB)"
2121 - ./check-closure-size.sh
2222 agents:
@@ -36,5 +36,5 @@ steps:
3636
3737 - label: 'Make sure non store paths like can be used as src'
3838 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
4040 - ./check-path-support.sh
build.nix+25−14
@@ -5,10 +5,11 @@
55let
66 haskellNix = (import ./default.nix {});
77in
8−{ nixpkgs ? haskellNix.sources.nixpkgs-default
8+{ nixpkgs ? haskellNix.sources.nixpkgs
99, nixpkgsArgs ? haskellNix.nixpkgsArgs
1010, pkgs ? import nixpkgs nixpkgsArgs
1111, ifdLevel ? 1000
12+, compiler-nix-name ? throw "No `compiler-nix-name` passed to build.nix"
1213}:
1314
1415let
@@ -16,16 +17,14 @@ let
1617 buildHaskell = pkgs.buildPackages.haskell-nix;
1718 tool = buildHaskell.tool;
1819in rec {
19− tests = import ./test/default.nix { inherit pkgs ifdLevel; };
20+ tests = import ./test/default.nix { inherit pkgs ifdLevel compiler-nix-name; };
2021
2122 tools = pkgs.lib.optionalAttrs (ifdLevel >= 3) (
2223 pkgs.recurseIntoAttrs {
23− ghcide-020 = tool "ghcide" "0.2.0";
24− } // pkgs.lib.optionalAttrs (buildHaskell.defaultCompilerNixName == "ghc865") {
25− cabal-30 = tool "cabal" "3.0.0.0";
26− } // pkgs.lib.optionalAttrs (buildHaskell.defaultCompilerNixName != "ghc8101") {
27− cabal-32 = tool "cabal" "3.2.0.0";
28− ghcide-object-code = tool "ghcide" "object-code";
24+ ghcide-020 = tool compiler-nix-name "ghcide" "0.2.0";
25+ cabal-32 = tool compiler-nix-name "cabal" "3.2.0.0";
26+ } // pkgs.lib.optionalAttrs (compiler-nix-name != "ghc8101") {
27+ ghcide-object-code = tool compiler-nix-name "ghcide" "object-code";
2928 }
3029 );
3130
@@ -34,8 +33,21 @@ in rec {
3433 # as not all of them can work in restricted eval mode (as they
3534 # are not pure).
3635 maintainer-scripts = pkgs.dontRecurseIntoAttrs {
37− update-hackage = haskell.callPackage ./scripts/update-hackage.nix {};
38− update-stackage = haskell.callPackage ./scripts/update-stackage.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+ };
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+ };
3951 update-pins = haskell.callPackage ./scripts/update-pins.nix {};
4052 update-docs = pkgs.buildPackages.callPackage ./scripts/update-docs.nix {
4153 generatedOptions = pkgs.callPackage ./scripts/options-doc.nix { };
@@ -47,11 +59,10 @@ in rec {
4759 # use)
4860 check-hydra = pkgs.buildPackages.callPackage ./scripts/check-hydra.nix {};
4961 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.
5163 nix-tools = pkgs.linkFarm "common-tools" [
52− { name = "nix-tools"; path = haskell.nix-tools; }
53− { name = "cabal-install"; path = haskell.cabal-install; }
54− { name = "hpack"; path = haskell.haskellPackages.hpack.components.exes.hpack; }
64+ { name = "nix-tools"; path = haskell.nix-tools.${compiler-nix-name}; }
65+ { name = "cabal-install"; path = haskell.cabal-install.${compiler-nix-name}; }
5566 ];
5667 };
5768 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 }:
22
33let
44 # Builds a single component of a package.
@@ -44,7 +44,7 @@ let
4444
4545 hoogleLocal = let
4646 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" {
4848 version = "5.0.17.15";
4949 index-state = pkgs.haskell-nix.internalHackageIndexState;
5050 }
@@ -59,9 +59,8 @@ let
5959
6060 # Same as haskellPackages.shellFor in nixpkgs.
6161 shellFor = haskellLib.weakCallPackage pkgs ./shell-for.nix {
62− inherit hsPkgs ghcForComponent makeConfigFiles hoogleLocal haskellLib buildPackages;
62+ inherit hsPkgs ghcForComponent makeConfigFiles hoogleLocal haskellLib buildPackages compiler;
6363 inherit (buildPackages) glibcLocales;
64− buildGHC = ghc.passthru.buildGHC or ghc;
6564 };
6665
6766 # 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 }:
22
33{ packages ? ps:
44 let
@@ -94,7 +94,7 @@ in
9494 nativeBuildInputs = [ ghcEnv ]
9595 ++ nativeBuildInputs
9696 ++ mkDrvArgs.nativeBuildInputs or []
97− ++ lib.attrValues (buildPackages.haskell-nix.toolsForGhc buildGHC tools);
97+ ++ lib.attrValues (buildPackages.haskell-nix.tools compiler.nix-name tools);
9898 phases = ["installPhase"];
9999 installPhase = "echo $nativeBuildInputs $buildInputs > $out";
100100 LANG = "en_US.UTF-8";
changelog.md+22
@@ -1,6 +1,28 @@
11This file contains a summary of changes to Haskell.nix and `nix-tools`
22that will impact users.
33
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+
426## June 25, 2019
527* Haddock docs are now built in their own derivation when needed (not as part
628 of the component build).
ci-lib.nix+1−1
@@ -1,6 +1,6 @@
11let
22 # 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 {};
44 lib = pkgs.lib;
55in rec {
66 inherit (import ./dimension.nix) dimension;
ci.nix+17−17
@@ -12,8 +12,8 @@
1212 "R1909" = "nixpkgs-1909";
1313 "R2003" = "nixpkgs-2003";
1414 };
15− compilerNixNames = nixpkgsName: nixpkgs: builtins.mapAttrs (defaultCompilerNixName: _:
16− (import ./default.nix { inherit checkMaterialization defaultCompilerNixName; }).nixpkgsArgs) ({
15+ compilerNixNames = nixpkgsName: nixpkgs: builtins.mapAttrs (compiler-nix-name: _:
16+ (import ./default.nix { inherit checkMaterialization; }).nixpkgsArgs) ({
1717 ghc865 = {};
1818 } // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2003") {
1919 ghc883 = {};
@@ -24,11 +24,11 @@
2424 linux = "x86_64-linux";
2525 darwin = "x86_64-darwin";
2626 };
27− crossSystems = nixpkgsName: nixpkgs: compilerNixName: system:
27+ crossSystems = nixpkgsName: nixpkgs: compiler-nix-name: system:
2828 # We need to use the actual nixpkgs version we're working with here, since the values
2929 # of 'lib.systems.examples' are not understood between all versions
3030 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") {
3232 # Windows cross compilation is currently broken on macOS
3333 inherit (lib.systems.examples) mingwW64;
3434 } // lib.optionalAttrs (system == "x86_64-linux") {
@@ -41,32 +41,32 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
4141 let pinnedNixpkgsSrc = sources.${nixpkgs-pin};
4242 # We need this for generic nixpkgs stuff at the right version
4343 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:
4545 dimension "System" (systems genericPkgs) (systemName: system:
4646 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; };
4848 platformFilter = platformFilterGeneric pkgs system;
4949 in filterAttrsOnlyRecursive (_: v: platformFilter v) {
5050 # Native builds
5151 # TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
5252 native = pkgs.recurseIntoAttrs ({
5353 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}";
5555 } // 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;
5757 } // 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;
5959 });
6060 }
6161 //
62− dimension "Cross system" (crossSystems nixpkgsName genericPkgs compilerNixName system) (crossSystemName: crossSystem:
62+ dimension "Cross system" (crossSystems nixpkgsName genericPkgs compiler-nix-name system) (crossSystemName: crossSystem:
6363 # Cross builds
6464 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; };
6666 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}";
6868 # TODO: look into cross compiling ghc itself
69− # ghc = pkgs.haskell-nix.compiler."${compilerNixName}";
69+ # ghc = pkgs.haskell-nix.compiler."${compiler-nix-name}";
7070 # TODO: look into making tools work when cross compiling
7171 # inherit (build) tools;
7272 # 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:
7575 then build.tests
7676 else pkgs.recurseIntoAttrs {
7777 # Even on aarch64 we still want to build the pinned files
78− inherit (build.tests) haskellNixRoots;
78+ inherit (build.tests) roots;
7979 };
8080 } // pkgs.lib.optionalAttrs (ifdLevel >= 2) {
81− remote-iserv = pkgs.ghc-extra-packages."${compilerNixName}".remote-iserv.components.exes.remote-iserv;
82− iserv-proxy = pkgs.ghc-extra-packages."${compilerNixName}".iserv-proxy.components.exes.iserv-proxy;
81+ remote-iserv = pkgs.ghc-extra-packages."${compiler-nix-name}".remote-iserv.components.exes.remote-iserv;
82+ iserv-proxy = pkgs.ghc-extra-packages."${compiler-nix-name}".iserv-proxy.components.exes.iserv-proxy;
8383 } // 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;
8585 })
8686 )
8787 )
default.nix+27−55
@@ -1,56 +1,28 @@
1−let haskellNix = {
2− 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,
5− sourcesOverride ? {},
6− ... }@args: rec {
7− sources = (import ./nix/sources.nix) // sourcesOverride;
8−
9− config = import ./config.nix;
10− overlays = [ allOverlays.combined ] ++ (
11− if checkMaterialization == true
12− then [(
13− final: prev: {
14− haskell-nix = prev.haskell-nix // {
15− checkMaterialization = true;
16− };
17− }
18− )]
19− else []
20− ) ++ (
21− if defaultCompilerNixName != null
22− then [(
23− final: prev: {
24− haskell-nix = prev.haskell-nix // {
25− inherit defaultCompilerNixName;
26− };
27− }
28− )]
29− else []
30− );
31− allOverlays = import ./overlays args;
32− nixpkgsArgs = { inherit config overlays system; };
33− pkgs = import sources.nixpkgs-default 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));
1+{ checkMaterialization ? false # Allows us to easily switch on materialization checking
2+, system ? builtins.currentSystem
3+, sourcesOverride ? {}
4+, ... }@args: rec {
5+ sources = (import ./nix/sources.nix) // sourcesOverride;
6+ config = import ./config.nix;
7+ overlays = [ allOverlays.combined ] ++ (
8+ if checkMaterialization == true
9+ then [(
10+ final: prev: {
11+ haskell-nix = prev.haskell-nix // {
12+ checkMaterialization = true;
13+ };
14+ }
15+ )]
16+ else []
17+ ) ++ [(
18+ final: prev: {
19+ haskell-nix = prev.haskell-nix // {
20+ inherit overlays;
21+ sources = prev.haskell-nix.sources // sourcesOverride;
22+ };
23+ }
24+ )];
25+ allOverlays = import ./overlays args;
26+ nixpkgsArgs = { inherit config overlays system; };
27+ pkgs = import sources.nixpkgs nixpkgsArgs;
5628}
docs/reference/library.md+16−13
@@ -266,19 +266,22 @@ needed for `importAndFilterProject`.
266266 })).pkgs;
267267```
268268
269−| Argument | Type | Description |
270−|------------------|------|---------------------|
271−| `name` | String | Optional name for better error messages. |
272−| `src` | Path | Location of the cabal project files. |
273−| `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−| `plan-sha256` | Sha256 | Optional hash of the plan-to-nix output (makes the plan-to-nix step a fixed output derivation). |
276−| `cabalProject` | Path | Optional cabal project file (defaults to "${src}/cabal.project"). |
277−| `ghc` | | Optional ghc to use |
278−| `nix-tools` | | Optional nix-tools to use |
279−| `hpack` | | Optional hpack to use |
280−| `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). |
269+| Argument | Type | Description |
270+|----------------------|------|---------------------|
271+| `name` | String | Optional name for better error messages. |
272+| `src` | Path | Location of the cabal project files. |
273+| `compiler-nix-name` | String | The name of the ghc compiler to use eg. "ghc883" |
274+| `index-state` | Timestamp | Optional hackage index-state, eg. "2019-10-10T00:00:00Z". |
275+| `index-sha256` | Sha256 | Optional hash of the truncated hackage index-state. |
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"). |
279+| `cabalProjectFreeze` | String | Optional cabal project file contents (defaults to readFile "${src}/cabal.project.freeze"). |
280+| `ghc` | | Deprecated. Use `compiler-nix-name` instead. Optional ghc to use |
281+| `nix-tools` | | Optional nix-tools to use |
282+| `hpack` | | Optional hpack to use |
283+| `cabal-install` | | Optional cabal-install to use |
284+| `configureArgs` | String | Optional extra arguments to pass to `cabal new-configure` (--enable-tests is included by default, include `--disable-tests` to override that). |
282285
283286## importAndFilterProject
284287
docs/troubleshooting.md+2−1
@@ -66,6 +66,7 @@ So this is expected, unfortunately.
6666
6767### How do I prevent the evaluation-time dependencies of my project from being garbage-collected?
6868
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.
7071So you can add that to the relevant GC root.
7172In 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`:
5252 name = "haskell-nix-project";
5353 src = ./.;
5454 };
55+ # For `cabal.project` based projects specify the GHC version to use.
56+ compiler-nix-name = "ghc883"; # Not used for `stack.yaml` based projects.
5557}
5658```
5759
docs/tutorials/materialization.md+14−7
@@ -40,8 +40,9 @@ file that looks like this:
4040
4141```nix
4242let inherit (import ./. {}) sources nixpkgsArgs;
43− pkgs = import sources.nixpkgs-default nixpkgsArgs;
43+ pkgs = import sources.nixpkgs nixpkgsArgs;
4444 hlint = pkgs.haskell-nix.hackage-package {
45+ compiler-nix-name = "ghc883";
4546 name = "hlint";
4647 version = "2.2.11";
4748 };
@@ -64,8 +65,9 @@ inputs. For cabal projects this means we must specify the
6465
6566```nix
6667let inherit (import ./. {}) sources nixpkgsArgs;
67− pkgs = import sources.nixpkgs-default nixpkgsArgs;
68+ pkgs = import sources.nixpkgs nixpkgsArgs;
6869 hlint = pkgs.haskell-nix.hackage-package {
70+ compiler-nix-name = "ghc883";
6971 name = "hlint";
7072 version = "2.2.11";
7173 index-state = "2020-04-15T00:00:00Z";
@@ -92,8 +94,9 @@ stack projects)
9294
9395```nix
9496let inherit (import ./. {}) sources nixpkgsArgs;
95− pkgs = import sources.nixpkgs-default nixpkgsArgs;
97+ pkgs = import sources.nixpkgs nixpkgsArgs;
9698 hlint = pkgs.haskell-nix.hackage-package {
99+ compiler-nix-name = "ghc883";
97100 name = "hlint";
98101 version = "2.2.11";
99102 index-state = "2020-04-15T00:00:00Z";
@@ -121,8 +124,9 @@ To capture the nix we can do something like:
121124
122125```nix
123126let inherit (import ./. {}) sources nixpkgsArgs;
124− pkgs = import sources.nixpkgs-default nixpkgsArgs;
127+ pkgs = import sources.nixpkgs nixpkgsArgs;
125128 hlint = pkgs.haskell-nix.hackage-package {
129+ compiler-nix-name = "ghc883";
126130 name = "hlint";
127131 version = "2.2.11";
128132 index-state = "2020-04-15T00:00:00Z";
@@ -155,8 +159,9 @@ If we choose to add the `checkMaterialization` flag you would have:
155159
156160```nix
157161let inherit (import ./. {}) sources nixpkgsArgs;
158− pkgs = import sources.nixpkgs-default nixpkgsArgs;
162+ pkgs = import sources.nixpkgs nixpkgsArgs;
159163 hlint = pkgs.haskell-nix.hackage-package {
164+ compiler-nix-name = "ghc883";
160165 name = "hlint";
161166 version = "2.2.10";
162167 index-state = "2020-04-15T00:00:00Z";
@@ -199,8 +204,9 @@ For instance:
199204
200205```nix
201206let inherit (import ./. {}) sources nixpkgsArgs;
202− pkgs = import sources.nixpkgs-default nixpkgsArgs;
207+ pkgs = import sources.nixpkgs nixpkgsArgs;
203208 hlint = pkgs.haskell-nix.hackage-project {
209+ compiler-nix-name = "ghc883";
204210 name = "hlint";
205211 version = "2.2.10";
206212 index-state = "2020-04-15T00:00:00Z";
@@ -236,9 +242,10 @@ a non-existing path is now an error:
236242
237243```nix
238244let inherit (import ./. {}) sources nixpkgsArgs;
239− pkgs = import sources.nixpkgs-default nixpkgsArgs;
245+ pkgs = import sources.nixpkgs nixpkgsArgs;
240246 hlintPlan = /nix/store/kk047cqsjvbj4w8psv4l05abdcnyrqdc-hlint-plan-to-nix-pkgs;
241247 hlint = pkgs.haskell-nix.hackage-package {
248+ compiler-nix-name = "ghc883";
242249 name = "hlint";
243250 version = "2.2.11";
244251 index-state = "2020-04-15T00:00:00Z";
examples/cardano-sl-mingw32.nix+1−1
@@ -1,3 +1,3 @@
11let 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"; });
33in (pkgs.haskell-nix.stackProject (import ./cardano-sl-args.nix)).cardano-sl.components.all
examples/cardano-sl.nix+1−1
@@ -1,3 +1,3 @@
11let inherit (import ../. {}) sources nixpkgsArgs;
2− pkgs = import sources.nixpkgs-default nixpkgsArgs;
2+ pkgs = import sources.nixpkgs nixpkgsArgs;
33in (pkgs.haskell-nix.stackProject (import ./cardano-sl-args.nix)).cardano-sl.components.all
examples/cardano-wallet-ghcjs.nix+1−1
@@ -1,5 +1,5 @@
11let 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"; });
33 Cabal = pkgs.buildPackages.haskell-nix.hackage-package {
44 name = "Cabal"; version = "2.4.1.0";
55 modules = [
examples/cardano-wallet-mingw32.nix+1−1
@@ -1,3 +1,3 @@
11let 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"; });
33in (pkgs.haskell-nix.stackProject (import ./cardano-wallet-args.nix)).cardano-wallet.components.all
examples/cardano-wallet-rpi.nix+1−1
@@ -1,5 +1,5 @@
11let 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"; });
33 Cabal = pkgs.buildPackages.haskell-nix.hackage-package {
44 name = "Cabal"; version = "2.4.1.0";
55 modules = [
examples/cardano-wallet.nix+1−1
@@ -1,3 +1,3 @@
11let inherit (import ../. {}) sources nixpkgsArgs;
2− pkgs = import sources.nixpkgs-default nixpkgsArgs;
2+ pkgs = import sources.nixpkgs nixpkgsArgs;
33in (pkgs.haskell-nix.stackProject (import ./cardano-wallet-args.nix)).cardano-wallet.components.all
examples/plutus-mingw32.nix+1−1
@@ -1,3 +1,3 @@
11let 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"; });
33in (pkgs.haskell-nix.stackProject (import ./plutus-args.nix)).language-plutus-core.components.all
examples/plutus.nix+1−1
@@ -1,3 +1,3 @@
11let inherit (import ../. {}) sources nixpkgsArgs;
2− pkgs = import sources.nixpkgs-default nixpkgsArgs;
2+ pkgs = import sources.nixpkgs nixpkgsArgs;
33in (pkgs.haskell-nix.stackProject (import ./plutus-args.nix)).language-plutus-core.components.all
flake.nix+1−1
@@ -22,7 +22,7 @@
2222 value = f name;
2323 }) lst);
2424 in genAttrs [ "x86_64-linux" "x86_64-darwin" ] (system:
25− import self.sources.nixpkgs-default
25+ import self.sources.nixpkgs
2626 (self.nixpkgsArgs // { localSystem = { inherit system; }; }));
2727 };
2828}
lib/cabal-licenses.nix+1
@@ -12,6 +12,7 @@ lib: with lib.licenses;
1212 "AGPL-3.0-only" = agpl3;
1313 "AGPL-3.0-or-later" = agpl3Plus;
1414 "Apache-2.0" = asl20;
15+ "GPL-2.0-or-later AND BSD-3-Clause" = [gpl2Plus bsd3];
1516 # Generic
1617 LicenseRef-Apache = "Apache";
1718 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:
22let readIfExists = src: fileName:
33 let origSrcDir = src.origSrcSubDir or src;
44 in
@@ -8,6 +8,7 @@ let readIfExists = src: fileName:
88in
99{ name ? src.name or null # optional name for better error messages
1010, src
11+, compiler-nix-name # The name of the ghc compiler to use eg. "ghc883"
1112, index-state ? null # Hackage index-state, eg. "2019-10-10T00:00:00Z"
1213, index-sha256 ? null # The hash of the truncated hackage index-state
1314, 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
1718, cabalProject ? readIfExists src cabalProjectFileName
1819, cabalProjectLocal ? readIfExists src "${cabalProjectFileName}.local"
1920, 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
2122, ghc ? null # Deprecated in favour of `compiler-nix-name`
2223, ghcOverride ? null # Used when we need to set ghc explicitly during bootstrapping
23−, nix-tools ? defaults.nix-tools
24−, hpack ? defaults.hpack
25−, cabal-install ? defaults.cabal-install
24+, nix-tools ? evalPackages.haskell-nix.nix-tools.${compiler-nix-name} # When building cabal projects we use the nix-tools
25+, cabal-install ? evalPackages.haskell-nix.cabal-install.${compiler-nix-name} # and cabal-install compiled with matching ghc version
2626, configureArgs ? "" # Extra arguments to pass to `cabal v2-configure`.
2727 # `--enable-tests --enable-benchmarks` are included by default.
2828 # If the tests and benchmarks are not needed and they
@@ -56,7 +56,6 @@ let
5656 + "pick the correct `ghc` package from the respective buildPackages. "
5757 + "For example use `compiler-nix-name = \"ghc865\";` for ghc 8.6.5") ghc
5858 else
59− if compiler-nix-name != null
6059 # Do note that `pkgs = final.buildPackages` in the `overlays/haskell.nix`
6160 # call to this file. And thus `pkgs` here is the proper `buildPackages`
6261 # set and we do not need, nor should pick the compiler from another level
@@ -65,8 +64,7 @@ let
6564 #
6665 # > The option `packages.Win32.package.identifier.name' is used but not defined.
6766 #
68− then pkgs.haskell-nix.compiler."${compiler-nix-name}"
69− else defaults.ghc;
67+ pkgs.haskell-nix.compiler."${compiler-nix-name}";
7068
7169in
7270 assert (if ghc'.isHaskellNixCompiler or false then true
@@ -386,7 +384,7 @@ let
386384 } // pkgs.lib.optionalAttrs (checkMaterialization != null) {
387385 inherit checkMaterialization;
388386 }) (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 ];
390388 # Needed or stack-to-nix will die on unicode inputs
391389 LOCALE_ARCHIVE = pkgs.lib.optionalString (pkgs.stdenv.hostPlatform.libc == "glibc") "${pkgs.glibcLocales}/lib/locale/locale-archive";
392390 LANG = "en_US.UTF-8";
lib/call-stack-to-nix.nix+2−1
@@ -5,7 +5,7 @@
55 *
66 * see also `call-cabal-project-to-nix`!
77 */
8−{ runCommand, nix-tools, pkgs, mkCacheFile, materialize, haskellLib }:
8+{ runCommand, pkgs, mkCacheFile, materialize, haskellLib }:
99{ name ? src.name or null # optional name for better error messages
1010, src
1111, stackYaml ? "stack.yaml"
@@ -15,6 +15,7 @@
1515, resolverSha256 ? null
1616, materialized ? null # Location of a materialized copy of the nix files
1717, 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)
1819, ... }:
1920let
2021 inherit (haskellLib.fetchResolver {
lib/stack-cache-generator.nix+2−1
@@ -1,6 +1,6 @@
11# Generate cache entries for dependencies of package defined in `src`
22
3−{ pkgs, haskellLib, nix-tools }:
3+{ pkgs, haskellLib }:
44{ src
55, stackYaml ? "stack.yaml"
66, sha256map ? null
@@ -14,6 +14,7 @@
1414 then { location, tag, ...}: sha256map."${location}"."${tag}"
1515 else _: null
1616, 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)
1718, ...
1819}:
1920let
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 @@
22 pkgs = hackage:
33 {
44 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;
66 "unix".revision = (((hackage."unix")."2.7.2.2").revisions).default;
77 "mtl".revision = (((hackage."mtl")."2.2.2").revisions).default;
88 "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.3.0").revisions).default;
11− "containers".revision = (((hackage."containers")."0.6.0.1").revisions).default;
9+ "deepseq".revision = (((hackage."deepseq")."1.4.3.0").revisions).default;
10+ "directory".revision = (((hackage."directory")."1.3.1.5").revisions).default;
11+ "containers".revision = (((hackage."containers")."0.5.11.0").revisions).default;
1212 "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;
1414 "time".revision = (((hackage."time")."1.8.0.2").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.5.0").revisions).default;
18− "array".revision = (((hackage."array")."0.5.3.0").revisions).default;
15+ "transformers".revision = (((hackage."transformers")."0.5.5.0").revisions).default;
16+ "filepath".revision = (((hackage."filepath")."1.4.2").revisions).default;
17+ "process".revision = (((hackage."process")."1.6.3.0").revisions).default;
18+ "array".revision = (((hackage."array")."0.5.2.0").revisions).default;
1919 "integer-gmp".revision = (((hackage."integer-gmp")."1.0.2.0").revisions).default;
2020 };
2121 compiler = {
22− version = "8.6.5";
23− nix-name = "ghc865";
22+ version = "8.4.4";
23+ nix-name = "ghc844";
2424 packages = {
25− "ghc-prim" = "0.5.3";
25+ "ghc-prim" = "0.5.2.0";
2626 "unix" = "2.7.2.2";
2727 "mtl" = "2.2.2";
2828 "rts" = "1.0";
29− "deepseq" = "1.4.4.0";
30− "directory" = "1.3.3.0";
31− "containers" = "0.6.0.1";
29+ "deepseq" = "1.4.3.0";
30+ "directory" = "1.3.1.5";
31+ "containers" = "0.5.11.0";
3232 "bytestring" = "0.10.8.2";
33− "base" = "4.12.0.0";
33+ "base" = "4.11.1.0";
3434 "time" = "1.8.0.2";
35− "transformers" = "0.5.6.2";
36− "filepath" = "1.4.2.1";
37− "process" = "1.6.5.0";
38− "array" = "0.5.3.0";
35+ "transformers" = "0.5.5.0";
36+ "filepath" = "1.4.2";
37+ "process" = "1.6.3.0";
38+ "array" = "0.5.2.0";
3939 "integer-gmp" = "1.0.2.0";
4040 };
4141 };
materialized/ghc-extra-projects/cross/ghc865/.plan.nix/ghc.nix+1
@@ -14,6 +14,7 @@
1414 stage1 = false;
1515 stage2 = true;
1616 stage3 = false;
17+ dynamic-system-linker = true;
1718 };
1819 package = {
1920 specVersion = "1.10";
materialized/ghc-extra-projects/cross/ghc865/default.nix+1
@@ -73,6 +73,7 @@
7373 "stage1" = lib.mkOverride 900 false;
7474 "stage2" = lib.mkOverride 900 true;
7575 "stage3" = lib.mkOverride 900 false;
76+ "dynamic-system-linker" = lib.mkOverride 900 true;
7677 "ghci" = lib.mkOverride 900 true;
7778 "terminfo" = lib.mkOverride 900 true;
7879 };
materialized/ghc-extra-projects/default/ghc865/.plan.nix/ghc.nix+1
@@ -14,6 +14,7 @@
1414 stage1 = false;
1515 stage2 = true;
1616 stage3 = false;
17+ dynamic-system-linker = true;
1718 };
1819 package = {
1920 specVersion = "1.10";
materialized/ghc-extra-projects/default/ghc865/default.nix+1
@@ -74,6 +74,7 @@
7474 "stage1" = lib.mkOverride 900 false;
7575 "stage2" = lib.mkOverride 900 true;
7676 "stage3" = lib.mkOverride 900 false;
77+ "dynamic-system-linker" = lib.mkOverride 900 true;
7778 "ghci" = lib.mkOverride 900 true;
7879 "terminfo" = lib.mkOverride 900 true;
7980 };
materialized/ghc-extra-projects/windows/ghc865/.plan.nix/ghc.nix+1
@@ -14,6 +14,7 @@
1414 stage1 = false;
1515 stage2 = true;
1616 stage3 = false;
17+ dynamic-system-linker = true;
1718 };
1819 package = {
1920 specVersion = "1.10";
materialized/ghc-extra-projects/windows/ghc865/default.nix+1
@@ -71,6 +71,7 @@
7171 "stage1" = lib.mkOverride 900 false;
7272 "stage2" = lib.mkOverride 900 true;
7373 "stage3" = lib.mkOverride 900 false;
74+ "dynamic-system-linker" = lib.mkOverride 900 true;
7475 "ghci" = lib.mkOverride 900 true;
7576 "terminfo" = lib.mkOverride 900 true;
7677 };
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 @@
3535 "bytestring".revision = (((hackage."bytestring")."0.10.10.0").revisions).default;
3636 "text".revision = (((hackage."text")."1.2.3.2").revisions).default;
3737 "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;
3939 "base".revision = (((hackage."base")."4.14.0.0").revisions).default;
4040 "time".revision = (((hackage."time")."1.9.3").revisions).default;
4141 "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
33 builder = haskellLib.weakCallPackage pkgs ../builder {
44 inherit haskellLib;
55 ghc = config.ghc.package;
6− inherit (config) nonReinstallablePkgs hsPkgs;
6+ inherit (config) nonReinstallablePkgs hsPkgs compiler;
77 };
88
99in
nix-tools/regenerate.nix+2−1
@@ -25,7 +25,7 @@ let
2525 inherit (import ../default.nix {}) sources nixpkgsArgs;
2626in
2727{ specJSON ? ./nix-tools-src.json }:
28−with import sources.nixpkgs-default nixpkgsArgs;
28+with import sources.nixpkgs nixpkgsArgs;
2929let
3030 src = haskell-nix.cleanSourceHaskell {
3131 src = haskell-nix.fetchExternal {
@@ -36,6 +36,7 @@ let
3636 };
3737in
3838 let plan-to-nix = (haskell-nix.cabalProject {
39+ compiler-nix-name = "ghc865";
3940 name = "nix-tools";
4041 inherit src;
4142 modules = [{
nix/sources.json+19−1
@@ -1,6 +1,20 @@
11{
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+ },
215 "niv": {
316 "branch": "master",
17+ "builtin": false,
418 "description": "Easy dependency management for Nix projects",
519 "homepage": "https://github.com/nmattia/niv",
620 "owner": "nmattia",
@@ -13,6 +27,7 @@
1327 },
1428 "nix-tools": {
1529 "branch": "master",
30+ "builtin": false,
1631 "description": "Translate Cabals Generic Package Description to a Nix expression",
1732 "homepage": null,
1833 "owner": "input-output-hk",
@@ -25,6 +40,7 @@
2540 },
2641 "nixpkgs-1909": {
2742 "branch": "nixpkgs-19.09-darwin",
43+ "builtin": false,
2844 "description": "Nix Packages collection",
2945 "homepage": null,
3046 "owner": "NixOS",
@@ -37,6 +53,7 @@
3753 },
3854 "nixpkgs-2003": {
3955 "branch": "nixpkgs-20.03-darwin",
56+ "builtin": false,
4057 "description": "Nix Packages collection",
4158 "homepage": null,
4259 "owner": "NixOS",
@@ -47,8 +64,9 @@
4764 "url": "https://github.com/NixOS/nixpkgs/archive/db31e48c5c8d99dcaf4e5883a96181f6ac4ad6f6.tar.gz",
4865 "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
4966 },
50− "nixpkgs-default": {
67+ "nixpkgs": {
5168 "branch": "nixpkgs-20.03-darwin",
69+ "builtin": false,
5270 "description": "Nix Packages collection",
5371 "homepage": null,
5472 "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
2828 fi
2929 done
3030 '';
31− # For each architecture, we need to know two (somewhat ad-hoc) things:
32− # - What GHC version we should use for bootstrapping.
33− # - What Happy version we should use for bootstrapping.
31+ # For each architecture, what GHC version we should use for bootstrapping.
3432 buildBootstrapper =
3533 if final.targetPlatform.isAarch64 && final.buildPlatform.isAarch64
3634 then {
3735 compilerNixName = "ghc882";
38− happyVersion = "1.19.12";
3936 }
4037 else {
4138 compilerNixName = "ghc844";
42− happyVersion = "1.19.11";
4339 };
4440in {
4541 haskell-nix = prev.haskell-nix // {
@@ -47,15 +43,9 @@ in {
4743 compiler =
4844 let bootPkgs = with final.buildPackages; {
4945 ghc = final.buildPackages.buildPackages.haskell-nix.bootstrap.compiler."${buildBootstrapper.compilerNixName}";
50− alex = final.haskell-nix.bootstrap.packages.alex-tool {
51− checkMaterialization = false;
52− };
53− happy = final.haskell-nix.bootstrap.packages.happy-tool {
54− checkMaterialization = false;
55− };
56− hscolour = final.haskell-nix.bootstrap.packages.hscolour-tool {
57− checkMaterialization = false;
58− };
46+ alex = final.haskell-nix.bootstrap.packages.alex-unchecked;
47+ happy = final.haskell-nix.bootstrap.packages.happy-unchecked;
48+ hscolour = final.haskell-nix.bootstrap.packages.hscolour-unchecked;
5949 };
6050 sphinx = with final.buildPackages; (python3Packages.sphinx_1_7_9 or python3Packages.sphinx);
6151 hsc2hs-align-conditionals-patch = final.fetchpatch {
@@ -147,7 +137,11 @@ in {
147137 ghc844 = final.callPackage ../compiler/ghc {
148138 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc844; };
149139
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+ };
151145
152146 buildLlvmPackages = final.buildPackages.llvmPackages_5;
153147 llvmPackages = final.llvmPackages_5;
@@ -165,7 +159,11 @@ in {
165159 ghc861 = final.callPackage ../compiler/ghc {
166160 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc861; };
167161
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+ };
169167
170168 buildLlvmPackages = final.buildPackages.llvmPackages_6;
171169 llvmPackages = final.llvmPackages_6;
@@ -181,7 +179,11 @@ in {
181179 ghc862 = final.callPackage ../compiler/ghc {
182180 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc862; };
183181
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+ };
185187
186188 buildLlvmPackages = final.buildPackages.llvmPackages_6;
187189 llvmPackages = final.llvmPackages_6;
@@ -198,7 +200,11 @@ in {
198200 ghc863 = final.callPackage ../compiler/ghc {
199201 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc863; };
200202
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+ };
202208
203209 buildLlvmPackages = final.buildPackages.llvmPackages_6;
204210 llvmPackages = final.llvmPackages_6;
@@ -215,7 +221,11 @@ in {
215221 ghc864 = final.callPackage ../compiler/ghc {
216222 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc864; };
217223
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+ };
219229
220230 buildLlvmPackages = final.buildPackages.llvmPackages_6;
221231 llvmPackages = final.llvmPackages_6;
@@ -232,7 +242,11 @@ in {
232242 ghc865 = final.callPackage ../compiler/ghc {
233243 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc865; };
234244
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+ };
236250
237251 buildLlvmPackages = final.buildPackages.llvmPackages_6;
238252 llvmPackages = final.llvmPackages_6;
@@ -302,8 +316,6 @@ in {
302316
303317 bootPkgs = bootPkgs // {
304318 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;
307319 };
308320 inherit sphinx installDeps;
309321
@@ -365,41 +377,27 @@ in {
365377 '' + installDeps targetPrefix);
366378 })));
367379
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}";
374380 # Both `cabal-install` and `nix-tools` are needed for `cabalProject`
375381 # to check materialized results. We need to take care that when
376382 # it is doing this we do not check the materialization of the
377383 # tools used or there will be infinite recursion.
378384 # always has `checkMaterialization = false` to avoid infinite
379385 # recursion.
380− cabal-install-tool = 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"
384− then "ghc883"
385− else final.haskell-nix.defaultCompilerNixName);
386− in final.haskell-nix.tool "cabal" ({
386+ cabal-install-tool = {compiler-nix-name, ...}@args:
387+ (final.haskell-nix.hackage-package ({
388+ name = "cabal-install";
387389 version = "3.2.0.0";
388390 index-state = final.haskell-nix.internalHackageIndexState;
389− inherit compiler-nix-name;
390391 # When building cabal-install (only happens when checking materialization)
391392 # disable checking of the tools used to avoid infinite recursion.
392− cabal-install = final.evalPackages.haskell-nix.cabal-install-tool
393− (args // { checkMaterialization = false; });
394− nix-tools = final.evalPackages.haskell-nix.nix-tools-set
395− (args // { checkMaterialization = false; });
393+ cabal-install = final.evalPackages.haskell-nix.cabal-install-unchecked.${compiler-nix-name};
394+ nix-tools = final.evalPackages.haskell-nix.nix-tools-unchecked.${compiler-nix-name};
396395 materialized = ../materialized + "/${compiler-nix-name}/cabal-install";
397− } // args);
398− cabal-install = final.buildPackages.haskell-nix.cabal-install-tool {};
399− nix-tools-set = args:
396+ } // args)).components.exes.cabal;
397+ nix-tools-set = { compiler-nix-name, ... }@args:
400398 let
401− exes =
402− (final.haskell-nix.cabalProject ({
399+ project =
400+ final.haskell-nix.cabalProject ({
403401 name = "nix-tools";
404402 src = final.haskell-nix.sources.nix-tools;
405403 index-state = final.haskell-nix.internalHackageIndexState;
@@ -409,13 +407,9 @@ in {
409407 '';
410408 # When building cabal-install (only happens when checking materialization)
411409 # disable checking of the tools used to avoid infinite recursion.
412− cabal-install = final.evalPackages.haskell-nix.cabal-install-tool
413− (args // { checkMaterialization = false; });
414− nix-tools = final.evalPackages.haskell-nix.nix-tools-set
415− (args // { checkMaterialization = false; });
416− materialized = ../materialized + "/${
417− args.compiler-nix-name or final.haskell-nix.defaultCompilerNixName
418− }/nix-tools";
410+ cabal-install = final.evalPackages.haskell-nix.cabal-install-unchecked.${compiler-nix-name};
411+ nix-tools = final.evalPackages.haskell-nix.nix-tools-unchecked.${compiler-nix-name};
412+ materialized = ../materialized + "/${compiler-nix-name}/nix-tools";
419413 modules = [{
420414 packages.transformers-compat.components.library.doExactConfig = true;
421415 packages.time-compat.components.library.doExactConfig = true;
@@ -432,7 +426,8 @@ in {
432426 "unix" "xhtml"
433427 ];
434428 }];
435− } // args)).nix-tools.components.exes;
429+ } // args);
430+ exes = project.nix-tools.components.exes // project.hpack.components.exes;
436431 tools = [
437432 final.buildPackages.nix
438433 # Double buildPackages is intentional, see comment in lib/default.nix for details.
@@ -452,23 +447,39 @@ in {
452447 done
453448 '';
454449 };
455− nix-tools = final.buildPackages.haskell-nix.nix-tools-set {};
456− alex-tool = args: final.haskell-nix.tool "alex" ({
457− version = "3.2.5";
458− index-state = final.haskell-nix.internalHackageIndexState;
459− materialized = ../materialized + "/${
460− args.compiler-nix-name or final.haskell-nix.defaultCompilerNixName
461− }/alex";
462− } // args);
463− alex = final.buildPackages.haskell-nix.alex-tool {};
464− happy-tool = args: final.haskell-nix.tool "happy" ({
465− version = "1.19.12";
466− index-state = final.haskell-nix.internalHackageIndexState;
467− materialized = ../materialized + "/${
468− args.compiler-nix-name or final.haskell-nix.defaultCompilerNixName
469− }/happy";
470− } // args);
471− happy = final.buildPackages.haskell-nix.happy-tool {};
450+
451+ # Memoize the cabal-install and nix-tools derivations by adding:
452+ # haskell-nix.cabal-install.ghcXXX
453+ # haskell-nix.cabal-install-unchecked.ghcXXX
454+ # haskell-nix.nix-tools.ghcXXX
455+ # haskell-nix.nix-tools-unchecked.ghcXXX
456+ # Using these avoids unecessary calls to mkDerivation.
457+ # For cabal projects we match the versions used to the compiler
458+ # selected for the project to avoid the chance of a dependency
459+ # another GHC version (particularly useful on macOS where
460+ # executables are dynamically linked to GHC itself, which means
461+ # that if you use a tool built with a different GHC you will get
462+ # that GHC itself in your closure).
463+ cabal-install = final.lib.mapAttrs (compiler-nix-name: _:
464+ final.haskell-nix.cabal-install-tool { inherit compiler-nix-name; }) final.haskell-nix.compiler;
465+ cabal-install-unchecked = final.lib.mapAttrs (compiler-nix-name: _:
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;
472483
473484 # WARN: The `import ../. {}` will prevent
474485 # any cross to work, as we will loose
@@ -497,7 +508,16 @@ in {
497508
498509 # the bootstrap infra structure (pre-compiled ghc; bootstrapped cabal-install, ...)
499510 bootstrap = with final.haskell-nix;
500− let ghc = final.buildPackages.haskell-nix.bootstrap.compiler."${buildBootstrapper.compilerNixName}";
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
518+ ghc = final.buildPackages.haskell-nix.bootstrap.compiler."${buildBootstrapper.compilerNixName}";
519+ ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
520+ index-state = final.haskell-nix.internalHackageIndexState;
501521 in {
502522 # XXX: import ../. will throw away all other overlays, config values, ...
503523 # this is not ideal!
@@ -525,31 +545,31 @@ in {
525545 # building ghc itself (since GHC is a dependency
526546 # of the materialization check it would cause
527547 # infinite recusion).
528− alex-tool = args: tool "alex" ({
548+ alex-tool = args: tool buildBootstrapper.compilerNixName "alex" ({
529549 version = "3.2.4";
530− # Only a boot compiler is suitable here
531− ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
532− index-state = final.haskell-nix.internalHackageIndexState;
550+ inherit ghcOverride nix-tools cabal-install index-state;
533551 materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/alex";
534552 } // args);
535553 alex = bootstrap.packages.alex-tool {};
536− happy-tool = args: tool "happy" ({
537− version = buildBootstrapper.happyVersion;
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}";
554+ alex-unchecked = bootstrap.packages.alex-tool { checkMaterialization = false; };
555+ happy-tool = { version ? "1.19.12", ... }@args: tool buildBootstrapper.compilerNixName "happy" ({
556+ inherit version ghcOverride nix-tools cabal-install index-state;
557+ materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/happy-${version}";
542558 } // args);
543559 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; };
544564 hscolour-tool = args: (hackage-package ({
565+ compiler-nix-name = buildBootstrapper.compilerNixName;
545566 name = "hscolour";
546567 version = "1.24.4";
547− # Only a boot compiler is suitable here
548− ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
549− index-state = final.haskell-nix.internalHackageIndexState;
568+ inherit ghcOverride nix-tools cabal-install index-state;
550569 materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/hscolour";
551570 } // args)).components.exes.HsColour;
552571 hscolour = bootstrap.packages.hscolour-tool {};
572+ hscolour-unchecked = bootstrap.packages.hscolour-tool { checkMaterialization = false; };
553573 };
554574 };
555575 };
overlays/eval-on-current.nix+3−3
@@ -2,7 +2,7 @@ final: prev: {
22 # This overlay makes `evalPackages` is like `buildPackages`, but on
33 # `builtins.currentSystem`.
44 # See `eval-on-build.nix` for alternative that just uses `buildPackages`.
5− evalPackages = (import final.path (import ../. {
6− inherit (final.haskell-nix) defaultCompilerNixName;
7− }).nixpkgsArgs).buildPackages;
5+ evalPackages = (import final.path {
6+ inherit (final.haskell-nix) overlays;
7+ }).buildPackages;
88}
overlays/ghc-packages.nix+8−8
@@ -1,14 +1,14 @@
11final: prev:
22let
3− callCabal2Nix = name: src: final.stdenv.mkDerivation {
3+ callCabal2Nix = compiler-nix-name: name: src: final.evalPackages.stdenv.mkDerivation {
44 name = "${name}-package.nix";
55 inherit src;
6− nativeBuildInputs = [ (final.buildPackages.haskell-nix.nix-tools-set {
7− # It is not safe to checkk the nix-tools materialization here
6+ nativeBuildInputs = [
7+ # It is not safe to check the nix-tools materialization here
88 # as we would need to run this code to do so leading to
9− # infinite recursion.
10− checkMaterialization = false;
11− }) ];
9+ # infinite recursion (so using nix-tools-unchecked).
10+ final.evalPackages.haskell-nix.nix-tools-unchecked.${compiler-nix-name}
11+ ];
1212 phases = [ "unpackPhase" "buildPhase" ];
1313
1414 LOCALE_ARCHIVE = final.lib.optionalString (final.stdenv.hostPlatform.libc == "glibc") "${final.glibcLocales}/lib/locale/locale-archive";
@@ -117,7 +117,7 @@ in rec {
117117 fi
118118 ''
119119 else "${value.passthru.configured-src}/${dir}";
120− nix = callCabal2Nix "${ghcName}-${pkgName}" src;
120+ nix = callCabal2Nix ghcName "${ghcName}-${pkgName}" src;
121121 }) ghc-extra-pkgs)
122122 final.buildPackages.haskell-nix.compiler;
123123
@@ -178,7 +178,7 @@ in rec {
178178 if __pathExists materializedPath
179179 then materializedPath
180180 else null;
181− ghcOverride = final.buildPackages.haskell-nix.compiler.${ghcName};
181+ compiler-nix-name = ghcName;
182182 configureArgs = "--disable-tests --allow-newer='terminfo:base'"; # avoid failures satisfying bytestring package tests dependencies
183183 })
184184 ghc-extra-pkgs-cabal-projects;
overlays/hackage-quirks.nix+14
@@ -13,6 +13,20 @@ in { haskell-nix = prev.haskell-nix // {
1313 # but also for
1414 # https://github.com/input-output-hk/haskell.nix/issues/422
1515 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 = {
1630 modules = [ { reinstallableLibGhc = true; } ];
1731 };
1832
overlays/haskell.nix+55−33
@@ -252,22 +252,26 @@ final: prev: {
252252 };
253253
254254 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;
256256 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;
257259 };
258260
259261 # Function to call stackToNix
260262 callStackToNix = import ../lib/call-stack-to-nix.nix {
261263 pkgs = final.evalPackages.pkgs;
262264 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;
264266 };
265267
266268 # given a source location call `cabal-to-nix` (from nix-tools) on it
267269 # to produce the nix representation of it.
268270 callCabalToNix = { name, src, cabal-file ? "${name}.cabal" }:
269271 final.buildPackages.pkgs.runCommand "${name}.nix" {
270− nativeBuildInputs = [ final.buildPackages.haskell-nix.nix-tools ];
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)
274+ nativeBuildInputs = [ final.buildPackages.haskell-nix.internal-nix-tools ];
271275
272276 LOCALE_ARCHIVE = final.lib.optionalString (final.stdenv.buildPlatform.libc == "glibc") "${final.buildPackages.glibcLocales}/lib/locale/locale-archive";
273277 LANG = "en_US.UTF-8";
@@ -364,7 +368,7 @@ final: prev: {
364368
365369 genStackCache = import ../lib/stack-cache-generator.nix {
366370 inherit (final.evalPackages) pkgs;
367− inherit (final.evalPackages.haskell-nix) haskellLib nix-tools;
371+ inherit (final.evalPackages.haskell-nix) haskellLib;
368372 };
369373
370374 mkCacheModule = cache:
@@ -410,9 +414,8 @@ final: prev: {
410414 index-state-hashes = import indexStateHashesPath;
411415 inherit (final.buildPackages.haskell-nix) haskellLib materialize;
412416 pkgs = final.buildPackages.pkgs;
413− inherit (final.evalPackages.haskell-nix.haskellPackages.hpack.components.exes) hpack;
414− inherit (final.buildPackages.haskell-nix) ghc;
415− inherit (final.evalPackages.haskell-nix) cabal-install dotCabal nix-tools;
417+ inherit (final) evalPackages;
418+ inherit (final.evalPackages.haskell-nix) dotCabal;
416419 inherit (final.buildPackages.pkgs) runCommand symlinkJoin cacert;
417420 };
418421
@@ -436,12 +439,17 @@ final: prev: {
436439 # the index-state-hashes is used. This guarantees reproducability wrt
437440 # to the haskell.nix revision. If reproducability beyond haskell.nix
438441 # is required, a specific index-state should be provided!
439− hackage-package = { name, ... }@args: (hackage-project args).hsPkgs.${name};
442+ hackage-package =
443+ { name, compiler-nix-name, ... }@args':
444+ let args = { caller = "hackage-package"; } // args';
445+ in (hackage-project args).hsPkgs.${name};
440446 hackage-project =
441447 { name
448+ , compiler-nix-name
442449 , version
443− , ... }@args:
444− let tarball = final.pkgs.fetchurl {
450+ , ... }@args':
451+ let args = { caller = "hackage-project"; } // args';
452+ tarball = final.pkgs.fetchurl {
445453 url = "mirror://hackage/${name}-${version}.tar.gz";
446454 inherit (hackage.${name}.${version}) sha256; };
447455 in let src = final.buildPackages.pkgs.runCommand "${name}-${version}-src" { } ''
@@ -458,8 +466,9 @@ final: prev: {
458466 # separately from the hsPkgs. The advantage is that the you can get the
459467 # plan-nix without building the project.
460468 cabalProject' =
461− { ... }@args:
469+ { src, compiler-nix-name, ... }@args':
462470 let
471+ args = { caller = "cabalProject'"; } // args';
463472 callProjectResults = callCabalProjectToNix args;
464473 in let pkg-set = mkCabalProjectPkgSet
465474 { plan-pkgs = importAndFilterProject {
@@ -478,6 +487,9 @@ final: prev: {
478487 inherit pkg-set;
479488 plan-nix = callProjectResults.projectNix;
480489 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;
481493 };
482494
483495 # Take `hsPkgs` from the `rawProject` and update all the packages and
@@ -507,16 +519,20 @@ final: prev: {
507519 });
508520 });
509521
510− cabalProject = args: let p = cabalProject' args;
522+ cabalProject =
523+ { src, compiler-nix-name, ... }@args':
524+ let
525+ args = { caller = "hackage-package"; } // args';
526+ p = cabalProject' args;
511527 in p.hsPkgs // {
512− inherit (p) plan-nix;
528+ inherit (p) plan-nix index-state tool tools roots;
513529 # Provide `nix-shell -A shells.ghc` for users migrating from the reflex-platform.
514530 # But we should encourage use of `nix-shell -A shellFor`
515531 shells.ghc = p.hsPkgs.shellFor {};
516532 };
517533
518534 stackProject' =
519− { ... }@args:
535+ { src, ... }@args:
520536 let callProjectResults = callStackToNix ({ inherit cache; } // args);
521537 generatedCache = genStackCache args;
522538 cache = args.cache or generatedCache;
@@ -531,11 +547,14 @@ final: prev: {
531547 inherit (pkg-set.config) hsPkgs;
532548 inherit pkg-set;
533549 stack-nix = callProjectResults.projectNix;
534− };
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;
553+ };
535554
536555 stackProject = args: let p = stackProject' args;
537556 in p.hsPkgs // {
538− inherit (p) stack-nix;
557+ inherit (p) stack-nix tool tools roots;
539558 # Provide `nix-shell -A shells.ghc` for users migrating from the reflex-platform.
540559 # But we should encourage use of `nix-shell -A shellFor`
541560 shells.ghc = p.hsPkgs.shellFor {};
@@ -550,8 +569,9 @@ final: prev: {
550569 # selected file ends in a `.yaml` it is assumed to be for `stackProject`.
551570 # If niether `stack.yaml` nor `cabal.project` exist `cabalProject` is
552571 # used (as it will use a default `cabal.project`).
553− project' = { src, projectFileName ? null, ... }@args:
572+ project' = { src, projectFileName ? null, ... }@args':
554573 let
574+ args = { caller = "project'"; } // args';
555575 dir = __readDir (src.origSrcSubDir or src);
556576 exists = fileName: builtins.elem (dir.${fileName} or "") ["regular" "symlink"];
557577 stackYamlExists = exists "stack.yaml";
@@ -574,8 +594,11 @@ final: prev: {
574594
575595 # This is the same as the `cabalPackage` and `stackPackage` wrappers
576596 # for `cabalPackage` and `stackPackage`.
577− project = args: let p = project' args;
578− in p.hsPkgs // {
597+ project = args':
598+ let
599+ args = { caller = "project'"; } // args';
600+ p = project' args;
601+ in p.hsPkgs // {
579602 # Provide `nix-shell -A shells.ghc` for users migrating from the reflex-platform.
580603 # But we should encourage use of `nix-shell -A shellFor`
581604 shells.ghc = p.hsPkgs.shellFor {};
@@ -598,17 +621,16 @@ final: prev: {
598621
599622 # Add this to your tests to make all the dependencies of haskell.nix
600623 # are tested and cached.
601− haskellNixRoots = final.recurseIntoAttrs {
602− Level0 = haskellNixRoots' 0;
603− Level1 = haskellNixRoots' 1;
624+ roots = compiler-nix-name: final.recurseIntoAttrs {
625+ Level0 = roots' compiler-nix-name 0;
626+ Level1 = roots' compiler-nix-name 1;
604627 # Should be safe to use this now we have materialized everything
605628 # except the tests
606− Level2 = haskellNixRoots' 2;
629+ Level2 = roots' compiler-nix-name 2;
607630 };
608631
609− haskellNixRoots' = ifdLevel:
610− let inherit (final.haskell-nix) defaultCompilerNixName;
611− in final.recurseIntoAttrs ({
632+ roots' = compiler-nix-name: ifdLevel:
633+ final.recurseIntoAttrs ({
612634 # Things that require no IFD to build
613635 inherit (final.buildPackages.haskell-nix) source-pins;
614636 # Double buildPackages is intentional,
@@ -624,20 +646,20 @@ final: prev: {
624646 boot-alex = final.buildPackages.haskell-nix.bootstrap.packages.alex;
625647 boot-happy = final.buildPackages.haskell-nix.bootstrap.packages.happy;
626648 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};
628650 ghc-boot-packages-nix = final.recurseIntoAttrs
629− final.ghc-boot-packages-nix."${defaultCompilerNixName}";
651+ final.ghc-boot-packages-nix.${compiler-nix-name};
630652 ghc-extra-projects-nix =
631− final.ghc-extra-projects."${defaultCompilerNixName}".plan-nix;
653+ final.ghc-extra-projects.${compiler-nix-name}.plan-nix;
632654 } // final.lib.optionalAttrs (ifdLevel > 1) {
633655 # 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;
635− inherit (final.buildPackages.haskell-nix) cabal-install dotCabal nix-tools alex happy;
656+ nix-tools = final.buildPackages.haskell-nix.nix-tools.${compiler-nix-name};
657+ cabal-install = final.buildPackages.haskell-nix.cabal-install.${compiler-nix-name};
636658 # These seem to be the only things we use from `ghc-extra-packages`
637659 # in haskell.nix itself.
638− inherit (final.ghc-extra-packages."${defaultCompilerNixName}"
660+ inherit (final.ghc-extra-packages."${compiler-nix-name}"
639661 .iserv-proxy.components.exes) iserv-proxy;
640− inherit (final.ghc-extra-packages."${defaultCompilerNixName}"
662+ inherit (final.ghc-extra-packages."${compiler-nix-name}"
641663 .remote-iserv.components.exes) remote-iserv;
642664 });
643665 };
overlays/tools.nix+22−12
@@ -6,16 +6,17 @@
66# when it is not.
77#
88# To get a single tool:
9−# haskell-nix.tool "cabal" "3.2.0.0"
9+# haskell-nix.tool "ghc883" "cabal" "3.2.0.0"
1010#
1111# This does the same thing as:
1212# (haskell-nix.hackage-package {
13+# compiler-nix-name = "ghc883";
1314# name = "cabal-install"
1415# version = "3.2.0.0"
1516# }).components.exes.cabal
1617#
1718# 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"; }
1920#
2021# To add tools to a shell:
2122# shellFor { tools = { cabal = "3.2.0.0"; hlint = "2.2.11"; }; }
@@ -23,13 +24,18 @@
2324# When used in shellFor the tools will be compiled with the same version
2425# of ghc used in the shell (the build ghc in the case of cross compilation).
2526#
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+#
2632# Instead of a version string we can use an attr set containing
2733# arguments that will be passed to `cabalProject`.
2834#
29−# For instance to specify the ghc used to compile. Use:
30−# haskell-nix.tool "cabal" {
35+# For instance to add haskell.nix modules. Use:
36+# haskell-nix.tool "ghc883" "cabal" {
3137# version = "3.2.0.0";
32−# ghc = haskell-nix.compiler.ghc883;
38+# modules = [ ... ];
3339# }
3440#
3541final: prev:
@@ -51,21 +57,25 @@ in { haskell-nix = prev.haskell-nix // {
5157 cabal-install = "cabal";
5258 };
5359
54− hackage-tool = { name, ... }@args:
55− (final.haskell-nix.hackage-package
56− (args // { name = final.haskell-nix.toolPackageName.${name} or name; }))
57− .components.exes."${final.haskell-nix.packageToolName.${name} or name}";
60+ hackage-tool = { name, ... }@args':
61+ let
62+ args = { caller = "hackage-tool"; } // args';
63+ in
64+ (final.haskell-nix.hackage-package
65+ (args // { name = final.haskell-nix.toolPackageName.${name} or name; }))
66+ .components.exes."${final.haskell-nix.packageToolName.${name} or name}";
5867
59− tool = name: versionOrArgs:
68+ tool = compiler-nix-name: name: versionOrArgs:
6069 let
61− args = final.haskell-nix.haskellLib.versionOrArgsToArgs versionOrArgs;
70+ args' = final.haskell-nix.haskellLib.versionOrArgsToArgs versionOrArgs;
71+ args = { inherit compiler-nix-name; } // args';
6272 in
6373 (if final.haskell-nix.custom-tools ? "${name}"
6474 && final.haskell-nix.custom-tools."${name}" ? "${args.version}"
6575 then final.haskell-nix.custom-tools."${name}"."${args.version}"
6676 else final.haskell-nix.hackage-tool) (args // { inherit name; });
6777
68− tools = lib.mapAttrs final.haskell-nix.tool;
78+ tools = compiler-nix-name: lib.mapAttrs (final.haskell-nix.tool compiler-nix-name);
6979
7080 # Like `tools` but allows default ghc to be specified
7181 toolsForGhc = ghcOverride: toolSet:
release.nix+1−1
@@ -6,7 +6,7 @@
66
77let
88 inherit (import ./ci-lib.nix) stripAttrsForHydra filterDerivations;
9− genericPkgs = import (import ./nixpkgs/default.nix).nixpkgs-default {};
9+ genericPkgs = import (import ./nix/sources.nix).nixpkgs {};
1010 lib = genericPkgs.lib;
1111 ci = import ./ci.nix { inherit supportedSystems ifdLevel checkMaterialization; restrictEval = true; };
1212 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 }:
22
33with stdenv.lib;
44
@@ -7,7 +7,7 @@ writeScript "check-path-supprot.sh" ''
77
88 set -euo pipefail
99
10− export PATH="${makeBinPath [ nix ]}"
10+ export PATH="${makeBinPath [ coreutils gnutar gzip nix ]}"
1111
1212 nix-build -E '((import ./. {}).pkgs.haskell-nix.cabalProject { compiler-nix-name = "ghc865"; src = ./test/cabal-simple; }).cabal-simple.components.library'
1313''
shell.nix+1−1
@@ -1,6 +1,6 @@
11let
22 inherit (import ./default.nix {}) sources nixpkgsArgs;
3− pkgs = import sources.nixpkgs-default nixpkgsArgs;
3+ pkgs = import sources.nixpkgs nixpkgsArgs;
44in pkgs.stdenv.mkDerivation rec {
55 name = "env";
66 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 }:
22
33with stdenv.lib;
44
55let
66 project = cabalProject' {
7+ inherit compiler-nix-name;
78 index-state = "2020-05-25T00:00:00Z";
89 src = testSrc "buildable";
910 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 }:
22
33with stdenv.lib;
44
55let
66 project = cabalProject' {
7+ inherit compiler-nix-name;
78 src = testSrc "cabal-22";
89 };
910
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 @@
11# Test a package set
2−{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc }:
2+{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
33
44with stdenv.lib;
55
@@ -16,6 +16,7 @@ let
1616 ];
1717
1818 project = cabalProject' {
19+ inherit compiler-nix-name;
1920 src = testSrc "cabal-simple-prof";
2021 inherit modules;
2122 };
test/cabal-simple/default.nix+2−1
@@ -1,5 +1,5 @@
11# Test a package set
2−{ stdenv, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc }:
2+{ stdenv, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
33
44with stdenv.lib;
55
@@ -13,6 +13,7 @@ let
1313 ];
1414
1515 project = project' {
16+ inherit compiler-nix-name;
1617 src = testSrc "cabal-simple";
1718 inherit modules;
1819 };
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 }:
22
33with stdenv.lib;
44
55let
66 project = cabalProject' {
7+ inherit compiler-nix-name;
78 index-state = "2020-05-25T00:00:00Z";
89 src = testSrc "cabal-source-repo";
910 };
test/cabal-sublib/default.nix+2−1
@@ -1,5 +1,5 @@
11# Test a package set
2−{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc }:
2+{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
33
44with stdenv.lib;
55
@@ -14,6 +14,7 @@ let
1414
1515 # The ./pkgs.nix works for linux & darwin, but not for windows
1616 project = cabalProject' {
17+ inherit compiler-nix-name;
1718 src = testSrc "cabal-sublib";
1819 inherit modules;
1920 };
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 }:
22
33with stdenv.lib;
44
@@ -6,6 +6,7 @@ let
66 # This test could use cabalProject', but it does so that it
77 # tests using callCabalProjectToNix and importAndFilterProject
88 callProjectResults = callCabalProjectToNix {
9+ inherit compiler-nix-name;
910 index-state = "2020-05-25T00:00:00Z";
1011 # reuse the cabal-simple test project
1112 src = testSrc "cabal-simple";
test/default.nix+27−29
@@ -1,10 +1,10 @@
1−let
2− haskellNix = (import ../default.nix {});
3−in
4−{ pkgs ? import nixpkgs nixpkgsArgs
5−, nixpkgs ? haskellNix.sources.nixpkgs-default
1+{ haskellNix ? import ../default.nix { inherit checkMaterialization; }
2+, pkgs ? import nixpkgs nixpkgsArgs
3+, nixpkgs ? haskellNix.sources.nixpkgs
64, nixpkgsArgs ? haskellNix.nixpkgsArgs
75, ifdLevel ? 1000
6+, compiler-nix-name
7+, checkMaterialization ? false
88}:
99
1010with pkgs;
@@ -44,7 +44,7 @@ let
4444 else val
4545 );
4646
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}; };
4848
4949 # Map the values in an association list over the withIfdInputs function.
5050 #
@@ -151,10 +151,10 @@ let
151151
152152 # All tests.
153153 allTests = {
154− cabal-simple = callTest ./cabal-simple { inherit util; };
155− cabal-simple-prof = callTest ./cabal-simple-prof { inherit util; };
156− cabal-sublib = callTest ./cabal-sublib { inherit util; };
157− cabal-22 = callTest ./cabal-22 { inherit util; };
154+ cabal-simple = callTest ./cabal-simple { inherit util compiler-nix-name; };
155+ cabal-simple-prof = callTest ./cabal-simple-prof { inherit util compiler-nix-name; };
156+ cabal-sublib = callTest ./cabal-sublib { inherit util compiler-nix-name; };
157+ cabal-22 = callTest ./cabal-22 { inherit util compiler-nix-name; };
158158 with-packages = callTest ./with-packages { inherit util; };
159159 builder-haddock = callTest ./builder-haddock {};
160160 stack-simple = callTest ./stack-simple {};
@@ -162,35 +162,33 @@ let
162162 stack-remote-resolver = callTest ./stack-remote-resolver {};
163163 snapshots = callTest ./snapshots {};
164164 shell-for = callTest ./shell-for {};
165− shell-for-setup-deps = callTest ./shell-for-setup-deps {};
166− setup-deps = import ./setup-deps { inherit pkgs; };
165+ shell-for-setup-deps = callTest ./shell-for-setup-deps { inherit compiler-nix-name; };
166+ setup-deps = import ./setup-deps { inherit pkgs compiler-nix-name; };
167167 callStackToNix = callTest ./call-stack-to-nix {};
168− callCabalProjectToNix = callTest ./call-cabal-project-to-nix {};
169− cabal-source-repo = callTest ./cabal-source-repo {};
170− buildable = callTest ./buildable {};
171− project-flags-cabal = callTest ./project-flags/cabal.nix {};
168+ callCabalProjectToNix = callTest ./call-cabal-project-to-nix { inherit compiler-nix-name; };
169+ cabal-source-repo = callTest ./cabal-source-repo { inherit compiler-nix-name; };
170+ buildable = callTest ./buildable { inherit compiler-nix-name; };
171+ project-flags-cabal = callTest ./project-flags/cabal.nix { inherit compiler-nix-name; };
172172 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; };
174174 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; };
176176 stack-source-repo = callTest ./stack-source-repo {};
177− extra-hackage = callTest ./extra-hackage {};
177+ extra-hackage = callTest ./extra-hackage { inherit compiler-nix-name; };
178178 compiler-nix-name = callTest ./compiler-nix-name {};
179− hls-cabal = callTest ./haskell-language-server/cabal.nix {};
180− hls-stack = callTest ./haskell-language-server/stack.nix {};
179+ hls-cabal = callTest ./haskell-language-server/cabal.nix { inherit compiler-nix-name; };
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; };
181183
182184 unit = unitTests;
183− } // lib.optionalAttrs (!stdenv.hostPlatform.isGhcjs && pkgs.haskell-nix.defaultCompilerNixName != "ghc8101" ) {
185+ } // lib.optionalAttrs (!stdenv.hostPlatform.isGhcjs && compiler-nix-name != "ghc8101" ) {
184186 # 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; };
186188 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 {};
191189 } // lib.optionalAttrs (!pkgs.haskell-nix.haskellLib.isCrossHost) {
192190 # 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; };
194192 };
195193
196194 # This is the same as allTests, but filter out all the key/vaules from the
@@ -218,7 +216,7 @@ let
218216in
219217
220218pkgs.recurseIntoAttrs {
221− haskellNixRoots = haskell-nix.haskellNixRoots' ifdLevel;
219+ roots = haskell-nix.roots' compiler-nix-name ifdLevel;
222220} // optionalIfdTests ifdLevel
223221
224222## more possible test cases
test/exe-only/default.nix+2−1
@@ -1,10 +1,11 @@
11# Test a package set
2−{ stdenv, util, haskell-nix, recurseIntoAttrs, haskellLib, testSrc }:
2+{ stdenv, util, haskell-nix, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
33
44with stdenv.lib;
55
66let
77 project = haskell-nix.cabalProject' {
8+ inherit compiler-nix-name;
89 src = testSrc "exe-only";
910 };
1011
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 }:
22
33with stdenv.lib;
44
@@ -14,6 +14,7 @@ let
1414 demo-src = ./external-package-demo-0.1.0.0.tar.gz;
1515
1616 project = cabalProject' {
17+ inherit compiler-nix-name;
1718 src = testSrc "extra-hackage/external-package-user";
1819
1920 extra-hackages = [ hackage ];
@@ -27,7 +28,7 @@ let
2728 };
2829 packages = project.hsPkgs;
2930
30−in project // (recurseIntoAttrs {
31+in recurseIntoAttrs {
3132 ifdInputs = {
3233 inherit (project) plan-nix;
3334 };
@@ -66,4 +67,4 @@ in project // (recurseIntoAttrs {
6667 inherit project;
6768 };
6869 };
69−})
70+}
test/fully-static/cross.nix+1−1
@@ -1,5 +1,5 @@
11{ pkgs ? import nixpkgs { }
2−, nixpkgs ? import (../../nixpkgs).nixpkgs-default
2+, nixpkgs ? import (../../nix/sources.nix).nixpkgs
33}:
44
55let
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 }:
22
33with stdenv.lib;
44
55let
66 project = cabalProject' {
7+ inherit compiler-nix-name;
78 index-state = "2020-05-25T00:00:00Z";
89 src = testSrc "ghc-options";
910 # 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 }:
22
33(buildPackages.haskell-nix.project {
4+ inherit compiler-nix-name;
45 src = evalPackages.fetchgit {
56 url = "https://github.com/haskell/haskell-language-server.git";
67 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 }:
22
33(buildPackages.haskell-nix.project {
4+ inherit compiler-nix-name;
45 src = evalPackages.fetchgit {
56 url = "https://github.com/haskell/haskell-language-server.git";
67 fetchSubmodules = true;
78 rev = "d2654185eef1b0d703cebc694e85438e20600e37";
89 sha256 = "0s0k2i0imkcn9zykhrlqq0r4ssv25mwbpdyc675xkzgl1vj1l8kd";
910 };
10− projectFileName = "stack-${haskell-nix.ghc.version}.yaml";
11+ projectFileName = "stack-${haskell-nix.compiler.${compiler-nix-name}.version}.yaml";
1112 sha256map = {
1213 "https://github.com/wz1000/shake.git"."fb3859dca2e54d1bbb2c873e68ed225fa179fbef" = "0sa0jiwgyvjsmjwpfcpvzg2p7277aa0dgra1mm6afh2rfnjphz8z";
1314 "https://github.com/peti/cabal-plan.git"."894b76c0b6bf8f7d2f881431df1f13959a8fce87" = "06iklj51d9kh9bhc42lrayypcpgkjrjvna59w920ln41rskhjr4y";
test/index-state/default.nix+6−2
@@ -1,14 +1,18 @@
11# Test a package set
2−{ stdenv, testSrc, tool }:
2+{ stdenv, testSrc, tool, compiler-nix-name }:
33
44with stdenv.lib;
55
66let
77 # The hackage-security 0.6.0.1 was uploaded at 2020-04-06T20:54:35Z
88 # 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" {
1010 version = "3.2.0.0";
1111 inherit index-state;
12+ cabalProject = ''
13+ packages: .
14+ allow-newer: cabal-install:base, hackage-security:*
15+ '';
1216 }).project.hsPkgs.hackage-security.components.library.version;
1317 version-before = version-used-at "2020-04-06T20:54:34Z";
1418 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 } :
22 (haskell-nix.hackage-package {
3+ inherit compiler-nix-name;
34 name = "pandoc";
45 version = "2.9.2.1";
56 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 }:
22
33with stdenv.lib;
44
55let
66 project = cabalProject' {
7+ inherit compiler-nix-name;
78 index-state = "2020-05-25T00:00:00Z";
89 src = testSrc "project-flags";
910 };
test/regen.nix+1−1
@@ -3,7 +3,7 @@ let
33 haskellNix = (import ../default.nix {});
44in
55{ pkgs ? import nixpkgs nixpkgsArgs
6−, nixpkgs ? haskellNix.sources.nixpkgs-default
6+, nixpkgs ? haskellNix.sources.nixpkgs
77, nixpkgsArgs ? haskellNix.nixpkgsArgs
88}:
99
test/setup-deps/default.nix+2−1
@@ -1,10 +1,11 @@
1−{ pkgs }:
1+{ pkgs, compiler-nix-name }:
22
33with pkgs;
44with stdenv.lib;
55
66let
77 project = haskell-nix.cabalProject' {
8+ inherit compiler-nix-name;
89 src = pkgs.haskell-nix.haskellLib.cleanGit { src = ../..; name = "setup-deps"; subDir = "test/setup-deps"; };
910 modules = [{
1011 # 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 }:
22
33with stdenv.lib;
44
55let
66 project = cabalProject' {
7+ inherit compiler-nix-name;
78 src = testSrc "shell-for-setup-deps";
89 modules = [{
910 # Package has no exposed modules which causes
test/shell-for/default.nix+3−3
@@ -22,7 +22,7 @@ let
2222 packages = ps: with ps; [ pkga pkgb ];
2323 # This adds cabal-install to the shell, which helps tests because
2424 # they use a nix-shell --pure. Normally you would BYO cabal-install.
25− buildInputs = [ cabal-install ];
25+ tools = { cabal = "3.2.0.0"; };
2626 exactDeps = true;
2727 };
2828
@@ -31,7 +31,7 @@ let
3131 packages = ps: with ps; [ pkga ];
3232 # This adds cabal-install to the shell, which helps tests because
3333 # they use a nix-shell --pure. Normally you would BYO cabal-install.
34− buildInputs = [ cabal-install ];
34+ tools = { cabal = "3.2.0.0"; };
3535 exactDeps = true;
3636 };
3737
@@ -41,7 +41,7 @@ let
4141 # packages = ps: with ps; [ pkga pkgb ];
4242 # This adds cabal-install to the shell, which helps tests because
4343 # they use a nix-shell --pure. Normally you would BYO cabal-install.
44− buildInputs = [ cabal-install ];
44+ tools = { cabal = "3.2.0.0"; };
4545 };
4646
4747in recurseIntoAttrs (if stdenv.hostPlatform.isWindows
test/sublib-docs/default.nix+2−1
@@ -1,10 +1,11 @@
11# Test a package set
2−{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc }:
2+{ stdenv, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name }:
33
44with stdenv.lib;
55
66let
77 project = cabalProject' {
8+ inherit compiler-nix-name;
89 src = testSrc "sublib-docs";
910 };
1011
test/tests.sh+25−9
@@ -7,6 +7,13 @@ NIX_BUILD_ARGS="${NIX_BUILD_ARGS:-}"
77
88cd $(dirname $0)
99
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+
1017printf "*** Cleaning package build directories..." >& 2
1118rm -rvf */cabal.project.local */.ghc.environment* */dist */dist-newstyle */.stack-work
1219echo >& 2
@@ -16,11 +23,12 @@ nix build $NIX_BUILD_ARGS \
1623 -I . -I .. \
1724 --option restrict-eval true \
1825 --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
2028echo >& 2
2129
2230printf "*** 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)
2432num_failed=$(jq length <<< "$res")
2533if [ $num_failed -eq 0 ]; then
2634 printf "PASSED\n" >& 2
@@ -33,6 +41,7 @@ fi
3341printf "*** Checking that a nix-shell works for runghc...\n" >& 2
3442nix-shell $NIX_BUILD_ARGS \
3543 --pure ./default.nix \
44+ --argstr compiler-nix-name $GHC \
3645 -A with-packages.test-shell \
3746 --run 'runghc with-packages/Point.hs'
3847echo >& 2
@@ -40,6 +49,7 @@ echo >& 2
4049printf "*** Checking that a nix-shell works for cabal...\n" >& 2
4150nix-shell $NIX_BUILD_ARGS \
4251 --pure ./default.nix \
52+ --argstr compiler-nix-name $GHC \
4353 -A with-packages.test-shell \
4454 --run 'echo CABAL_CONFIG=$CABAL_CONFIG && type -p ghc && cd with-packages && cabal new-build'
4555echo >& 2
@@ -47,6 +57,7 @@ echo >& 2
4757printf "*** Checking that a nix-shell works for cabal (doExactConfig component)...\n" >& 2
4858nix-shell $NIX_BUILD_ARGS \
4959 --pure ./default.nix \
60+ --argstr compiler-nix-name $GHC \
5061 -A with-packages.test-shell-dec \
5162 --run 'echo CABAL_CONFIG=$CABAL_CONFIG && echo GHC_ENVIRONMENT=$GHC_ENVIRONMENT && cd with-packages && cabal new-build'
5263echo >& 2
@@ -55,6 +66,7 @@ printf "*** Checking that a nix-shell works for a project with test-suite build-
5566printf "!!! This is expected to fail until https://github.com/input-output-hk/haskell.nix/issues/231 is resolved! \n" >& 2
5667nix-shell $NIX_BUILD_ARGS \
5768 --pure ./default.nix \
69+ --argstr compiler-nix-name $GHC \
5870 -A cabal-22.shell \
5971 --run 'cd cabal-22 && cabal new-build all --enable-tests --enable-benchmarks' \
6072 || true
@@ -63,6 +75,7 @@ echo >& 2
6375printf "*** Checking that a nix-shell works for a multi-target project...\n" >& 2
6476nix-shell $NIX_BUILD_ARGS \
6577 --pure ./default.nix \
78+ --argstr compiler-nix-name $GHC \
6679 -A cabal-simple.test-shell \
6780 --run 'cd cabal-simple && cabal new-build'
6881echo >& 2
@@ -70,6 +83,7 @@ echo >& 2
7083printf "*** Checking shellFor works for a cabal project, multiple packages...\n" >& 2
7184nix-shell $NIX_BUILD_ARGS \
7285 --pure ./default.nix \
86+ --argstr compiler-nix-name $GHC \
7387 -A shell-for.env \
7488 --run 'cd shell-for && cabal new-build all'
7589echo >& 2
@@ -77,6 +91,7 @@ echo >& 2
7791printf "*** Checking shellFor works for a cabal project, single package...\n" >& 2
7892nix-shell $NIX_BUILD_ARGS \
7993 --pure ./default.nix \
94+ --argstr compiler-nix-name $GHC \
8095 -A shell-for.envPkga \
8196 --run 'cd shell-for && cabal new-build --project=single.project all'
8297echo >& 2
@@ -84,14 +99,15 @@ echo >& 2
8499printf "*** Checking shellFor has a working hoogle index...\n" >& 2
85100nix-shell $NIX_BUILD_ARGS \
86101 --pure ./default.nix \
102+ --argstr compiler-nix-name $GHC \
87103 -A shell-for.env \
88104 --run 'hoogle ConduitT | grep Data.Conduit'
89105echo >& 2
90106
91107printf "*** 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)
93109echo "-- 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)
95111sed -i -e '/-- hello/d' shell-for/pkga/PkgA.hs
96112if [ "$drva" != "$drvb" ]; then
97113 printf "FAIL\nShell derivations\n$drva\n$drvb\n are not identical.\n" >& 2
@@ -101,19 +117,19 @@ else
101117fi
102118
103119printf "*** 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
105121echo >& 2
106122
107123printf "*** Checking that plan construction works with extra Hackages...\n" >& 2
108124nix build $NIX_BUILD_ARGS --no-link \
109− -f ./default.nix \
110− extra-hackage.plan-nix
125+ -f ./default.nix --argstr compiler-nix-name $GHC \
126+ extra-hackage.run.project.plan-nix
111127echo >& 2
112128
113129printf "*** Checking that package with extra Hackages can be build...\n" >& 2
114130nix build $NIX_BUILD_ARGS --no-link \
115− -f ./default.nix \
116− extra-hackage.hsPkgs.external-package-user.components.all
131+ -f ./default.nix --argstr compiler-nix-name $GHC \
132+ extra-hackage.run.project.hsPkgs.external-package-user.components.all
117133echo >& 2
118134
119135printf "\n*** Finished successfully\n" >& 2