Commit Graph

16 Commits

Author SHA1 Message Date
Hamish Mackenzie
a443611ecf
Add evalSystem and evalPackages project args (#1546)
This adds a way to specify the `evalSystem` or `evalPackages` explicitly when calling the `project` functions.

Currently if we want to make a `flake` that supports multiple systems we have few options:

* Require builders for all the supported systems (even just for `nix flake show`).

* Pass `--impure` so that haskell.nix can see `builtins.currentSystem` to set up `pkgs.evalPackages` to use that.  Unfortunately this prevents nix from caching some of the work it does and often results in it recalculating for each supported system when it would otherwise be cached and take no time at all.

* Add an overlay to replace `evalPackages`.  This works, but it is not straight forward.

* Materialize the nix files for the project.

This change allows `evalSystem = "x86_64-linux";` to be passed telling `haskell.nix` to run `cabal` and `nix-tools` on that system.  The user will have to have a builder for that system, but does not need to have builders for the others (unless building outputs for them).
2022-07-28 20:03:05 +12:00
Peter Becich
5f2f567c0d
use Cabal 3.6.2.0 (#1328)
* use Cabal 3.6.2.0

* ghcjs 8.10.7 materialization update

* another ghcjs 8.10.7 materialization update
2022-01-04 17:53:33 +13:00
Shea Levy
8aa77fdbd8
Update nixpkgs unstable. (#1196)
* Update nixpkgs unstable.

Plutus needs NixOS/nixpkgs#127239.

* Don't include stack tests that use ghc 8.6.5 when testing ghc 8.10.5

Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
2021-08-18 00:44:03 +12:00
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
Hamish Mackenzie
89f50a96dd
Use pkgs.lib instead of stdenv.lib (#1031)
Fixes:

Warning: `stdenv.lib` is deprecated and will be removed in the next release. Please use `pkgs.lib` instead. For more information see https://github.com/NixOS/nixpkgs/issues/108938
2021-02-11 01:07:16 +13:00
John A. Lotoski
09526c8555
Spelling, typo and whitespace fixes (#833)
* Spelling and typo fixes in doc and code comments
* Trailing whitespace or whitespace only truncation
* readTheDocs formatting corrections
2020-08-31 11:08:25 +12:00
Hamish Mackenzie
d1102d342c
Add pins and materialization for ghc-boot-packages and ghc-extra-packages (#546)
* Include `tests` in path for cross compiled tests

* Add ghc-boot-packages-nix to haskellNixRoots

* Fix naming warnings in tests sources

* Uses a single cleanGit call for all the tests

* Add memoize code for ghc-boot and ghc-extra pkgs

* Memoize ghc-boot and ghc-extra pkgs nix

* Fix release.nix being more strict than ci.nix by updating filterAttrsOnlyRecursive in ci-lib.nix

* Nicer errors when materialized path does not exist

* Updated materialization docs

* Add internalHackageIndexState to set the index-state used within haskell.nix
2020-04-20 13:27:52 +12:00
Hamish Mackenzie
a9b01221dd
Replace collectRunComponents with haskellLib.check (#316)
This change replaces `passthru.run` and `collectRunComponents` with
`haskellLib.check` and `$pkg.checks`.

Uses `ln -s` instead of `cp` for DLLs to avoid duplicating them.

Adds features to help debugging eval issues with haskell.nix/release.nix.
The ifdInputLevel can be set to limit the jobs included to control
how much work is done at the eval stage when looking for issues.

Reduce CI times by excluding older ghc versions from haskellNixRoots
(GHC 8.6.3 and 8.6.4)

Sets `preferLocalBuild=false` on `callCabalProjectToNix` and `callStackToNix`
to ensure they are cached on hydra for both Linux and macOS.

Fix `data-dir:` when cleaning components.
`normalizeRelativeDir` adds a slash on to the end of `dataDir`.
Adding another one here results in `//` and files are left out by
mistake.
2019-11-29 23:28:47 +13:00
Hamish Mackenzie
9b10945d98
Add passthru.run with wine support (#301)
This can be used to run tests, executables or benchmarks.
Instead of building drv build drv.run and the result should be the output of stdout.
2019-11-11 23:38:08 +13:00
Hamish Mackenzie
023863aeca
fix #269. Apply fix to mkStackPkgSet (#310)
First fix only fixed `haskell-nix.snapshot` by applying the fix also
to mkStackPkgSet stack.yaml based projects should work with lts 14
2019-11-09 17:01:04 +13:00
Rodney Lorrimar
686fa37877
shellFor: Fix bug where packages were not excluded from the env (#285)
* tests: Add regression test for shellFor build-tools bug

* tests: Fix regen script

* Regenerate nix expressions for tests

* tests: ghc 8.4.4 -> 8.6.5

* shellFor: Fix bug where packages were not excluded from the env

If a multi-package project had an build-tools dependency between
packages, they would not be correctly removed from the shell's inputs.
2019-11-01 20:08:31 +10:00
Rodney Lorrimar
3bb58214f1
Add cross-compiled musl libc builds of tests (#157)
* Add cross-compiled musl libc builds of tests

* Bump nixpkgs to latest 19.03

* tests: Update stack-simple LTS

* docs: Add note about tests

* Regenerate tests

* haskellPackages: lts-13.18 -> lts-13.26

This contains GHC 8.6.5 which can successfully build under
pkgsCross.musl64, whereas GHC 8.6.4 could not.

* Bump nix-tools

* Regenerate nix-tools -- changed compiler from GHC 8.6.4 -> GHC 8.6.5.
2019-07-02 18:25:40 +10:00
Rodney Lorrimar
0e02f1fb68 Regenerate nix for test/stack-simple 2019-05-07 15:31:35 +08:00
Moritz Angermann
1eebaa0095 Update stack.yaml 2019-05-07 15:31:35 +08:00
Moritz Angermann
8ee6fcfba7
Rename pkg-def-overlays to pkg-def-extras (#79)
* Rename pkg-def-overlays to pkg-def-extras

Fixes #75
2019-03-15 11:10:57 +08:00
Rodney Lorrimar
cf8d73321c
tests: Add stack-simple 2019-02-13 14:51:10 +10:00