Commit Graph

56 Commits

Author SHA1 Message Date
Shea Levy
1ee61d8f23
Revert "Revert "hslib: Function to extract the haskell build inputs of a package.""
Trying again, without changing the generic builder.

This reverts commit 65138e8a41.
2017-12-29 14:37:24 -05:00
Peter Simons
65138e8a41 Revert "hslib: Function to extract the haskell build inputs of a package."
This reverts commit d545ef3fa1. Please don't
commit substantial changes to the generic Haskell builder without giving me a
chance to review them.
2017-12-28 19:23:41 +01:00
Shea Levy
d545ef3fa1
hslib: Function to extract the haskell build inputs of a package.
This works by extracting out some logic from generic-builder.nix to
make it possible to get at the relevant information by overriding
mkDerivation for the haskell package.
2017-12-23 11:44:18 -05:00
Peter Simons
8d8061ec20
Revert "Revive multiple outputs for Haskell packages." 2017-12-05 09:36:08 +01:00
Nicholas Clarke
d90165c7db Revert "Revert "Merge pull request #27209 from nc6/nc/haskell-multiple-out""
This reverts commit 89f5d52cf4.
2017-11-27 16:05:22 +00:00
Peter Simons
2439a83072 haskell.lib: strip trailing whitespace 2017-09-19 15:55:50 +02:00
Peter Simons
a8b69958cf haskell.lib: add doBenchmark helper function 2017-09-19 15:55:16 +02:00
Bas van Dijk
b4ea459eab haskell: introduce failOnAllWarnings
Applying `haskell.lib.failOnAllWarnings` to a Haskell package enables the
`-Wall` and `-Werror` GHC options to turn all warnings into build failures.
2017-09-10 13:09:52 +02:00
Peter Simons
89f5d52cf4 Revert "Merge pull request #27209 from nc6/nc/haskell-multiple-out"
This reverts commit dfb0f25484, reversing
changes made to 7f8ff02437. These changes broke
the ghcWithPackages wrapper:

    nix-shell -p "haskellPackages.ghcWithPackages (ps: [ps.mtl])" --run "ghc-pkg list mtl"
    /nix/store/szz84j5k1dy3jdashis6ws28d8l8zxxb-ghc-8.0.2-with-packages/lib/ghc-8.0.2/package.conf.d
        (no packages)
2017-09-06 10:19:18 +02:00
Nicholas Clarke
a1d78fa5bc Don't build separate bin output for alex.
It has files in /usr/share which reference the bin output.
2017-09-04 12:35:57 +01:00
Nicholas Clarke
676362494d Enable multiple outputs for Haskell packages. 2017-09-04 12:35:57 +01:00
Domen Kožar
991654fa4a haskell: add combinator to enable DWARF debugging
Tested using:

$ cat test-strip.nix
with (import ./. {});
with haskell.lib;

haskell.packages.ghc802.override {
  overrides = self: super: {
    microlens = enableDWARFDebugging super.microlens;
  };
}

$ nix-build -A microlens test-strip.nix
$ objdump -t <path-to-so-file>
2017-09-02 11:25:50 +01:00
Bas van Dijk
e410a191a1 haskell: add the checkUnusedPackages function including docs 2017-08-30 14:40:54 +02:00
Moritz Kiefer
291da85ed9 haskell: remove any extraneous outputs from sdistTarball 2017-08-10 08:48:59 +02:00
John Ericson
74f5fe5068 haskell infra: Misc cleanups
- The haskell lib is very close to not relying on Nixpkgs. I think
   this is good---simpler to think about and matches Nixpkgs's lib.

 - The haskell lib is only imported once

 - stdenv is exposed more shallowly so it can be overriden more easily.
   I'll eventually use this on Darwin to avoid the Sierra shared
   library problems (unless changes are to be made system-wide).

Closes https://github.com/NixOS/nixpkgs/pull/27840.
2017-08-03 13:12:01 +02:00
Peter Simons
47e3245691 haskell.lib: drop obsolete hasNoDataOutput and hasNoDocOutput functions 2017-07-29 12:39:26 +02:00
michael bishop
be63b1994d enable split-output builds for all haskellPackages 2017-07-27 09:12:06 +02:00
michael bishop
24d313e203
justStaticExecutables: enable -dead_strip on mac to shrink closure 2017-06-14 14:23:53 -03:00
Benno Fünfstück
5f33eb493f haskell-packages: factor package set construction in new file
Closes https://github.com/NixOS/nixpkgs/pull/24850.
2017-04-21 16:25:53 +02:00
Shea Levy
a6c39ed207 haskell-lib: Add overrideSrc helper 2017-04-08 16:21:57 -04:00
Bas van Dijk
c865b8e35e haskell: add the linkWithGold function to link packages with ld.gold
Also support linking the double-conversion package with ld.gold.
2017-04-07 09:44:11 +02:00
Leon Isenberg
2553ceb982 haskell: use GHCJS to build Setup.hs for GHCJS packages
Closes https://github.com/NixOS/nixpkgs/pull/23614.
2017-03-29 20:30:28 +02:00
Domen Kožar
db23fe1581
haskell: add justStaticExecutables combinator 2017-03-07 18:13:59 +01:00
Domen Kožar
e649974271 Merge pull request #22613 from shajra/fix/9871-3
Haskell infrastructure: fix #9871 (overrideCabal)
2017-02-27 12:54:27 +01:00
Bas van Dijk
8a928708b4 haskell: add support for Haskell Program Coverage (HPC) to the generic builder
A function is added to enable the generation of a HPC report. For example:

  pkgs.haskell.lib.doCoverage drv

will create a HPC report of the Haskell package drv in the directory:

  $out/share/hpc

Closes https://github.com/NixOS/nixpkgs/pull/22797/files.
2017-02-15 16:17:41 +01:00
Sukant Hajra
98617ccb99 Haskell infrastructure: fix #9871 (overrideCabal)
As per the recommendation by @Mathnerd314, this change seems to work
with the testing I did.

It makes sense to me why it works, but I think it's in an important
enough place that someone with much deeper knowledge of Haskell
infrastructure in Nixpkgs should give it a really heavy review.

I also consolidated all the overrideCabal definitions (there were two)
into a single definition in haskell-modules/lib.nix.
2017-02-09 23:07:40 -06:00
Domen Kožar
f031f3105a
GHC 8.0.2: use -split-sections
-split-sections replaced -split-objs with following upsides:

1) -split-objs adds considerable overhead to compile time

2) combined with stripping, it causes issues when cross-compiling

For upstream see https://ghc.haskell.org/trac/ghc/ticket/8405

This is supported only for Linux/Windows using ld linker.

GHC master also turns on -split-sections by default.

Example using stack:

Without splitting

  $ du /nix/store/5paayhibayr73zqfaj458g4k4mv108jn-stack-1.3.2
  4       /nix/store/5paayhibayr73zqfaj458g4k4mv108jn-stack-1.3.2/share/bash-completion/completions
  4       /nix/store/5paayhibayr73zqfaj458g4k4mv108jn-stack-1.3.2/share/bash-completion
  4       /nix/store/5paayhibayr73zqfaj458g4k4mv108jn-stack-1.3.2/share
  23416   /nix/store/5paayhibayr73zqfaj458g4k4mv108jn-stack-1.3.2/bin
  23420   /nix/store/5paayhibayr73zqfaj458g4k4mv108jn-stack-1.3.2

With -split-objs

  $ du /nix/store/fypymm529adpx71gdzm0851xz42wdbz0-stack-1.3.2
  20632   /nix/store/fypymm529adpx71gdzm0851xz42wdbz0-stack-1.3.2/bin
  4 /nix/store/fypymm529adpx71gdzm0851xz42wdbz0-stack-1.3.2/share/bash-completion/completions
  4 /nix/store/fypymm529adpx71gdzm0851xz42wdbz0-stack-1.3.2/share/bash-completion
  4       /nix/store/fypymm529adpx71gdzm0851xz42wdbz0-stack-1.3.2/share
  20636   /nix/store/fypymm529adpx71gdzm0851xz42wdbz0-stack-1.3.2

With -split-sections

  $ du /nix/store/40l6krinx1zx41lr87c4m12hxj4ldf3x-stack-1.3.2
  4       /nix/store/40l6krinx1zx41lr87c4m12hxj4ldf3x-stack-1.3.2/share/bash-completion/completions
  4       /nix/store/40l6krinx1zx41lr87c4m12hxj4ldf3x-stack-1.3.2/share/bash-completion
  4       /nix/store/40l6krinx1zx41lr87c4m12hxj4ldf3x-stack-1.3.2/share
  20672   /nix/store/40l6krinx1zx41lr87c4m12hxj4ldf3x-stack-1.3.2/bin
  20676   /nix/store/40l6krinx1zx41lr87c4m12hxj4ldf3x-stack-1.3.2

Note: you currently need following overrides to build stack on 802:

   vector-algorithms = dontCheck super.vector-algorithms;
   path-io = doJailbreak super.path-io;
   stack = doJailbreak super.stack;

Note: Should also work on GHC 8.0.1, but I'm being careful here.
      We could backport later on.
2017-02-07 14:21:54 +01:00
Peter Simons
97fd905823 haskell: add support for 'hardeningDisable' to the generic builder
We also have a new helper function 'disableHardening' to use in
overrides. Fixes https://github.com/NixOS/nixpkgs/issues/14820.
2016-09-15 09:12:03 +02:00
Peter Simons
8d86c8274f callHackage: generate expressions for the appropriate target system and compiler 2016-06-13 23:09:56 +02:00
Peter Simons
52aad6c77d haskell.lib.withHoogle: remove obsolete function 2016-06-12 08:37:06 +02:00
Mathieu Boespflug
b1b85ddb81 buildStackPackage: Fix path to generic-stack-builder.nix.
Before:

```
error: getting status of
‘/home/user/nixpkgs/pkgs/development/development/haskell-modules/generic-stack-builder.nix’:
No such file or directory
```
2016-03-06 10:35:25 +01:00
Peter Simons
86d0a9c420 haskell.lib: fix use of callPackage 2016-03-04 22:17:53 +01:00
Mathieu Boespflug
7fedb7c992 Move buildStackProject to haskell.lib. 2016-03-04 21:24:42 +01:00
Peter Simons
c58c68a037 haskell.lib.addPkgconfigDepends: fix broken function
The function is supposed to modify pkgconfigDepends, not buildInputs.
2015-12-17 00:32:16 +01:00
Peter Simons
7802f5c793 haskell.lib: add doDistribute function as a dual to dontDistribute 2015-09-15 16:23:46 +02:00
Peter Simons
78f1720532 haskell-lib: make sdistTarball and buildStrictly functions fuzzier to cope with Hydra builds
In Hydra CI environments, the version strings we get from Hydra don't
necessarily match those hard-coded into the Cabal files. To make those builds
succeed anyway, we have to apply some pattern matching.
2015-08-30 15:20:21 +02:00
Jan Malakhovski
c80af74a84 haskell-packages: throw withHoogle away from the lib 2015-08-18 19:56:17 +00:00
Jan Malakhovski
0013743845 haskell-packages: make hoogle wrapper much more helpful
* Build most of the stuff on /tmp, not in /nix/store.
* Generate hoogle database for all the dependencies.
* Generate haddock index and contents files.
* Cleanup.
2015-08-18 19:56:17 +00:00
Peter Simons
7bcc1bfc11 haskell: add 'addPkgconfigDepend' combinator to lib.nix 2015-08-07 15:13:13 +02:00
Charles Strahan
3859f7bdab haskell-ng: hoogleLocal support 2015-06-11 20:25:31 -04:00
Peter Simons
0520540018 haskell-bytestring-builder: trigger rebuild with GHC 7.8.x to mitiagate broken library ID 2015-06-07 00:09:06 +02:00
Peter Simons
ba809cf9a3 haskell: add three new helper functions to the lib module
- sdistTarball transforms a normal Haskell build into one that produces a
   release tarball by running "sdist". For example:

     $ nix-shell -p "haskell.lib.sdistTarball haskellPackages.mtl" --command 'tar tfv $nativeBuildInputs/*tar.gz'

 - buildFromSdist transforms a normal Haskell build into one that compiles the
   package the an sdist release tarball created by Nix. For example:

     $ nix-shell -p "haskell.lib.buildFromSdist haskellPackages.mtl" --command "exit 0"

 - buildStrictly transforms a normal Haskell build into one that (a) compiles
   the source code with "-Wall -Werror" flags and (b) uses as input a locally
   generated sdist release tarball. For example:

     $ nix-shell -p "haskell.lib.buildStrictly haskellPackages.mtl" --command "exit 0"

   This function is particularly useful for continuous Hydra builds of Haskell
   packages.
2015-06-02 14:17:16 +02:00
Peter Simons
36a2361976 haskell-ng-lib: add combinators for enabling/disabling source hyper-linking 2015-04-01 22:54:45 +02:00
Peter Simons
f145201b35 git-annex: disable shared linking for this executable
git-annex has literally dozens of dependencies, and loading all of them
at run-time can be slow (https://github.com/NixOS/nixpkgs/issues/4239).
2015-02-06 13:59:57 +01:00
Peter Simons
353e276937 haskell-mikmod: fix build 2015-02-03 12:46:39 +01:00
Peter Simons
d49671c924 haskell-ng.lib: add markBrokenVersion and appendPatch helper functions 2015-01-23 11:32:48 +01:00
Peter Simons
1d6d5932cd haskell-streaming-commons: fix build on older GHC versions some more 2015-01-20 23:56:56 +01:00
Peter Simons
f8710f9d81 haskell-ng: fix several builds with old versions of GHC 2015-01-19 23:15:29 +01:00
Peter Simons
380114738f haskell-ng: rename "noHaddock" attribute to "doHaddock"
This makes the attribute (a) consistent with "doCheck" and friends and (b)
avoids the double negation "noHaddock = false" meaning "doHaddock = true".

Fixes https://github.com/NixOS/cabal2nix/issues/63.
2015-01-18 12:58:31 +01:00
Peter Simons
e4a68f0b98 haskell-ng: add more tools to our help function library 2015-01-13 12:44:53 +01:00