Commit graph

263 commits

Author SHA1 Message Date
Bas van Dijk 0a30853461
Merge pull request #46512 from michaelpj/imp/haskell-benchmarks
haskell lib: add --enable-benchmarks in doBenchmark
2018-09-18 14:57:03 +02:00
Alexander Biehl 88ce4f5e8a More conservative SCC tagging for Haskell libraries
`all-functions` corresponds to `-fprof-auto` which places an SCC on every binding. It is well known that SCCs hinder GHC from doing its optimization magic and really slows down profiled code to a point where the profiling reports are completely skewed towards things that were completely optimized away in production settings. Concretely this shows up with things like lenses which do not carry runtime overhead when properly simplified.

`exported-functions` corresponds to GHCs `-fprof-auto-exported` which doesn't put SCCs on `INLINE`d code and in turn doesn't influence simplification of this basic but important stuff.
2018-09-12 10:30:20 +02:00
Alex Biehl f8a158c346 Haskell builder: Use $abi/$libname as --libsubdir 2018-09-12 10:30:20 +02:00
Michael Peyton Jones 175c4f040f
haskell generic builder: enable benchmarks if doBenchmark is true 2018-09-11 16:24:26 +01:00
John Ericson 0828e2d8c3 treewide: Remove usage of remaining redundant platform compatability stuff
Want to get this out of here for 18.09, so it can be deprecated
thereafter.
2018-08-30 17:20:32 -04:00
Domen Kožar 82f11ba01b haskell generic builder: expose enableParallelBuilding 2018-08-26 23:20:41 +01:00
Moritz Angermann e1d180725b Update generic-builder.nix
Drop `hasActiveLibrary` altogether. The condition is wrong, `isLibrary` is the correct one. We can have non-static, non-shared libraries as well.
2018-08-07 09:25:35 +02:00
Moritz Angermann e4a61c8b6e [haskell/generic-builder] windows always has an active library
This commit is not really correct. The `hasActiveLibrary` check is wrong.
We can have an active library even if we do not ask for a static lirbary or
dynamic one; we can still have just a set of objet files and archives.
2018-08-07 09:25:35 +02:00
Domen Kožar 6fd5287c36 haskell: don't error if isLibrary = true and no libraries exist
If empty directory isn't deleted, referer depenedencies will
fail with:

cp: missing destination file operand after '/tmp/nix-build-cabal-helper-0.8.0.2.drv-0/setup-package.conf.d/'

This is currently only the case for cabal-install, as cabal2nix
doesn't handle well buildable=False flags due to long-standing bugs
in Cabal itself.
2018-07-18 10:25:40 +02:00
Niklas Hambüchen e15496203e haskell: Pass dontStrip to cabal. Fixes #43506 2018-07-14 03:41:39 +02:00
John Ericson 0299641c91 haskell generic-builder: Make test and benchmark tool depends nativeBuildInputs
This was reverted in 6e07a3a19a with the
other commits in the PR, as the number of overrides added in that PR was deemed
excessive. But this commit adds no overrides, and is valuable on its
own, so I am adding it back.

(cherry picked from commit 359e0ce4bb)
2018-07-09 12:30:18 -04:00
Peter Simons 6e07a3a19a
Revert "haskell generic-builder: Use strictDeps always" 2018-07-04 13:18:21 +02:00
John Ericson ceaf285c0c haskell generic-builder: Use strictDeps always
This helps avoid the `ARG_MAX` issues we've been having, and is
generally a good idea to ensure cross comparability anyways.
2018-07-02 15:51:14 -04:00
John Ericson 359e0ce4bb haskell generic-builder: Make test and benchmark tool depends nativeBuildInputs
I suppose I forgot these when I did this before.
2018-07-02 15:51:14 -04:00
Peter Simons 5c80983e75 haskell-generic-builder: bake the package name and version into --docdir
If we use a --docdir that's not specific to the package, then different builds
will install their license files into the same location, which leads to file
collisions if those are ever joined into the same environment.

Fixes https://github.com/NixOS/nixpkgs/issues/35024.
2018-06-22 17:50:11 +02:00
Matthew Bauer fd7a6ea0af haskell: make generic builder follow compiler’s shared config
enableShared in generic-builder.nix should default to what the GHC
compiler was compiled with. Add a passthru to all of the GHC compilers
to hold the value of enableShared. If enableShared is not set in the
GHC we just use false as the default value for enableSharedLibraries.

Note: I may have missed some compilers. Only GHC & GHCJS are covered
by this commit but this shouldn’t break evaluation of anything else.
2018-06-20 18:40:53 -04:00
John Ericson 37eca93aab haskell generic-builder: Only pass --extra-* for host deps 2018-06-19 10:57:48 -04:00
Pascal Wittmann d21653f465 haskell generic-buider: nativeGhc should be a depsBuildBuild
It targets the build platform.
2018-06-19 10:57:37 -04:00
John Ericson f8ec07e836 haskell generic-builder: Always use separate pkg db for custom setup
This decreases complexity and ensures setup dependencies are properly
specified with `setup-depends` as they should be. Testing will say if
this is a reasonable change.
2018-06-18 14:07:37 -04:00
John Ericson 529a0f74ed haskell generic-builder: Use separate setup db in more cases
Use for cross and GHCJS whether or not there are setup depends.
2018-06-13 11:34:25 -04:00
John Ericson eeeaab8d5e haskell generic-builder: Fix setup depends
I was referring to the wrong package db in a few places. Thanks
@ElvishJerricco for catching.
2018-06-12 14:07:33 -04:00
Matthew Bauer e4e8967269 haskell: fixup merge of c425a1fc50
This was accidentally included even though setupHaskellDepends is
already listed above.
2018-05-31 14:06:56 -04:00
Ryan Trinkle c425a1fc50 haskell: add *FrameworkDepends arguments 2018-05-31 14:04:10 -04:00
Ryan Mulligan e8c5d867a1 use https for default Hackage homepage 2018-05-28 12:48:16 -07:00
Jan Malakhovski ad35019501 Merge branch 'master' into staging
Fixed conflicts:
- lib/systems/for-meta.nix: in favor of staging
- pkgs/os-specific/darwin/xcode/default.nix: in favor of master
2018-05-26 00:20:17 +00:00
John Ericson 2e70a75b12 haskell generic-builder: Limit usage of --extra-framework-dirs for compat 2018-05-25 14:52:58 -04:00
John Ericson d7144e708b Merge remote-tracking branch 'upstream/master' into staging 2018-05-23 16:00:04 -04:00
Moritz Angermann 87afa66a63 haskell infra: Adds buildFlags logic 2018-05-23 10:27:42 -04:00
Moritz Angermann affeb0cb80 haskell generic builder: Do the links dance only if shared is enabled. 2018-05-23 10:27:41 -04:00
Moritz Angermann a4d5dbd45d haskell generic builder: Disable static libs on Windows because no -staticlib
The reason why this does not work is not that we can't built static
objects, we can, but we can't use `-staticlib` on GHC on windows.
`-staticlib` rolls all dependencies into a combined archive. While this
would work on windows if we used gnu ar and MRI script, GHC can't rely
on GNU ar, and as such has a quick archive concatenation module for GNU
and BSD archives only.
2018-05-23 10:27:41 -04:00
Moritz Angermann 38fbdcc726 haskell generic builder: Use setup package database for setup-depends
Adapted from b69f420121 by @Ericson2314
2018-05-23 10:27:41 -04:00
John Ericson e1b9419dec haskell generic builder: setupHaskellDepends should be `nativeBuildInputs
This is because they are just for Setup.hs, so they are just used at build time
and completely isolated from the normal components' dependencies.

This was previous implemented in 8a8f0408cd, but
reverted in e69c7f5641 because it broken
setup-depends non-cross in haskell shell environments (custom Setup.hs in cross
shell environments has never worked). This version adds a special native
exception to avoid that breakage.
2018-05-23 10:27:39 -04:00
John Ericson 513cd3de0e haskell-generic-builder: Add extra framework dirs
Just like with the other `--extra-*` flags, cc/ld-wrapper already handles
this, but we need to make Cabal aware so that the haskell builds have
the correct metadata.
2018-05-23 10:26:57 -04:00
John Ericson 3394c96655 haskell generic-builder: Tiny changes that preserve hases
These bring us closer to staging at no cost
2018-05-23 10:23:06 -04:00
John Ericson 446cb32ea1 haskell generic-builder: Remove merge conflict
I forgot this in 17316643fd
2018-05-23 10:11:03 -04:00
John Ericson 18742471af Merge remote-tracking branch 'upstream/master' into staging
Use newer vagrant from master
2018-05-23 09:40:37 -04:00
Peter Simons 5db3a9df5e
Revert "ghc, haskell infra: #40642 direct to master" 2018-05-23 09:36:16 +02:00
John Ericson d6ecbbe921
Merge branch 'staging' into feature/clean-ghc 2018-05-21 17:43:30 -04:00
Moritz Angermann 82a847a04b haskell infra: Adds buildFlags logic 2018-05-21 15:11:11 -04:00
Moritz Angermann 5e589a4049 haskell generic builder: Do the links dance only if shared is enabled. 2018-05-21 15:11:11 -04:00
Moritz Angermann 4ea33def46 haskell generic builder: Disable static libs on Windows because no -staticlib
The reason why this does not work is not that we can't built static
objects, we can, but we can't use `-staticlib` on GHC on windows.
`-staticlib` rolls all dependencies into a combined archive. While this
would work on windows if we used gnu ar and MRI script, GHC can't rely
on GNU ar, and as such has a quick archive concatenation module for GNU
and BSD archives only.
2018-05-21 15:11:11 -04:00
Moritz Angermann 15759df660 haskell generic builder: Use setup package database for setup-depends
Adapted from b69f420121 by @Ericson2314
2018-05-21 15:11:10 -04:00
John Ericson 900862ea3b haskell generic builder: setupHaskellDepends should be `nativeBuildInputs
This is because they are just for Setup.hs, so they are just used at build time
and completely isolated from the normal components' dependencies.

This was previous implemented in 8a8f0408cd, but
reverted in e69c7f5641 because it broken
setup-depends non-cross in haskell shell environments (custom Setup.hs in cross
shell environments has never worked). This version adds a special native
exception to avoid that breakage.
2018-05-21 15:09:51 -04:00
John Ericson 2241dedbe6
Merge pull request #40442 from obsidiansystems/cabal-frameworks
haskell-generic-builder: Add extra framework dirs
2018-05-18 18:08:20 -04:00
John Ericson c6f742b770 haskell-generic-builder: Add extra framework dirs
Just like with the other `--extra-*` flags, cc/ld-wrapper already handles
this, but we need to make Cabal aware so that the haskell builds have
the correct metadata.
2018-05-18 17:49:41 -04:00
Matthew Justin Bauer eeb016e8f0
Merge branch 'staging' into fix-ncurses-darwin-extensions 2018-05-02 15:40:38 -05:00
Jan Malakhovski 9345fc51d1 haskell-generic-builder: be explicit about doCheck, cleanup 2018-04-26 20:22:44 +00:00
John Ericson ba52ae5048 treewide: isArm -> isAarch32
Following legacy packing conventions, `isArm` was defined just for
32-bit ARM instruction set. This is confusing to non packagers though,
because Aarch64 is an ARM instruction set.

The official ARM overview for ARMv8[1] is surprisingly not confusing,
given the overall state of affairs for ARM naming conventions, and
offers us a solution. It divides the nomenclature into three levels:

```
ISA:             ARMv8   {-A, -R, -M}
                 /    \
Mode:     Aarch32     Aarch64
             |         /   \
Encoding:   A64      A32   T32
```

At the top is the overall v8 instruction set archicture. Second are the
two modes, defined by bitwidth but differing in other semantics too, and
buttom are the encodings, (hopefully?) isomorphic if they encode the
same mode.

The 32 bit encodings are mostly backwards compatible with previous
non-Thumb and Thumb encodings, and if so we can pun the mode names to
instead mean "sets of compatable or isomorphic encodings", and then
voilà we have nice names for 32-bit and 64-bit arm instruction sets
which do not use the word ARM so as to not confused either laymen or
experienced ARM packages.

[1]: https://developer.arm.com/products/architecture/a-profile
2018-04-25 15:28:55 -04:00
Will Fancher 0879138cb7 GHC: Don't use --profiling-detail on GHC < 8.0.2 2018-03-29 00:28:05 -04:00
Will Fancher 0a8359f18c GHCJS: Fix autogenerated node executables 2018-03-25 20:43:23 -04:00
Jude Taylor d6a0652d6d
Merge pull request #37509 from pikajude/darwin-hs-dynamic
Haskell: fix static libs on darwin
2018-03-21 14:36:08 -07:00
Will Dietz 2a30ab3865
Merge pull request #37486 from dtzWill/fix/ghc-glibcLocales
haskell: only use glibcLocales when using glibc
2018-03-20 22:55:44 -05:00
Jude Taylor 0458c7b885 fix static libs on darwin 2018-03-20 15:26:00 -07:00
Will Dietz 8727284a4b haskell: only use glibcLocales when using glibc
Fixes eval w/musl.

Possible alternative would be using glibcLocales
when it is non-null, to avoid duplicating the logic.
2018-03-20 14:38:40 -05:00
Moritz Angermann 918edbe485 haskell-generic-builder: Add enableHsc2hsViaAsm for Windows cross compilation 2018-03-20 15:27:02 -04:00
John Ericson 65e24f22e6 haskell-generic-builder: Default to window + unix platforms,
Since GHC is a cross compiler, it's perfectly possible to make haskell
binaries on platforms without GHCs. `windows ++ unix` seems good enough
for now.

Also don't default `hydraPlatforms` to `platforms`. The former must be a
list of systems (strings), but the latter is a list of systems or
patterns.
2018-03-20 13:02:53 -04:00
Peter Simons f3f5d68ca3 haskell-generic-builder: cosmetic 2018-03-17 08:21:23 +01:00
Peter Simons 1978fa444d haskell-generic-builder: disable shared executable linking by default
This change raises the question of whether we should disable building of shared
libraries altogether (since we don't link them). Unfortunately, we can't,
because GHC expects shared libraries to be around when building and running
test suites, and no amount of passing --disable-shared flags at configure time
changes the fact. I *guess* that's related to the DYNAMIC_GHC_PROGRAMS = YES
flag we set when building GHC itself, but I haven't investigated it further
yet.

Closes https://github.com/NixOS/nixpkgs/issues/29011.
2018-03-17 08:21:23 +01:00
Peter Simons db5be10a4a haskell-generic-builder: fix confusion about --enable-static vs. --enable-library-vanilla 2018-03-17 08:21:23 +01:00
Peter Simons d7beae33dc haskell-generic-builder: always compile with --enable-library-for-ghci 2018-03-17 08:21:23 +01:00
Peter Simons a62b24be6d haskell-generic-builder: drop obsolete splitObjs function argument 2018-03-17 08:21:23 +01:00
Peter Simons 7f5fba75e2 haskell-generic-builder: compile profiling library variants by default
Unless specified otherwise, the default package set compiles library variants
for profiling with profiling-detail "all-functions". Executables, however, are
not built with profiling enabled.

This change increases the closure size for many Haskell programs, but the
practical advantage of having stack traces and performance measurements easily
available during development seems to outweigh that cost.

Closes https://github.com/NixOS/nixpkgs/issues/22340.
2018-03-17 08:21:22 +01:00
Peter Simons 1b0c67259e haskell: cosmetic changes to the generic builder 2018-03-05 16:44:23 +01:00
Peter Simons 25ee2516c2 haskell-generic-builder: simplify outputs attribute logic
The arguments cannot contain outputs, so the if-then-else here is pointless.
2018-02-16 16:54:16 +01:00
Peter Simons 2c13435734 haskell-generic-builder: revert "set LD_LIBRARY_PATH in shellHook"
This reverts commit e73e5c884f. Please don't
set $LD_LIBRARY_PATH! Instead, pass appropriate --extra-include-dir and
--extra-lib-dir arguments to "cabal configure" to ensure that Cabal knows
about system dependencies.
2018-02-09 19:56:20 +01:00
Peter Simons bd3379c443 haskell-generic-builder: include build-tool dependencies in shell environments
For a Haskell package "foo" the environment foo.env now contains the build tool
dependencies required for compiling the package in $PATH.

Fixes https://github.com/NixOS/cabal2nix/issues/331.
2018-02-09 19:56:20 +01:00
John Ericson 81553124cf haskell infra: nativeGhc != ghc.bootPkgs.ghc
There's no reason to wait for non-binary native to *build* cross ghc,
but we want a nix-built GHC for Setup.hs or things won't work.
2018-01-21 23:31:04 -05:00
John Ericson 54ead73271 generic-builder: Make GHC a proper dependency
Rather than just sticking it on the PATH
2018-01-21 23:27:38 -05:00
Drew Hess e4f3fe051e ghc, haskell-modules: ARM cross build fixes.
As requested in #33405.
2018-01-11 10:45:44 -05:00
Drew Hess 260749cf5d
haskell-modules: split-objs is not supported on ARM. 2018-01-03 16:00:26 -08:00
John Ericson bc066466fb haskell generic-builder: Don't use absolute path to tools, and also track strip 2018-01-02 21:04:14 -05:00
John Ericson a224dfc253 haskell infra: Fix cross as much as possible without changing hashes 2018-01-02 21:00:13 -05:00
Frederik Rietdijk 804285f589 Merge remote-tracking branch 'upstream/staging' into HEAD 2018-01-02 19:10:45 +01:00
Shea Levy 34a91b7922
haskell: Fix depending on libs with internal libs on darwin.
Thanks to @hamishmack for the pointer.

Fixes #33149.
2018-01-02 11:37:54 -05:00
John Ericson 4d2b763817
Merge pull request #26805 from obsidiansystems/cross-elegant
Make cross compilation elegant
2017-12-30 22:58:02 -05:00
John Ericson e0f1739c75 treewide: Don't use nativePkgs or crossPkgs anymore 2017-12-30 22:04:22 -05:00
Peter Simons 016aa581a7 haskell: extend generic builder to recognize mis-configured Cabal 2.x builds
Cabal 1.x says:

 | Warning: This package indirectly depends on multiple versions of the same
 | package. This is highly likely to cause a compile failure.

But in version 2.x, that warning is split into two lines differently:

 | Warning:
 |     This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure.

This commit modifies the call to "egrep" to recognize both versions by virtue
of the "-z" flag, which essentially interprets the whole configure-time output
as one long line.
2017-12-30 13:53:05 +01:00
Peter Simons 4a01a175a3
Merge pull request #33158 from shlevy/hslib-haskell-build-inputs-again
Revert "Revert "hslib: Function to extract the haskell build inputs of a package.""
2017-12-29 20:51:24 +01:00
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
Shea Levy b6d215aa79
haskell generic-builder: Support installing internal libs.
Fixes #32980.
2017-12-22 19:44:37 -05:00
Thomas Tuegel 86311030cf
haskell: set buildInputs in nix-shell env
systemBuildInputs goes in buildInputs (instead of nativeBuildInputs) so that
NIX_CFLAGS_* is set correctly and gcc works.
2017-12-18 13:49:18 -06: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
Jude Taylor 737b466031 fix ghcjs socket.io 2017-11-01 12:16:48 +01:00
John Ericson 139b4cd0e3 haskell generic-builder: Fix pkg-config dependency
It should be a nativeBuidInput
2017-09-21 15:49:55 -04:00
Peter Simons 33e34aa95b haskell-generic-builder: rename withBenchmarkDepends argument to doBenchmark
This partially undoes the change from 8788bfe762.
The 'doBenchmark' name is more consistent with the naming scheme used for
other phases, like 'doCheck', 'doHaddock', etc.
2017-09-19 15:42:51 +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 be90e9aa31 Fix broken rebase. 2017-09-04 12:35:58 +01:00
Nicholas Clarke 8c642d5937 Provide hscolour, happy, alex bin to buildInputs.
Use stdenv.lib.getBin instead of `.bin`
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
Peter Simons 5468d5c662 Merge pull request #27991 from Profpatsch/hoogleLocal-fix
Fix the `ghcWithHoogle` function to cope with the presence of separate `doc` outputs.
2017-08-19 16:26:30 +02:00
davidak 3270aa896b replace "Mac OS X" and "OS X" with "macOS"
as it is the official name since 2016

https://en.wikipedia.org/wiki/Macintosh_operating_systems#Desktop

exception are parts refering to older versions of macOS like

"GUI support for Mac OS X 10.6 - 10.12. Note that Emacs 23 and later [...]"
2017-08-07 21:41:30 +02:00
Profpatsch e9e25ec5fe pkgs/haskell-modules: expose haddockDir as passthru variable
WIP

If the `hoogle.nix` file wants to have any sane chance of finding haddock
outputs, the packages need to export the haddock folders as an identifier.

A few TODOs still stand, like passing self to the package instead of needing to
pass it to `haddockDir`. Maybe the exported identifier should be integrated into
the fixpoint somehow instead of using `passthru`?
2017-08-06 21:48:22 +02:00
Profpatsch 3f27a36912 pkgs/haskell-modules: two small vanity fixes 2017-08-06 21:46:49 +02:00
Franz Pletz b116fa5ff2
Merge branch 'master' into staging 2017-07-28 16:08:30 +02:00
michael bishop be63b1994d enable split-output builds for all haskellPackages 2017-07-27 09:12:06 +02:00
John Ericson 9be40841ea Merge remote-tracking branch 'upstream/master' into staging-base
Conflicts:
	pkgs/build-support/cc-wrapper/default.nix
	pkgs/build-support/gcc-wrapper-old/builder.sh
	pkgs/build-support/trivial-builders.nix
	pkgs/desktops/kde-4.14/kde-package/default.nix
	pkgs/development/compilers/openjdk-darwin/8.nix
	pkgs/development/compilers/openjdk-darwin/default.nix
	pkgs/development/compilers/openjdk/7.nix
	pkgs/development/compilers/openjdk/8.nix
	pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
	pkgs/development/compilers/zulu/default.nix
	pkgs/development/haskell-modules/generic-builder.nix
	pkgs/misc/misc.nix
	pkgs/stdenv/generic/builder.sh
	pkgs/stdenv/generic/setup.sh
2017-07-26 13:46:04 -04:00
John Ericson ea7d13cf1a stdenv-setup and misc hooks: Work with bash-3.4 for MacOS nix-shell
This is a temporary measure until this impurity is removed from Nix.
2017-07-26 09:08:01 -04:00