haskell.nix/test
Hamish Mackenzie 674f5b0a3d
Better support for source-repository-packages, only include planned components and pick latest packages (#1166)
This change updates to the latest `nix-tools` to get the following fixes (there are 3 PRs in nix-tools, but just the one in haskell.nix to avoid having to update the materialized files multiple times):

## Better support for source repository packages

* https://github.com/input-output-hk/nix-tools/pull/107

Currently these are replaced by the `cabalProject` functions with regular `packages:` before running cabal configure.  Cabal does not treat these the same (the setting of `tests:` and `benchmarks:` in the `cabal.project` file):

* The plan found by `cabalProject` may not match the one used when running `cabal`.
* The performance of the solver may not be consistent with running `cabal`.

This change replaces `source-repository-package` with another `source-repository-package` pointing at a minimal git repo.

## Only include planned components

* https://github.com/input-output-hk/nix-tools/pull/108

Only the components in the `plan.json` are now included in the haskell.nix cabal projects.  This avoids missing dependencies attempting to build components that were not in the plan.  Should fix #993.

## Pick latest packages

* https://github.com/input-output-hk/nix-tools/pull/109

When the same package occurs more than once in a `plan.json` file (perhaps because it is needed both by the project itself and by one of the `setup` dependencies or `build-tool-dependencies` of the project) the latest version will now be the one picked by haskell.nix. This is a work around for a common issue with `cabal-doctest` when cross compiling to windows (an old version of Win32 is used even if a newer one was required by the projects `constraints`).
2021-07-23 14:27:56 +12:00
..
buildable Add GHC 9.0.1 (#1032) 2021-03-28 21:03:20 +13:00
builder-haddock Better support for source-repository-packages, only include planned components and pick latest packages (#1166) 2021-07-23 14:27:56 +12:00
cabal-22 Add GHC 9.0.1 (#1032) 2021-03-28 21:03:20 +13:00
cabal-doctests niv update nixpkgs-unstable and add ghc 8.10.5 (#1121) 2021-06-15 19:50:45 +12:00
cabal-hpack Use pkgs.lib instead of stdenv.lib (#1031) 2021-02-11 01:07:16 +13:00
cabal-simple Add GHC 9.0.1 (#1032) 2021-03-28 21:03:20 +13:00
cabal-simple-debug Add GHC 9.0.1 (#1032) 2021-03-28 21:03:20 +13:00
cabal-simple-prof GHCJS 8.10 (#1082) 2021-03-29 22:36:47 +13:00
cabal-source-repo Add GHC 9.0.1 (#1032) 2021-03-28 21:03:20 +13:00
cabal-source-repo-comments Add GHC 9.0.1 (#1032) 2021-03-28 21:03:20 +13:00
cabal-sublib Switch from cabal 3.2 to 3.4 (#1058) 2021-03-01 15:42:23 +13:00
call-cabal-project-to-nix Add GHC 9.0.1 (#1032) 2021-03-28 21:03:20 +13:00
call-stack-to-nix Bump internal-* to ghc 8.10.4 (from 8.8.4) (#1129) 2021-06-02 14:40:24 +12:00
coverage Add GHC 9.0.1 (#1032) 2021-03-28 21:03:20 +13:00
coverage-golden niv update nixpkgs-unstable and add ghc 8.10.5 (#1121) 2021-06-15 19:50:45 +12:00
coverage-no-libs Add GHC 9.0.1 (#1032) 2021-03-28 21:03:20 +13:00
exe-only Use pkgs.lib instead of stdenv.lib (#1031) 2021-02-11 01:07:16 +13:00
extra-hackage Use pkgs.lib instead of stdenv.lib (#1031) 2021-02-11 01:07:16 +13:00
fully-static Use pkgs.lib instead of stdenv.lib (#1031) 2021-02-11 01:07:16 +13:00
ghc-options Update internalHackageIndexState (#1139) 2021-06-16 22:10:42 +12:00
githash Add GHC 9.0.1 (#1032) 2021-03-28 21:03:20 +13:00
haskell-language-server Better error message when building missing ghcjs (#1140) 2021-06-17 11:57:21 +12:00
index-state GHCJS 8.10 (#1082) 2021-03-29 22:36:47 +13:00
lookup-sha256 Add GHC 9.0.1 (#1032) 2021-03-28 21:03:20 +13:00
project-flags Add GHC 9.0.1 (#1032) 2021-03-28 21:03:20 +13:00
setup-deps niv update nixpkgs-unstable and add ghc 8.10.5 (#1121) 2021-06-15 19:50:45 +12:00
shell-for Better support for source-repository-packages, only include planned components and pick latest packages (#1166) 2021-07-23 14:27:56 +12:00
shell-for-setup-deps GHCJS 8.10 (#1082) 2021-03-29 22:36:47 +13:00
snapshots Add GHC 9.0.1 (#1032) 2021-03-28 21:03:20 +13:00
stack-local-resolver Add haskell-nix.project (and project') (#703) 2020-06-19 20:07:19 +12:00
stack-local-resolver-subdir Fix stack.yaml filtering when resolver file is in a subdirectory (#943) 2020-12-09 17:43:36 +13:00
stack-remote-resolver download stack resolver if a sha256 is provided (#748) 2020-07-04 14:35:52 +12:00
stack-simple Better support for source-repository-packages, only include planned components and pick latest packages (#1166) 2021-07-23 14:27:56 +12:00
stack-source-repo Add pins and materialization for ghc-boot-packages and ghc-extra-packages (#546) 2020-04-20 13:27:52 +12:00
sublib-docs Add GHC 9.0.1 (#1032) 2021-03-28 21:03:20 +13:00
with-packages Better support for source-repository-packages, only include planned components and pick latest packages (#1166) 2021-07-23 14:27:56 +12:00
default.nix niv update nixpkgs-unstable and add ghc 8.10.5 (#1121) 2021-06-15 19:50:45 +12:00
README.md Add cross-compiled musl libc builds of tests (#157) 2019-07-02 18:25:40 +10:00
regen.nix Spelling, typo and whitespace fixes (#833) 2020-08-31 11:08:25 +12:00
tests.sh Remove components.all (#776) 2020-07-21 16:06:54 +12:00
unit.nix Better support for source-repository-packages, only include planned components and pick latest packages (#1166) 2021-07-23 14:27:56 +12:00
util.nix tests: Add more tests for "all" component merging 2019-02-07 09:39:12 +08:00

Haskell infrastructure test cases

To build the test cases, run from the test directory:

nix-build --no-out-link default.nix

To run all tests (includes impure tests), use the script:

./tests.sh

Generated code

If you change the test Cabal files or need to regenerate the code with nix-tools, then see regen.nix. Run it like this:

$(nix-build --no-out-link regen.nix)