Commit Graph

190 Commits

Author SHA1 Message Date
Hamish Mackenzie ec0c59e2de Support for packages with only tests (#1732)
* Support for packages with only tests

Fixes #362

* Fix for ghcjs
2022-10-03 15:39:47 +13:00
Maxim Koltsov a30665693a Fixes re source-repository-package (#1715)
* Fix regex to match source-repository-package tag

Regex to tell ref from rev was wrong

* Fix fetchGit call when rev and sha256 unspecified

* Update expected output for unit test

* Auto retry concurrency check that keeps failing

Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
2022-09-30 13:33:56 +13:00
Hamish Mackenzie 884ef3aa37 Fix test/tests.sh for other ghc versions (#1719)
Fixes #1482
2022-09-30 01:22:37 +13:00
Hamish Mackenzie 64e8460c35 Bump nixpkgs pins (#1710)
* Fix ghcjs for time_t is 64bit in emscripten now.
* Fix error: qca2 has been removed, because it depended on qt4.
* Add spdx 3.18 materialization.
* Turn off building tests for wine-5.4 (due to IDL issue).
* Fix options-doc.nix.
* Comment added to force rebuild on hydra
2022-09-27 13:00:15 +13:00
Peter Becich 965c7acf2c Update HPC for better compatibility with large projects (#1484)
* patch hpc to allow files to be used for the list of src dirs, hpc dirs, and includes

* delete trailing whitespace

* use Response Files for HPC arguments; delete unnecessary patch

* Add ghc patch based on what was merged upstream

* Fix coverage tests

* Update responseFile usage

* Enable coverage-no-libs test

Co-authored-by: Richard Wallace <rwallace@thewallacepack.net>
Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
2022-09-14 21:24:21 +12:00
Hamish Mackenzie c683efad28 Bump nixpkgs pin used in default.nix (#1649)
* Bump nixpkgs pin used in default.nix

Making it match the current 22.05 pin in flake.lock.

Was going to do this because of #1648, but might save some people a nixpkgs download so let's do it anyway.

* Fix test issue

* Use flake.lock

* Use flake.lock
2022-09-09 18:23:46 +12:00
Hamish Mackenzie 5968c65cdb Fix test.sh (#1645) 2022-09-07 13:48:10 +12:00
Yvan Sraka d457723ac6 Split calls to test/test.sh into several buildkite jobs (#1629) 2022-08-30 09:48:20 +00:00
Yvan Sraka cc8f2c6f24 Fix #1600: add end-2-end test of hix project initialization and flakes development shell (#1601) 2022-08-30 20:24:02 +12:00
Yvan Sraka a2a29bd368 Use nix --accept-flake-config option rather than yes | in CI tests (#1626)
https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-accept-flake-config
2022-08-30 11:30:09 +12:00
Hamish Mackenzie 8da47f2dbb hpc patch and test fixes from #1484 (#1620)
We should be able to merge these without risking breaking existing coverage reports. Then we can merge #1484 once we are happy it is working.
2022-08-29 19:42:32 +12:00
Yvan Sraka 18c1b768ad Fix a typo in warning message of test/tests.sh CLI usage (#1609) 2022-08-23 11:59:06 +12:00
Yvan Sraka ca5e07e4f0 Make test logs more verbose using bash -x option (#1610) 2022-08-23 11:58:27 +12:00
Yvan Sraka 3b5d165368 Add a custom nix.conf file for CI tests (#1611)
This should unstuck both #1579 and #1601 ...

n.b. This is enabled only when `CI` env variable is set, to not bother
normal users in their interactive tests ;)
2022-08-23 11:56:54 +12:00
Hamish Mackenzie fe7d738070 Fix hls build for ghc 9.2 (#1592)
This adds `flags: -haddockcomments` to the default cabal.project of haskell-language-server to fix building on ghc 9.2
2022-08-18 18:32:16 +12:00
Hamish Mackenzie 1662092eab Fix for tests broken by cabal update in hackage (#1585) 2022-08-18 14:45:17 +12:00
Hamish Mackenzie 61dea04edb Nixify hackage-to-nix output (#1574)
We have been using `readFile` and `fromJSON` to read a `.json` a 60MB .json file.  This change puts the information contained in the json file into `.nix` files that are imported when needed (rather than all at once).  This seems to save around 1s at eval time.

Tested with:
```
time nix-instantiate -E '(import ./. {}).pkgs-unstable.haskell-nix.tool "ghc8107" "hello" {}'
time nix-instantiate -E '(import ./. {}).pkgs-unstable.haskell-nix.tool "ghc8107" "haskell-language-server" {}'
```

See also https://github.com/input-output-hk/nix-tools/pull/118
2022-08-04 18:31:16 +12:00
Hamish Mackenzie c2f14344f1 Add ghc 9.2.4 (#1566) 2022-07-31 21:41:50 +12:00
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
Hamish Mackenzie 4e01f34543 Add nixpkgs-2205 and update other nixpkgs pins (#1506) 2022-07-17 18:18:19 +12:00
Andrea Ciceri 2c1701b681 Supporting ca-derivations experimental feature (#1494)
* Supporting `ca-derivations` experimental feature

* Improved `contentAddressed.include` option description

* Ensure deterministic output for content addressed components

* Comment transformed into a Nix comment

To avoid possibly useless rebuilds

* Use `modules` arg `contentAddressed` flag

* Tutorial about CA derivations

Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
2022-06-23 12:39:35 +12:00
Hamish Mackenzie def2e0540e Add just-template-haskell test for #1483 (#1504) 2022-06-03 17:26:57 +12:00
Hamish Mackenzie 95faec6038 Default reinstallableLibGhc to true (#1498)
It fixes more things than it breaks now.
2022-06-02 13:21:12 +12:00
Hamish Mackenzie fa2fa131fe Add ghc 9.2.3 (#1491)
Also:

* Updates the GHC's built on CI
* Use Cabal 3.6.2.0 for default Setup
* Fixes haskell-language-server and hlint on CI
2022-06-01 19:33:58 +12:00
Hamish Mackenzie 07619e1979 Remove build-tool-depends for happy and Alex from ghc (#1485)
These don't seem to be needed and adding them causes #1480.
2022-05-30 23:33:35 +12:00
Hamish Mackenzie 82bc945818 Fix ghc 9 windows cross compilation (#1450)
Fixes Windows cross compilation for GHC 9.0 and 9.2.

Updates wine to use the version that is included with the chosen Nixpkgs (it used to be pinned to an older version).

Moves the configuration of the GHC source into the GHC derivation.  This should make adding Hadrian support easier.

Propagates library dependences (not just pkgconfig ones) on windows so that any DLLs in those libraries can be copied for TH evaluation and to the `/bin` directory of executable components.

Adds gcc and mfcgthreads as library dependencies on Windows so that the DLLs they include will be found.

Use `$pkgsHostTarget` (instead of `ghc-pkg`) to find all the DLLs can copy them to the `/bin` directory of executable components.

Adds support for __int128_t and __uint128_t to language-c to fix aarch64-darwin builds.

Fixed reinstalling packages that come with patched versions in ghcjs.
2022-05-19 20:21:16 +12:00
Shea Levy bfeea3e894 Allow packages to specify external static plugins 2022-05-02 11:08:42 -04:00
Shea Levy be667b07d8 Try to get hydra to build Plutus GHC 2022-04-26 07:23:03 -04:00
Hamish Mackenzie f3ea06dcac Work around for packages in lts that do not install. (#1437)
For ghc 9.0.2 Haskell.nix will use the `stm`and `filepath` source that came with `ghc` when the version desired matches.  This is because 9.0.2 shipped with packages that differ from the same version in hackage.

`reinstallableLibGhc` is fixed for GHC 8.10 and above.  Rather than including a patch file this works by:

* Setting the `subDir` to the `compiler` directory when building.  That way relative paths to other parts of the `ghc` source tree (outside the `compiler` directory) still work.
* Files that are needed, but generated when `ghc` builds are added from the `generated` output of the ghc derivation.

`nonReinstallablePkgs` is now sorted and deduplicated before it is used (this reduces the chance of rebuilds when the list is refactored).
2022-04-20 15:25:21 +12:00
Hamish Mackenzie e81f3bb011 Avoid filtering repo to just 01-index.tar.gz file (#1432)
When downloading a `repository` block we get a number of files (not just the index).  For some repositories these files will be necessary for `cabal configure` and the vanilla ones created by haskell.nix will not work.  This change keeps these extra files and combines them with the main hackage index using `lndir`, so that changes to the repo will not require a new copy of the hackage index in the store.

This change also introduces `inputMap` that allows flake or niv inputs to be used to pin repository.  It also works with `source-repository-package` blocks.
2022-04-14 02:35:37 +12:00
Hamish Mackenzie 4b6ee9767d Make DLLs in deps available to wine TH runner (#1405)
This is a better fix to the problem of making DLLs available to the process running in wine that is used to evaluate TH code when cross compiling for Windows.

Also fixes macOS loadArchive in TH for ghc 9

Co-authored-by: Michael Peyton Jones <michael.peyton-jones@iohk.io>
2022-03-25 21:44:02 +13:00
Hamish Mackenzie fa2d8a9b6f Add ghc 9.2.2 (#1394) 2022-03-08 14:34:04 +13:00
Hamish Mackenzie b1113d486f Turn off test broken by latest hspec-core (#1393) 2022-03-07 20:31:52 +13:00
Hamish Mackenzie 2576a948b5 Improve support for external Hackage repositories (#1370)
* Improve support for external Hackage repositories

This change builds #535. `repository` blocks in `cabal.project` parsed and `cabal` is used to automatically downloaded them.  Then `hackage-to-nix` is used to produce the nix required.

To make it work with restricted eval (on hydra for instance) we need to include a sha256 like this:

```
repository ghcjs-overlay
  url: https://input-output-hk.github.io/hackage-overlay-ghcjs
  secure: True
  root-keys:
  key-threshold: 0
  --sha256: sha256-EPlLYPmIGtxeahlOspRzwJv+60N5mqrNC2BY4jZKceE=
```

To find the correct `sha256` put in an invalid one and attempt a build.
2022-02-18 00:42:11 +13:00
Cheng Shao 18ebf60137 Fix libnuma dependency in rts.conf (#1342) 2022-02-15 23:49:45 +13:00
Moritz Angermann 001df758bf fix ghcjs (#1311) 2022-01-09 03:11:37 +13:00
Hamish Mackenzie 6101c6ea7b Add GHC 9.0.2 (#1338)
Co-authored-by: Ollie Charles <ollie@ocharles.org.uk>
2022-01-09 03:10:05 +13:00
Hamish Mackenzie 11284e3fcb Skip dwarf version of ghc 9.2.1 on hydra (#1333)
See #1332
2022-01-05 03:12:21 +13: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
Javier Sagredo 0e2ae928e2 Rename executable-profiling flag as suggested by Cabal (#1136) 2021-12-27 15:28:59 +08:00
Hamish Mackenzie 942fa5defb Fix check-hydra test (#1312)
* Fix check-hydra test

* Fix for ghc 9.2.1
2021-12-13 03:16:35 +13:00
Hamish Mackenzie 24b421cbfc Add ghc 9.2.1 and update internal cabal to 3.6.2 (#1286) 2021-11-13 12:43:04 +13:00
Hamish Mackenzie 1f4c2c9b08 Add GHC 8.10.7 (#1220) 2021-09-01 22:43:31 +12:00
Teo Camarasu f624ca5662 Add GHC-8.10.6 (#1214)
Add GHC-8.10.6

Co-authored-by: Peter Becich <peter@simspace.com>
Co-authored-by: Teo Camarasu <teofilcamarasu@gmail.com>
Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
2021-08-31 04:19:40 +12:00
Hamish Mackenzie 3835023cda Add package.buildable option (#1205)
* Add `package.buildable` option

Turning off building for a whole package requires setting `buildable = lib.mkForce false` on each of the components of the package.  This change adds support for `package.buildable = false` to make it easier.

So:

```
packages.marlowe-actus.components.library.buildable = lib.mkForce false;
packages.marlowe-actus.components.exes.marlowe-actus-test-kit.buildable = lib.mkForce false;
packages.marlowe-actus.components.tests.marlowe-actus-test.buildable = lib.mkForce false;
```

Can be replaced with:

```
packages.marlowe-actus.package.buildable = false;
```
2021-08-19 00:52:59 +12: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 d5d304d5b5 Flakify all inputs (#1180)
* Include dependencies of haskell.nix that were tracked in `nix/sources.json`
  as flake inputs (`flake.lock` replaces `nix/sources.json`).
* Use `flake-compat` to continue to provide a compatible interface for non
  flake projects.

Co-authored-by: Alexander Bantyev <balsoft@balsoft.ru>
Co-authored-by: Shea Levy <shea@shealevy.com>
2021-08-06 15:54:39 +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 90184a79f9 Better error message when building missing ghcjs (#1140)
Currently if you try to build a ghcjs version that does not exist
haskell.nix falls back on the GHC version.  Once ghcjs is in the
ghc tree this will work, but for now we should have an error
message that is more descriptive than attempting and failing to
build ghc for a js target.

New error looks like this:

```
$ nix-build -A pkgs-unstable.pkgsCross.ghcjs.buildPackages.haskell-nix.compiler.ghc861
error: ghcjs 8.6.1 is no longer supported by haskell.nix. Consider using 8.6.5
```
2021-06-17 11:57:21 +12:00
Hamish Mackenzie f899936d1f Update internalHackageIndexState (#1139)
The use of `sources.HTTP` to work around issues building GHC 9.0.1 causes a mismatch between `flake` based and non
 `flake` based derivations.

The fixed version of HTTP is now in hackage so updating the internal hackage index state used haskell.nix removes the need for the HTTP source override.
2021-06-16 22:10:42 +12:00