haskell.nix/build.nix
Hamish Mackenzie 79c2c631c3
Run the cross compiled tests on wine (#317)
Changes to the haskell.nix code to fix broken tests:

* Add missing `then` to `call-cabal-project-to-nix.nix`.

* Fix default `hsSourceDirs` so that `.` gets included for `.all` component if one of the components does not have a `hsSourceDir` set.

* Fix `haskellNixRoots` so it works when cross compiling to windows.

Improvements to the haskell.nix tests:

* Run haskell.nix tests of nixpkgs 19.03 and 19.09.

* Run haskell.nix tests cross compiled to Windows under Wine (when possible).

* Add nix used as IFD inputs as tests to ensure they are cached.

* Use `haskell-nix.cabal-install` instead of `nixpkgs.cabal-install` in tests.
2019-11-20 13:47:15 +13:00

71 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.
{ nixpkgs ? ./nixpkgs
# Provide args to the nixpkgs instantiation.
, system ? builtins.currentSystem
, crossSystem ? null
, config ? {}
, nixpkgsArgs ? { inherit system crossSystem; }
}:
let
haskellNixArgs = import ./default.nix;
pkgs = import nixpkgs ({
config = haskellNixArgs.config // config;
overlays = haskellNixArgs.overlays ++
[(self: super: {
darcs = (self.haskell-nix.hackage-package {
name = "darcs";
version = "2.14.2";
index-state = "2019-10-28T00:00:00Z";
plan-sha256 = "1h8dxib0wz6mg8md6ldwa54dsr1dn7vxfij8cfhdawl4y3wr51k0";
# Apply the latest darcs.net Setup.hs patches
modules = [{packages.darcs.patches = [ ./patches/darcs-setup.patch ];}];
}).components.exes.darcs;
})]; } // nixpkgsArgs);
haskell = pkgs.haskell-nix;
in rec {
tests = import ./test/default.nix { inherit nixpkgs nixpkgsArgs; };
# 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 = import ./scripts/options-doc.nix {
# nixpkgs unstable changes "Option has no description" from an
# error into a warning. That is quite helpful when hardly any
# of our options are documented, thanks @oxij.
pkgs = import (pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
rev = "4ab1c14714fc97a27655f3a6877386da3cb237bc";
sha256 = "16lcj9552q2jfxc27j6116qkf2vl2dcj7vhg5gdq4qi51d891yhn";
}) {};
};
};
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 {
inherit (maintainer-scripts) update-docs check-hydra 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;
};
}