Commit Graph
48 Commits
Author SHA1 Message Date
Matthew Ess fe44ce2300 types.string -> types.str (#238)
`types.string` is deprecated and now emits a warning on recent versions of nixpkgs. 

fixes #237
2019-09-10 13:31:59 +08:00
Domen Kožar 2de3c508af add ghc-boot to nonreinstallable pkgs (#233) 2019-09-07 20:35:44 +08:00
Hamish Mackenzie 0366537651 Use new cleanSourceWith to filter component source (#209)
When trying to build haskell packages from local source using nix (
source code you have used `git clone` to retrieve and have modified)
it is often annoying that small changes can trigger a lot of components
to be built unnecessarily.  For instance if you change the code for
a test in a package it will often trigger builds of the library and
all its dependencies.

To avoid this problem we could manually set up `cleanSourceWith` calls
in nix to filter out files that are not need, but to do this every
component would be difficult and error prone.

This change automates this process using the information in the
packages `.cabal` file to filter the source of each component
automatically  when using `callCabalPlanToNix` (we should be able to
add it to `callStackToNix` too).

## How does it work?

* A new version on `cleanSourceWith` is used that adds a `subDir`
  argument.  It allows descending into a subdirectory to compose with
  cleaning the source.

* A new `--full` argument is passed to `plan-to-nix` by
  `callCabalPlanToNix` telling it to output extra information about
  the cabal packages in the plan (directories and filenames).

* `callCabalProjectToNix` uses the new `subDir` argument of
  `cleanSourceWith` when setting the packageSrc.

* `comp-builder.nix` and `setup-builder.nix` use a new
  `cleanCabalComponent` function to further clean the packageSrc
  using the new information in the `package` and `component`.

## hpack wildcards
`package.yaml` files can include wild cards and these are not handled
yet (they do not map to anything in the `.cabal` file and so are lost).
They will need to be added manually to the appropriate field
(eg. `packages.xyz.package.dataFiles`)

If your hpack file does not contain wildcards or if you are willing to
add the wildcards entries manually in nix it is still useful to
enable cleaning on hpack.

For example:

```
packages.ghc-toolkit.package.cleanHpack = true;
packages.ghc-toolkit.components.library.extraSrcFiles = [
  "genapply/**/**"
  "boot-libs/**/**"
  "ghc-libdir/**/**"
  ];
```
2019-08-26 12:27:47 +02:00
Hamish Mackenzie 3ae2303b14 Add enableSeparateDataOutput like nixpkgs (#222) 2019-08-09 17:46:21 +12:00
Moritz Angermann 8a3489e1dc Better defaults (doExactConfig = true; non-reinstallable lib:ghc) (#206)
* Better defaults (doExactConfig = true; non-reinstallable lib:ghc)

Disabling haddocks by default has unintended consequences, as such we'll wait for the `.doc` derivation to solve this.

Fixes #201, #191
2019-07-16 15:14:57 +08:00
Michael Peyton Jones 9d251db79a Add custom errors for some missing attributes (#194)
* Add a custom error message for a missing stack resolver

* Make mkCabalProjectPkgSet robust to missing Hackage patches

* Add error for component prefix lookup

* Add a custom error for a missing GHC
2019-07-04 10:09:02 +10:00
Rodney Lorrimar 0663a9cd03 Add ghcWithPackages and ghcWithHoogle to hsPkgs (#150)
* Add ghcWithPackages and ghcWithHoogle to hsPkgs

* tests: Add ghcWithHoogle test

* Update changelog
2019-06-21 22:40:08 +10:00
Rupert Horlick 83e4c75957 Update comp-builder to run tests directly (#168) 2019-06-07 16:47:40 +01:00
Moritz Angermann ea6f125ca4 Adds profiling support (#162)
* Adds profiling support

* Drop debug info
2019-06-04 11:28:14 +08:00
Rupert Horlick 26c5b7be76 Add hooks to all components (#158) 2019-06-02 21:13:32 +08:00
Rodney Lorrimar 4ecc0aa041 Add config.hsPkgs.shellFor function
I needed to rearrange a few things to write this function.
2019-05-28 09:34:38 +10:00
Moritz Angermann 4bc838cc86 Unbreak build-tools (#136) 2019-05-20 18:09:28 +08:00
Hamish Mackenzie 7b438d8d74 Add more pkgconf mappings (#126) 2019-05-17 15:59:05 +08:00
Moritz Angermann 072debc663 Fixup tests 2019-05-17 13:02:40 +08:00
Edward Amsden 413d5c9dbd Add shellHook option to components (and packages and plans) (#117) 2019-05-17 10:55:04 +08:00
Rodney Lorrimar b94ea34ecd Rename withPackage to ghcForComponent 2019-05-13 12:26:18 +08:00
Moritz Angermann 0de60e8b0c reinstallable lib:ghc and option inheritance (#88)
- reinstallable lib:ghc
- adds global options and option inheritance.
2019-03-18 21:20:33 +08:00
Moritz Angermann 696f22d87f Support library-less cabal files. 2019-03-15 10:39:01 +08:00
Moritz Angermann 8ffa7cd939 Adds sublib support (#63) 2019-03-13 15:43:48 +08:00
Kirill Zaborsky 3c78fdaede Use hpack to generate cabal files when required (#82)
* Use hpack to generate cabal files when required
2019-03-06 08:46:34 +08:00
Will Fancher de6a254d0f Remove self from depends of "all" component in the module system
Much cleaner to do this in the definition of `all`, rather than adding
special logic elsewhere.
2019-02-20 16:17:44 +08:00
Rodney Lorrimar 3584345a9a Fix cross build of withPackage wrapper 2019-02-14 09:35:57 +08:00
Rodney Lorrimar d1457606ed builder: Add haddock and hoogle to components.library.doc 2019-02-12 12:44:10 +10:00
Will Fancher 70f01c2029 Use mkForce in with-package test, and add a comment about the quirk. 2019-02-04 16:23:29 +08:00
Will Fancher 17ead947b0 Use config to set componentType defaults. 2019-02-04 16:23:29 +08:00
Will Fancher a7568a0e77 Use mkmerge for the all component. [Fixes #42] 2019-02-04 16:23:29 +08:00
Rodney Lorrimar 57049091b3 Fix dependency merging of "all" component 2019-01-31 13:17:45 +10:00
Rodney Lorrimar 20226fa294 builder: Add nix-shell development environments 2019-01-30 15:38:38 +10:00
Rodney Lorrimar 73f3733a2f Add an "all" component 2019-01-30 15:25:17 +10:00
Moritz Angermann dae8025469 Add ghc-heap to the nonReinstallablePkgs
This should better be aligned with the other set we have in
`default.nix`.  We are currently maintaining the list twice
in different locations.
2019-01-27 22:15:06 +08:00
Moritz Angermann 4050450b86 Allow patches to optionally depend on version and revision
This allows us to patch hackage packages to match those as shipped
with ghc; which we sadly have to.
2019-01-18 15:45:56 +08:00
Moritz Angermann 11a4b5e84c Allow configureFlags at package level 2018-12-22 22:59:40 +08:00
Moritz Angermann 03026b7bb9 Adds cabal-generator 2018-12-11 09:15:28 +08:00
Moritz Angermann 6cf6e943c0 add more cross and docrosscheck logic 2018-12-10 15:47:51 +08:00
Moritz Angermann 34bf8d224a Move copy logic from test to install 2018-11-30 18:11:35 +08:00
Moritz Angermann 9151dff3f3 Adds hooks 2018-11-26 17:26:18 +08:00
Moritz Angermann 40351aaeb2 Drop the overlay stuff 2018-11-18 16:19:19 +08:00
Moritz Angermann 5838e54278 Make sure we don't flood libraries with RPATHs on macOS 2018-11-18 16:18:56 +08:00
Moritz Angermann 9e804c6703 Update package.nix 2018-11-08 15:32:51 +08:00
Moritz Angermann f7c010387b This adds logic to better support stackage (stack-to-nix)
When using stackage as a baseline via stack-to-nix, we usually
assume stackage to be the base, and some augemnetation via
extra-dependencies and packages in the `stack.yaml` file.

To achive this we extend the package-set builder by allowing
a list of additional sets of package to speicied. These are then
folded onto the base package set.

As stackage seems to define the `rts` package as well, we force
`rts-1.0` to be null ontop of our hackage database.  As of
today (November 7th, 2018) there is no way of building the rts outside
of GHC; and as such no way to ever get the rts package onto hackage.

Once this package is *on* hackage, we can drop the hack.
2018-11-08 15:30:54 +08:00
Moritz Angermann 660cfbb3f7 make the stack logic work ... 2018-11-08 15:30:54 +08:00
Moritz Angermann ce32200e5c Update package.nix 2018-11-05 17:19:07 +08:00
Moritz Angermann 4437439f0e Add support for pathes
That is setting

```nix
{
  packages.$pkg.patches = [ ... ];
}
```

to set patches on a package.
2018-11-05 17:19:07 +08:00
Will Fancher f2b80ee3ef Cross compilation 2018-11-04 18:38:02 +08:00
Will Fancher 1bb2a42d3a Option for exact-config 2018-11-03 21:41:28 +08:00
Will Fancher d4cf3d2b32 Added a configuration-nix.nix file for plan-agnostic configuration 2018-11-01 13:33:41 +08:00
Will Fancher 9bbc69adf4 Don't null out all compiler.packages; only nonreinstallable packages 2018-11-01 13:33:41 +08:00
Will Fancher d18913eaa6 Use NixOS module system 2018-11-01 13:33:41 +08:00