on hkm/remove-hls-hackage-pin help sign in
haskell.nix/build.nix
85 lines 4.0 kB history raw
1# This file contains the package set used by the release.nix jobset.
2#
3# It is separate from default.nix because that file is the public API
4# of Haskell.nix, which shouldn't have tests, etc.
5let
6 haskellNix = (import ./default.nix {});
7in
8{ nixpkgs ? haskellNix.sources.nixpkgs
9, nixpkgsArgs ? haskellNix.nixpkgsArgs
10, pkgs ? import nixpkgs nixpkgsArgs
11, ifdLevel ? 1000
12, compiler-nix-name ? throw "No `compiler-nix-name` passed to build.nix"
13}:
15let
16 haskell = pkgs.haskell-nix;
17 buildHaskell = pkgs.buildPackages.haskell-nix;
18 tool = buildHaskell.tool;
19in rec {
20 tests = import ./test/default.nix { inherit pkgs ifdLevel compiler-nix-name; };
22 tools = pkgs.lib.optionalAttrs (ifdLevel >= 3) (
23 pkgs.recurseIntoAttrs {
24 cabal-latest = tool compiler-nix-name "cabal" "latest";
25 hls-latest = tool compiler-nix-name "haskell-language-server" "latest";
26 hlint-latest = tool compiler-nix-name "hlint" "latest";
27 }
28 );
30 # Scripts for keeping Hackage and Stackage up to date, and CI tasks.
31 # The dontRecurseIntoAttrs prevents these from building on hydra
32 # as not all of them can work in restricted eval mode (as they
33 # are not pure).
34 maintainer-scripts = pkgs.dontRecurseIntoAttrs {
35 update-hackage = import ./scripts/update-hackage.nix {
36 inherit (pkgs) stdenv lib writeScript coreutils glibc git
37 openssh nix-prefetch-git gawk bash curl findutils;
38 # Update scripts use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
39 nix-tools = haskell.internal-nix-tools;
40 cabal-install = haskell.internal-cabal-install;
41 inherit (haskell) update-index-state-hashes;
42 };
43 update-stackage = haskell.callPackage ./scripts/update-stackage.nix {
44 inherit (pkgs) stdenv lib writeScript coreutils glibc git
45 openssh nix-prefetch-git gawk bash curl findutils;
46 # Update scripts use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
47 nix-tools = haskell.internal-nix-tools;
48 cabal-install = haskell.internal-cabal-install;
49 };
50 update-pins = haskell.callPackage ./scripts/update-pins.nix {};
51 update-docs = pkgs.buildPackages.callPackage ./scripts/update-docs.nix {
52 generatedOptions = pkgs.callPackage ./scripts/options-doc.nix { };
53 };
54 # Because this is going to be used to test caching on hydra, it must not
55 # use the darcs package from the haskell.nix we are testing. For that reason
56 # it uses `pkgs.buildPackages.callPackage` not `haskell.callPackage`
57 # (We could pull in darcs from a known good haskell.nix for hydra to
58 # use)
59 check-hydra = pkgs.buildPackages.callPackage ./scripts/check-hydra.nix {};
60 check-closure-size = pkgs.buildPackages.callPackage ./scripts/check-closure-size.nix {
61 # Includes cabal-install since this is commonly used.
62 nix-tools = pkgs.linkFarm "common-tools" [
63 { name = "nix-tools"; path = haskell.nix-tools.${compiler-nix-name}; }
64 { name = "cabal-install"; path = haskell.cabal-install.${compiler-nix-name}; }
65 ];
66 };
67 check-materialization-concurrency = pkgs.buildPackages.callPackage ./scripts/check-materialization-concurrency/check.nix {};
68 check-path-support = pkgs.buildPackages.callPackage ./scripts/check-path-support.nix {};
69 };
71 # These are pure parts of maintainer-script so they can be built by hydra
72 # and added to the cache to speed up buildkite.
73 maintainer-script-cache = pkgs.recurseIntoAttrs (
74 (pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isWindows {
75 inherit (maintainer-scripts) check-hydra;
76 })
77 // (pkgs.lib.optionalAttrs (ifdLevel > 2) {
78 inherit (maintainer-scripts) update-docs check-closure-size;
79 # Some of the dependencies of the impure scripts so that they will
80 # will be in the cache too for buildkite.
81 inherit (pkgs.buildPackages) glibc coreutils git openssh cabal-install nix-prefetch-git;
82 inherit (haskell) nix-tools;
83 })
84 );