haskell.nix/build.nix
Hamish Mackenzie 49cbd34534
remove creation of relative links in package db (#569)
Changing from absolute links to relative links increases the length of
the parameters passed during linking by half. For things that have many
dependencies, this results in linking failing with an "argument list too
long" error.

Fixes #562

This change also updates the CI configuration files to help make
it easier for CI to cope with this sort of change.

Co-authored-by: Richard Wallace <richard.wallace@simspace.com>
2020-05-01 16:49:22 +12:00

68 lines
2.9 KiB
Nix

# This file contains the package set used by the release.nix jobset.
#
# It is separate from default.nix because that file is the public API
# of Haskell.nix, which shouldn't have tests, etc.
let
haskellNix = (import ./default.nix {});
in
{ nixpkgs ? haskellNix.sources.nixpkgs-default
, nixpkgsArgs ? haskellNix.nixpkgsArgs
, pkgs ? import nixpkgs nixpkgsArgs
, ifdLevel ? 1000
}:
let
haskell = pkgs.haskell-nix;
in rec {
tests = import ./test/default.nix { inherit pkgs ifdLevel; };
tools = pkgs.lib.optionalAttrs (ifdLevel >= 3)
(pkgs.recurseIntoAttrs
(pkgs.lib.mapAttrs (_: ghc:
let
tool = name: version: pkgs.buildPackages.haskell-nix.tool name { inherit version ghc; };
in pkgs.recurseIntoAttrs {
cabal-32 = tool "cabal" "3.2.0.0";
ghcide = tool "ghcide" "object-code";
} // pkgs.lib.optionalAttrs (ghc.version == "8.6.5") {
cabal-30 = tool "cabal" "3.0.0.0";
}) { inherit (pkgs.buildPackages.haskell-nix.compiler) ghc865 ghc883; }));
# Scripts for keeping Hackage and Stackage up to date, and CI tasks.
# The dontRecurseIntoAttrs prevents these from building on hydra
# as not all of them can work in restricted eval mode (as they
# are not pure).
maintainer-scripts = pkgs.dontRecurseIntoAttrs {
update-hackage = haskell.callPackage ./scripts/update-hackage.nix {};
update-stackage = haskell.callPackage ./scripts/update-stackage.nix {};
update-pins = haskell.callPackage ./scripts/update-pins.nix {};
update-docs = pkgs.buildPackages.callPackage ./scripts/update-docs.nix {
generatedOptions = pkgs.callPackage ./scripts/options-doc.nix { };
};
# Because this is going to be used to test caching on hydra, it must not
# use the darcs package from the haskell.nix we are testing. For that reason
# it uses `pkgs.buildPackages.callPackage` not `haskell.callPackage`
# (We could pull in darcs from a known good haskell.nix for hydra to
# use)
check-hydra = pkgs.buildPackages.callPackage ./scripts/check-hydra.nix {};
check-closure-size = pkgs.buildPackages.callPackage ./scripts/check-closure-size.nix {
inherit (haskell) nix-tools;
};
};
# These are pure parts of maintainer-script so they can be built by hydra
# and added to the cache to speed up buildkite.
maintainer-script-cache = pkgs.recurseIntoAttrs (
(pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isWindows {
inherit (maintainer-scripts) check-hydra;
})
// (pkgs.lib.optionalAttrs (ifdLevel > 2) {
inherit (maintainer-scripts) update-docs check-closure-size;
# Some of the dependencies of the impure scripts so that they will
# will be in the cache too for buildkite.
inherit (pkgs.buildPackages) glibc coreutils git openssh cabal-install nix-prefetch-git;
inherit (haskell) nix-tools;
})
);
}