on hkm/aarch64-linux-remote-fix help sign in
haskell.nix/build.nix
86 lines 4.1 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-2009
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 } // pkgs.lib.optionalAttrs (compiler-nix-name != "ghc901") {
26 hls-latest = tool compiler-nix-name "haskell-language-server" "latest";
27 hlint-latest = tool compiler-nix-name "hlint" (if compiler-nix-name == "ghc865" then "3.2.7" else "latest");
28 })
29 );
31 # Scripts for keeping Hackage and Stackage up to date, and CI tasks.
32 # The dontRecurseIntoAttrs prevents these from building on hydra
33 # as not all of them can work in restricted eval mode (as they
34 # are not pure).
35 maintainer-scripts = pkgs.dontRecurseIntoAttrs {
36 update-hackage = import ./scripts/update-hackage.nix {
37 inherit (pkgs) stdenv lib writeScript coreutils glibc git
38 openssh nixFlakes 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 lib writeScript coreutils glibc git
46 openssh nixFlakes 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 };
51 update-pins = haskell.callPackage ./scripts/update-pins.nix {};
52 update-docs = pkgs.buildPackages.callPackage ./scripts/update-docs.nix {
53 generatedOptions = pkgs.callPackage ./scripts/options-doc.nix { };
54 };
55 # Because this is going to be used to test caching on hydra, it must not
56 # use the darcs package from the haskell.nix we are testing. For that reason
57 # it uses `pkgs.buildPackages.callPackage` not `haskell.callPackage`
58 # (We could pull in darcs from a known good haskell.nix for hydra to
59 # use)
60 check-hydra = pkgs.buildPackages.callPackage ./scripts/check-hydra.nix {};
61 check-closure-size = pkgs.buildPackages.callPackage ./scripts/check-closure-size.nix {
62 # Includes cabal-install since this is commonly used.
63 nix-tools = pkgs.linkFarm "common-tools" [
64 { name = "nix-tools"; path = haskell.nix-tools.${compiler-nix-name}; }
65 { name = "cabal-install"; path = haskell.cabal-install.${compiler-nix-name}; }
66 ];
67 };
68 check-materialization-concurrency = pkgs.buildPackages.callPackage ./scripts/check-materialization-concurrency/check.nix {};
69 check-path-support = pkgs.buildPackages.callPackage ./scripts/check-path-support.nix {};
70 };
72 # These are pure parts of maintainer-script so they can be built by hydra
73 # and added to the cache to speed up buildkite.
74 maintainer-script-cache = pkgs.recurseIntoAttrs (
75 (pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isWindows {
76 inherit (maintainer-scripts) check-hydra;
77 })
78 // (pkgs.lib.optionalAttrs (ifdLevel > 2) {
79 inherit (maintainer-scripts) update-docs check-closure-size;
80 # Some of the dependencies of the impure scripts so that they will
81 # will be in the cache too for buildkite.
82 inherit (pkgs.buildPackages) glibc coreutils git openssh cabal-install nix-prefetch-git;
83 inherit (haskell) nix-tools;
84 })
85 );