Commit graph

235 commits

Author SHA1 Message Date
John Ericson d8dd301412 haskell generic-builder: Hack so CPP without a CC works 2019-12-25 14:34:40 -05:00
John Ericson 6a23c9ddbe haskell generic-builder: Fix --with-ghc flag for GHCJS as cross
Otherwise it passes `--with-ghc=ghc`, and we do the wrong thing.
2019-12-25 13:14:48 -05:00
John Ericson ea9a2c5ec2 haskell genenric-builder: Make the C compiler optional
This is GHCJS, and perhaps other obscure targets.
2019-11-25 00:12:39 +00:00
volth f3282c8d1e treewide: remove unused variables (#63177)
* treewide: remove unused variables

* making ofborg happy
2019-06-16 19:59:05 +00:00
Frederik Rietdijk bae32a9f5c Merge staging-next into staging 2019-04-16 18:54:15 +02:00
(cdep)illabout 757099e8f1 haskell-generic-builder: disable library-for-ghci by default
This commit disables the library-for-ghci flag passed to
`Setup configure` in the Haskell generic-builder.nix file.

This stops the HSfoo.o file from being built.  Building this
HSfoo.o file caused doctest to take an extremely long time
to load dependencies when running.

This is a follow-up from https://github.com/NixOS/nixpkgs/pull/58743.
2019-04-12 11:55:22 +02:00
Matthew Bauer eaa5e85b35 haskell: add more hackage mirrors, use mirrors in more places
Fixes #58971
2019-04-05 13:51:56 -04:00
(cdep)illabout a5b85222ff Add option to disable library-for-ghci in the generic haskell builder.
Closes https://github.com/NixOS/nixpkgs/pull/58743.
2019-04-02 11:46:48 +02:00
Domen Kožar bd06834d5e
haskell: allow separate bin output, disable by default 2019-03-29 15:10:42 +07:00
Michael Peyton Jones 387c513d12 generic Haskell builder: don't copy packages from GHC
In order to build the package databases that we will use when compiling
a Haskell package, we iterate over the relevant dependencies, and if
they contain a package db, we copy its contents over.

So far so good, except when one of those dependencies is GHC. This
doesn't happen ordinarily, but it will happen when we construct the
package database for compiling `Setup.hs`.  This is compiled for the
build architecture, so we get the build deps, including both the native
and the cross GHC (if there is one).

In this case, we end up copying the packages from the GHC's package
database. This is at best unnecessary, since we will get those packages
from the GHC when we compile with it.

At worst, however, this is semantically questionable. We can end up
having multiple copies of e.g. Cabal with the same version, but
(potentially) different contents. At the moment, GHC will expose one of
these at semi-random depending on which one it looks at "first".
However, there is a MR open [in
GHC](https://gitlab.haskell.org/ghc/ghc/merge_requests/545) which as a
side effect will instead expose both, leading to ambiguous module
warnings (which is not unreasonable, since it *is* ambiguous).

So what can we do about it? The simplest solution is just to not copy
the package databases from GHC. GHC is special in this regard, so I
think it's okay to treat it specially.

This PR should have no effect on anything now, but will prevent any
breakage when/if the GHC patch lands.

Closes https://github.com/NixOS/nixpkgs/pull/57706.
2019-03-17 09:21:20 +01:00
Nathan van Doorn a86ffa4988 haskell-modules/generic-builder.nix: add haddockFlags option 2019-02-22 10:32:15 +01:00
Kosyrev Serge e505891a5c haskell/generic-buidler: make installPhase handle Cabal 2.5's lax fields 2019-02-02 13:13:18 +01:00
Kosyrev Serge 2e5c9ba727 haskell generic-builder.nix: adapt to package config files having more spaces 2019-01-27 10:26:07 +01:00
Will Fancher 55fe0276b8 Limit parallel building of Haskell packages. [Fixes #53665] 2019-01-21 08:57:54 +01:00
Shea Levy 30fb5b0dcf
haskell generic builder: Add flag to allow inconsistent dependencies. 2018-12-15 13:31:08 -05:00
Falco Peijnenburg 0ff9a7a2cd haskellPackages.*.env: Fixed shellHook being ignored
The problem was introduced in 2bafa93b75464eee5744653319d8046e05cf141a
2018-11-04 17:03:35 +01:00
Will Fancher 0ee01e6c2e haskellPackages.shellFor: Add nativeBuildInputs [Fixes #48435] 2018-10-18 18:32:53 -04:00
Drew Hess 4babe7f799
haskell: re-enable aarch64, but disable parallel builds on that arch.
This is a workaround for unreliable parallel Haskell builds on
aarch64. See https://ghc.haskell.org/trac/ghc/ticket/15449
2018-10-05 01:28:42 -04:00
Silvan Mosberger 5067773e39 haskellPackages.*.env: Use shellFor 2018-10-03 18:00:29 +02:00
Silvan Mosberger 7c5c3fceff haskell.lib.getBuildInputs: Use generic builder passthru to implement 2018-10-03 18:00:29 +02:00
John Ericson f4be0b45dd
Merge pull request #46872 from obsidiansystems/cross-haskell-ar-flag
haskell infra: Also pass `--with-ar` in cross builds
2018-09-18 19:14:13 -04:00
John Ericson 750933a17c haskell infra: Also pass --with-ar in cross builds 2018-09-18 18:49:58 -04:00
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