Commit graph

105 commits

Author SHA1 Message Date
David Johnson 00892b7e4e generic-builder.nix: Update doHaddock
By default, `ghcjs` haddocks are precluded from being built. I see no reason to disallow building haddocks on projects built with `ghc` and `ghcjs` (someone can correct me here). `HaLVM` currently does not support `haddock` since it's a Stage 1 `GHC`. https://github.com/GaloisInc/HaLVM/blob/master/src/misc/build.mk.in#L20

Currently, building `haddocks` for `ghcjs` projects requires altering the derivation, which doesn't allow users to take advantage of the cache. This change will relieve that.
2017-06-09 10:04:34 -07:00
Charles Strahan 132b503aac
GHCJS packages: avoid inode explosion
As noted in #25595, a change introduced in 4b77d425aa causes an
explosion of inodes due to the constructions of many, many `ghcEnv`
symlink forests. This commit undoes that change.

To discuss reworking the support for GHCJS plugins, please see: #26192

Fixes #25595
2017-05-28 14:36:37 -04:00
Judah Jacobson 3ef04024d9 Remove unused local command. 2017-05-07 16:39:50 -07:00
Judah Jacobson 2caa7b88ae Fix use of isDarwin conditionals. 2017-05-05 09:53:08 -07:00
Judah Jacobson 7131e06214 haskell: work around linker limits on Mac OS X Sierra.
The Sierra linker added a limit on the number of paths that any one
dynamic library (`*.dylib`) can reference.  This causes problems when
a Haskell library has many immediate dependencies (#22810).

We follow a similar fix as GHC/Cabal/Stack: for each derivation,
create a new directory with symlinks to all the dylibs of its immediate
dependencies, and patch its package DB to reference that directory
using the new `dynamic-library-dirs` field.

Note that this change is a no-op for older versions of GHC, i.e., they will
continue to fail on some packages as before.

Also note that this change causes the bootstrapped versions of GHC to be
recompiled, since they depend on `hscolour` which is built by
`generic-builder.nix`.

Tested by building the `stack` binary as described in #22810.
2017-05-05 09:26:58 -07:00
Leon Isenberg e73e5c884f haskell: set LD_LIBRARY_PATH in shellHook
LD_LIBRARY_PATH is considered by GHCI.
Previously e.g. `cabal repl` failed on packages with
system library dependencies.
2017-05-03 15:18:45 +02:00
Jörg Thalheim 26f5fa8f97 Merge pull request #24922 from phunehehe/haskell-shell-hook
haskell-modules: fix shell hook
2017-04-15 12:34:41 +02:00
Hoang Xuan Phu 2fde20e271 haskell-modules: fix shell hook
26623240e9 lacks a newline
2017-04-15 16:33:07 +08:00
David Johnson 6f69681dad Add hardening, bump hash to HaLVM 2017-04-14 00:34:02 -05:00
Shea Levy 5e984362f6 haskell generic builder: Use ghcjs's hsc2hs.
This is required when using ghcjs to compile Setup.hs, which we do since #23614.

See comments on c35350a212
2017-04-06 03:16:00 -04: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
Jörg Thalheim d0922896be Merge pull request #23097 from dmjio/halvm
Initial commit of HaLVM support
2017-03-12 18:31:29 +01:00
David Johnson 26623240e9 Init HaLVM at 2.4.0 2017-03-10 19:31:12 -06:00
Peter Simons 060f7cb94d haskell-generic-builder: remove unused nodePackages argument 2017-03-08 09:38:12 +01:00
3noch 4b77d425aa
Fix GHCJS HEAD patch; support GHCJS libdir link; use full ghcEnv for GHCJS
Original:
f3110651c8

(With some tweaks from @cstrahan)

closes #23199
2017-03-02 11:35:11 -05:00
Peter Simons feffadefed haskell generic-builder: Revert "Pass through the ghcEnv."
This reverts commit a27bc8b317. Please don't add
random stuff to the interface provided by the generic builder without
coordinating with others. There is a proper effort underway to provide that
information in https://github.com/NixOS/nixpkgs/pull/23023.
2017-03-01 19:57:40 +01:00
Peter Simons 3001b821c9 haskell generic-builder: Revert "Pass through the list of haskell build inputs."
This reverts commit c153036525. Please don't add
random stuff to the interface provided by the generic builder without
coordinating with others. There is a proper effort underway to provide that
information in https://github.com/NixOS/nixpkgs/pull/23023.
2017-03-01 19:57:18 +01:00
Shea Levy c153036525 haskell generic-builder: Pass through the list of haskell build inputs.
Useful for building custom envs.
2017-03-01 13:00:57 -05:00
Shea Levy a27bc8b317 haskell generic-builder: Pass through the ghcEnv.
Will be useful for nix-buffer
2017-03-01 11:05:50 -05:00
Joe Hermaszewski 8788bfe762 haskell-packages: use benchmark over bench 2017-02-28 09:27:29 +00:00
Joe Hermaszewski 4ab570a6d0 haskell-packages: Add minimal benchDepends support
See also: https://github.com/NixOS/cabal2nix/pull/262
2017-02-27 12:23:11 +00:00
Joe Hermaszewski fdd9d7fe4c haskell-packages: Add minimal benchDepends support
See also: https://github.com/NixOS/cabal2nix/pull/262
2017-02-27 11:56:33 +00: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
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
Shea Levy 2154108270 haskell-modules/generic-builder: Fix copy-paste error 2017-01-23 11:35:59 -05:00
Shea Levy 0ff6b6fc0f (haskellPackages.callPackage foo).env: Set the right env vars when cross-compiling 2017-01-22 17:05:19 -05:00
Shea Levy 60918113af haskellPackages.mkDerivation: Use native hsc2hs when cross-compiling 2017-01-11 13:26:08 -05:00
Domen Kožar 663048f378 Revert "haskell: workaround for bug with dynamic libraries on darwin"
This reverts commit 19e2e7290a.

See the correct fix in aa64994b48a29ea8d12323942f1743fa4133527a

General purpose solution will be once we implement
https://github.com/NixOS/nixpkgs/issues/21624
2017-01-03 23:10:24 +01:00
Peter Simons 711c235777 haskell: clean-up for the generic builder
Clean up the implementation from d0250ad884.
2017-01-03 10:52:50 +01:00
Daiderd Jordan 19e2e7290a haskell: workaround for bug with dynamic libraries on darwin 2016-12-24 16:15:35 +01:00
Domen Kožar d0250ad884 Haskell generic builder: enable parallel builds for GHC 8.0.2
This reverts https://github.com/NixOS/nixpkgs/pull/4554
2016-12-16 22:25:40 +01:00
Joe Hermaszewski 757638acae ghcWithPackages: fix env NIX_GHC_LIBDIR value
Ideally the duplication between the environment shellHook and the ghc
wrapper would be removed.

Fixes #20730
2016-11-26 12:06:56 +00:00
Vladimír Čunát 2aea31b52e
Merge branch 'staging' 2016-11-19 21:55:26 +01:00
Shea Levy 64ec4dd87b Add haskell packages set for cross ghc 2016-11-18 10:44:53 -05:00
Shea Levy 3995655d2c Revert "Merge pull request #17145 from kalhauge/haskell_darwin_dyld"
This fix doesn't actually fix the cabal bug (see #16357), but it does
cause other bugs (see #20476)

Fixes #20476

This reverts commit b89fa5fd5c, reversing
changes made to e4b146b041.
2016-11-17 07:25:42 -05:00
Peter Simons b59b89d9e3 Revert "Extend Haskell generic builder to use new --ipid flag."
This reverts commit ec8b816154. The change told
the Cabal build system to use the hash-part of $out as the internal identifier
for the library it's building (rather than generating such an ID itself). While
a good idea in theory, this choice had an unfortunate side-effect: When Cabal
links libraries X, Y, and Z into an executable, then the generated binary
contains their respective IDs. Now, Nix finds those strings and treats them as
an indication that there is a *run-time dependency* on the corresponding store
paths. This means that the generated executable will always depend on the store
paths of all the Haskell libraries that went into it, even when linked
statically.
2016-10-08 10:45:48 +02:00
Peter Simons ec8b816154 Extend Haskell generic builder to use new --ipid flag. 2016-10-05 09:46:53 +02: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
Christian Gram Kalhauge 1a08805358 Make the implementation clean 2016-07-21 14:56:45 +02:00
Christian Gram Kalhauge 9bca29d4ef Change if to optionalString 2016-07-21 14:23:56 +02:00
Christian Gram Kalhauge de5a2ee034 Reduce computation time for non-darwin users 2016-07-21 11:39:52 +02:00
Christian Gram Kalhauge 475c8bfb7d Fix DLYD problem with haskell libraries on Darwin
This commit fixes a problem that occurs with externally linked haskell
libraries on Darwin. It does this by adding the libraries to the
--extra-lib-dirs flag and the DYLD_LIBRARY_PATH environment variable.
2016-07-20 14:21:53 +02:00
Michael Alan Dorman b40e1efe00 haskell generic-builder: don't propagate setupHaskellDepends
Without this patch, attempts to install at least some of the packages
that start to use setupHaskellDepends (mostly gtk-related packages)
results in collisions:

    building path(s) ‘/nix/store/63k5smns43f5r2ad8wcc242x0gwd70m3-ghc-8.0.1’
    collision between `/nix/store/k18i1nm5hgnb82y9w2g9hmlwhk3szjld-ghc-8.0.1/lib/ghc-8.0.1/Cabal-1.24.0.0/Distribution/Compat/Binary.dyn_hi' and `/nix/store/0rwhbwsg9kmywgbrib2bs29p2hmi80za-Cabal-1.24.0.0/lib/ghc-8.0.1/Cabal-1.24.0.0/Distribution/Compat/Binary.dyn_hi'
    builder for ‘/nix/store/vrjkfpm8sb96m9i5k74h8vn0rwddgy4v-ghc-8.0.1.drv’ failed with exit code 25

This would appear to me to be a consequence of setupHaskellDepends
entries being added to propagateBuildInputs.  It is sufficient in the
cases I'm familiar with (taffyBar), and I think correct, to simply add
it to the otherBuildInputs.
2016-06-13 09:51:35 +02:00
Peter Simons 8ffcd238c3 haskell-generic-builder: add support for setupHaskellDepends 2016-06-12 08:37:01 +02:00
Jude Taylor 4686bc54a6 add socket.io to interactive ghcjs environments 2016-03-01 16:06:29 -08:00
John Ericson f13eede7e5 haskell: Tiny refactor in generic-builder. No hashes/interfaces changed. 2016-02-21 10:16:13 -08:00
John Ericson 51b66ed4d9 haskell: Add notion of cross compiler and define nativeGhc with it
Tested to not change hashes
2016-02-21 10:16:13 -08:00
Charles Strahan 97d9071b95 ghcjs: use native ghc to build Setup.hs 2016-02-18 03:15:59 -05:00
Charles Strahan bbce88302a ghcjs: fix building with cabal-install-1.22.8.0 2016-02-18 03:15:59 -05:00
Charles Strahan 95d892ec26 ghcjs: update and fix ghcjs/reflex libs
Set dontStrip when building ghcjs libs, which fixes the ghcjs-dom lib
and also makes the logs cleaner.
2016-01-24 17:13:45 -05:00