Commit Graph

567 Commits

Author SHA1 Message Date
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
IOHK
d8ab386a67 Update Hackage and Stackage 2019-11-19 01:09:24 +00:00
David Cao
cb8e3883b7 Add error message for empty src (#320)
When a project's source directory is empty (i.e. no files have been
added to the project's corresponding git repo), a more friendly error
message will now be printed
2019-11-19 09:27:49 +10:00
Rodney Lorrimar
2e4b4ebbb3
cleanSourceHaskell: Add more filters (#314)
* cleanSourceHaskell: Add more filters

* cleanSourceHaskell: Add a "name" parameter, split away the filter

* cleanSourceHaskell: Make it compatible with nixpkgs-19.03

* Adjust usage of cleanSourceHaskell in nix-tools
2019-11-18 16:46:39 +10:00
IOHK
5fa379ebc7 Update Hackage and Stackage 2019-11-18 01:07:39 +00:00
IOHK
b5792d522e Update Hackage and Stackage 2019-11-17 01:09:49 +00:00
IOHK
08b624d66d Update Hackage and Stackage 2019-11-16 01:16:43 +00:00
Hamish Mackenzie
19248b5a15
Revert "Disable all the tests except the haskellNixRoots"
This reverts commit 2000983bb0.
2019-11-15 14:20:16 +13:00
IOHK
2bebeb3fa2 Update Hackage and Stackage 2019-11-15 01:07:59 +00:00
Hamish Mackenzie
2000983bb0
Disable all the tests except the haskellNixRoots 2019-11-15 12:49:36 +13:00
Toon Nolten
6e95ba56f1 Add information about the binary cache to README.org (#300)
* Add information about the binary cache to README.org

* Add binary cache section to the User Guide

Put the subsection right above "Using Haskell.nix with your project" in
the General section of the User Guide so new users are likely to see it.
2019-11-14 10:35:21 +08:00
IOHK
34ed9da46f Update Hackage and Stackage 2019-11-14 01:07:47 +00:00
Hamish Mackenzie
ef4b453f8d
Apply binutils fix to only macOS (#315) 2019-11-13 21:57:38 +13:00
IOHK
17bbb2bd43 Update Hackage and Stackage 2019-11-13 01:11:51 +00:00
IOHK
8e248b3718 Update Hackage and Stackage 2019-11-12 01:09:08 +00: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
IOHK
8d1ba984b4 Update Hackage and Stackage 2019-11-11 01:09:48 +00:00
Hamish Mackenzie
7d96b156c5
Check ghc used is haskell-nix.compiler one (#312)
It is easy to mistakenly pass in a `haskell.compiler.ghcXXX` compiler
instead of a `haskell-nix.compiler.ghcXXX` one.  This leads to subtle
bugs (for instance missing Cabal library patch).
2019-11-11 01:01:30 +13:00
Hamish Mackenzie
3c78559621
Fix cleaning git submodules not in a worktree (#311)
When we are not in a worktree the submodule info is in the
`.git` dirs scattered throughout the repo itself.  In that situation
we need to copy the `.git` dirs into the temp location we are using
to run `git ls-files`.
2019-11-10 14:25:26 +13:00
IOHK
baff1981fc Update Hackage and Stackage 2019-11-10 01:06:58 +00: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
IOHK
6b7ac2ca4d Update Hackage and Stackage 2019-11-09 01:09:55 +00:00
Hamish Mackenzie
be5ce45b31
Exclude pre/postCheck from all used by shellFor (#306)
Without this fix `shellFor` fails for packages where a component has
a `preCheck` or `postCheck` option set.  It should be safe to exclude
these because `shellFor` uses `phases = ["installPhase"]` and it seems
like a bad idea to use `all` for running tests (better to run the
individual `tests` components).
2019-11-08 21:01:47 +13:00
Hamish Mackenzie
26d7b00f1d
Custom args to cabal new-configure IFD functions (#305) 2019-11-08 17:53:05 +13:00
Hamish Mackenzie
707c7b82f4
Fix cleanGit for repositories with no submodules (#304) 2019-11-08 17:52:41 +13:00
IOHK
00bdfda351 Update Hackage and Stackage 2019-11-08 01:08:31 +00:00
Hamish Mackenzie
f2fffb6dd3
Update haskell-nix.haskellPackages to lts-14.13 (#299) 2019-11-07 15:39:29 +13:00
IOHK
df8c1c6332 Update Hackage and Stackage 2019-11-07 01:08:30 +00:00
Hamish Mackenzie
b8af9902c2
Use latest cardano-wallet for testing (#296)
Updates the cabal-wallet tests in ci.nix so that they use the
latest master and adds the modules from there.
2019-11-06 23:42:12 +13:00
Moritz Angermann
4d8603afcd build more plutus pkgs (#268)
Build more plutus pkgs in ci.nix
2019-11-06 23:41:27 +13:00
Hamish Mackenzie
5393c501e2
Fix cleanGit when using a worktree (#282)
Joachim's original version had logic to handle git worktree's but
it was not wired into the updated version that uses cleanSourceWith.
2019-11-06 22:44:09 +13:00
Hamish Mackenzie
22e8da5810
Fix #269 by not looking for libiserv in hackage (#297)
Also fixes packages like that depend on the `ghc` library.
2019-11-06 14:33:48 +13:00
IOHK
d78267d317 Update Hackage and Stackage 2019-11-06 01:10:17 +00:00
Hamish Mackenzie
c258167a50
Fix components.all for exe only packages (#295)
Currently the builder tries and fails to register a non existent
library component.
2019-11-05 19:49:12 +13:00
Hamish Mackenzie
63fc8bec4c
Add stack-nix to stackProject (#293)
Like `plan-nix` for `cabalProject` this gives us a way to inspect the
nix files generated by `stack-to-nix`.  It may also adds `stackProject'`
that like `cabalProject'` allows us to get `stack-nix` independently of
hsPkgs (to avoid unwanted evaluation).  This can be useful for caching
and preventing GC of evaluation time dependencies of the project.
2019-11-05 19:36:48 +13:00
IOHK
8406e45c8e Update Hackage and Stackage 2019-11-05 01:09:54 +00:00
Hamish Mackenzie
612e983daa
Move all of haskell.nix into haskell-nix (#289)
Currently the haskell.nix overlays replace `haskell` and
`haskellPackages` in the root of pkgs with versions that have just a
fraction of what nixpkgs provides.
Although `haskell-nix.haskellPackages` could be used to provide a much
more complete set there are subtle differences that are likely to cause
issues (and nixpkgs has patches for many haskell packages).

To make it possible for haskell.nix and nixpkgs haskell to coexist,
we need to move the remaining parts of haskell.nix outside of the
`haskell-nix` attribute into `haskell-nix`.

```
  ghc                        -> haskell-nix.ghc
  cabal-install              -> haskell-nix.cabal-install
  haskell.compiler           -> haskell-nix.compiler
  haskell.packages           -> haskell-nix.packages
  bootstrap.haskell.compiler -> haskell-nix.bootstrap.compiler
  bootstrap.haskell.packages -> haskell-nix.bootstrap.packages
```

The following `haskellPackages` have been removed and instead the
nixpkgs versions will now be in `haskellPackages`.  User code should
be updated if the nixpkgs versions are not desired:

```
  haskellPackages.hoogle
    -> haskell-nix.haskellPackages.hoogle.components.exes.hoogle
  haskellPackages.happy
    -> haskell-nix.haskellPackages.happy.components.exes.happy
  haskellPackages.alex
    -> haskell-nix.haskellPackages.alex.components.exes.alex;
```

Guard code has been added to overlays/defaults.nix to prevent us
inadvertently depending on the nixpkgs `haskell` or `haskellPackages`
inside the haskell.nix code base.
2019-11-05 12:50:50 +13:00
Hamish Mackenzie
fe5c3a2a04
components.setup is not a library (#292)
We added a setup component to allow overriding of the config used to
to build Setup.hs.  The code that deals with library components
was misidentifying this component as a library.
2019-11-05 00:52:58 +13:00
IOHK
7ea94efaff Update Hackage and Stackage 2019-11-04 01:11:57 +00:00
Hamish Mackenzie
1640c35ed2
Add names to tests that have an index-state (#288) 2019-11-04 11:29:34 +13:00
IOHK
939ef1885d Update Hackage and Stackage 2019-11-03 01:08:04 +00:00
IOHK
01b390e5a6 Update Hackage and Stackage 2019-11-02 01:06:48 +00:00
Hamish Mackenzie
4d27798d6d
Use fixed output derivations for bootstrap plans (#286)
Currently when a dependency of cabal-install or plan-to-nix changes
the cabal new-configure and plan-to-nix have to be rebuilt in order
to recalculate the plan-nix for bootstrap packages alex, happy and
hscolour.  We have pinned the inputs such as hackage index-state
so that the plan generated should be the same.  Unfortunately it can
still result in a long wait.

Haskell.nix does cache the result via haskellNixRoots when built on
iohk's hydra server.  But if you use a different version of nixpkgs
it is unlikely to work.  If you have access to a CI that populates a
nix cache you can add haskellNixRoots to your CI build, but if not
you are kind of stuck.

One option to help with this would be to include the plan-to-nix output
in the haskell.nix git repository.  But intermediate files in git is
not nice.

Instead this PR adds just the hashes of the output to the derivations
that runs plan-to-nix.  Since the inputs are fixed or should have
no affect on the result (GCC version for instance), we should
be able to rely on them remaining constant.
2019-11-02 01:21:30 +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
IOHK
01bc2e2ddf Update Hackage and Stackage 2019-11-01 01:08:29 +00:00
Hamish Mackenzie
a5f9f45922
Test setup deps issue depending on ghc and Cabal (#278)
Projects like asterius and leksah that include dependencies on ghc. Sometimes the are needed by a setup.hs file (as is the case for the binaryen package used by asterius). The recent overlays merge broke this and #279 was needed to allow reinstallableLibGhc to be used to fix it. This PR adds a test case to make sure it is not inadvertently broken again. Also gives us a place to try out better ways to make this type of package work.* Test setup deps issue depending on ghc and Cabal

* Uses nixpkgs 19.09 + macOS wine fix on hydra/buildkite

* Enables macOS hydra tests

* disables musl tests for now

* Adds haskellNixRoots to tests

* Uses reinstallableLibGhc to fix the new setup-depends test

* Adds meta.platforms to haskell.nix components

* Set meta.platforms on cabal-install

* Builds some maintainer-scripts on hydra

* Pins hackage index-state for ghc-extra-packages
2019-11-01 12:34:10 +13:00
Hamish Mackenzie
e15c59ba2e
Give more control over the compilation of Setup.hs (#277)
Allows adding of overrides through package.components.setup.
I need this to specify frameworks that Setup.hs needs on macOS.
2019-10-31 19:15:07 +13:00
IOHK
ccd1349402 Update Hackage and Stackage 2019-10-31 01:10:03 +00:00
Hamish Mackenzie
23e0c2fcea
Add subDir argument to cleanGit (#280)
Co-Authored-By: Viktor Kronvall <viktor.kronvall@gmail.com>
2019-10-30 15:09:45 +13:00
IOHK
e920ddf698 Update Hackage and Stackage 2019-10-30 01:10:02 +00:00