Commit Graph

122 Commits

Author SHA1 Message Date
Matthew Bauer
eaa5e85b35 haskell: add more hackage mirrors, use mirrors in more places
Fixes #58971
2019-04-05 13:51:56 -04:00
Silvan Mosberger
2075b3715b Revert "shellFor: Don't suck in src to compare to deps. [Fixes #51079]" 2019-02-15 12:18:44 +01:00
Will Fancher
24ccaf65df shellFor: Don't suck in src to compare to deps. [Fixes #51079] 2019-01-29 16:29:18 -05:00
Doug Beardsley
0cb5b013c0 Overrides can be passed to callHackageDirect 2019-01-27 12:28:01 -05:00
Doug Beardsley
83624524e2 Add a callHackage variant that doesn't require all-cabal-hashes 2018-12-25 12:19:24 -05:00
Guillaume Bouchard
62882d8cd2 haskellSrc2nix: disallow substitutes
Fix #49818. See the bug for more details.

The work done by haskellSrc2nix is usually lightweight, but needs to
be done each time a cabal file change. This triggers unexpected
network activity for a cache query which results most of the time on a
cache miss.

By disabling substitutes we:

- avoid the, mostly useless, binary cache query
- avoid unexpected network failure when users change a cabal file and
  try to rebuild without connectivity.
2018-11-22 16:24:13 +01:00
Doug Beardsley
c3c82aa675 Update developPackage documentation 2018-10-17 14:44:07 -04:00
Doug Beardsley
d36c55a530 Add name parameter to developPackage 2018-10-16 09:38:57 -04:00
Silvan Mosberger
5067773e39 haskellPackages.*.env: Use shellFor 2018-10-03 18:00:29 +02:00
Silvan Mosberger
56da05d459 haskellPackages.shellFor: Clean and fixup
- Now correctly sets NIX_GHC* env vars
2018-10-03 18:00:29 +02:00
John Ericson
9f768ff43c
Merge pull request #46795 from obsidiansystems/late-bind-buildHaskellPackages
haskell infra: "late bind" `buildHaskellPackages`
2018-09-17 16:20:56 -04:00
John Ericson
8da28de0e8 haskell infra: "late bind" buildHaskellPackages
This way it can be overridden.
2018-09-17 16:01:26 -04:00
Bas van Dijk
d05a8bb410
Merge pull request #44424 from dhess/callCaball2nixWithOption
haskell-modules: add callCabal2nixWithOptions.
2018-09-11 09:00:03 +02:00
Shea Levy
b00b2363b3
haskellPackages.shellFor: fix after recent getHaskellBuildInputs fix.
Fixes #45318
2018-08-19 15:17:35 -04:00
Bas van Dijk
e9b7e73120
Merge pull request #44356 from ElvishJerricco/callcabal2nix-passthru-deriver
callCabal2nix: Passthru deriver
2018-08-11 10:34:06 +02:00
Will Fancher
08b766921d callCabal2nix: Passthru deriver 2018-08-10 11:38:09 -04:00
Drew Hess
4abb8be7ab
haskell-modules: add callCabal2nixWithOptions.
Fixes #44377.
2018-08-03 12:55:29 -07:00
Will Dietz
da5383006d haskell-modules: only include glibc locales when using glibc
Fixes #43665.
Hopefully. :)
2018-07-17 08:44:17 -05:00
John Ericson
f27f491784 Haskell infra: Do callPackage splicing 2018-07-09 16:39:37 -04:00
John Ericson
f379be939c haskell infra: Use self.ghc rather than closing over initial value 2018-06-07 14:27:44 -04:00
John Ericson
ecabdfd12f
Merge pull request #41330 from obsidiansystems/haskellSrc2nix-overriding
haskell infra: Allow overriding `haskellSrc2nix`
2018-05-31 16:42:16 -04:00
John Ericson
58ce59dd96 haskell infra: Allow overriding haskellSrc2nix 2018-05-31 16:29:02 -04:00
Peter Simons
07a045922d
Merge pull request #40710 from ElvishJerricco/overrideCabal-getHaskellBuildInputs
Make getHaskellBuildInputs / shellFor work with overrideCabal (Fixes #40266)
2018-05-22 10:37:26 +02:00
John Wiegley
d33322d449
haskellPackages.developPackage: Add a defaulted provideDrv argument
The purpose of this argument is to allow you to get at the derivation (rather
than it's env) even when in the evaluation context of a nix-shell invocation.
2018-05-18 13:04:18 -07:00
Will Fancher
5523ec8f3c Make getHaskellBuildInputs / shellFor work with overrideCabal 2018-05-17 20:35:53 -04:00
Will Fancher
155dfe385e callHackage: Keep deriver, like callCabal2nix 2018-03-25 03:12:28 -04:00
Ken Micklas
f34e136a04 callCabal2nix: Use host platform rather than build platform for evaluation of Cabal files 2018-03-11 22:02:32 -04:00
Robert Hensing
a90294afe4 haskell.lib.haskellSrc2nix: add extraCabal2nixOptions 2018-03-09 14:52:34 +01:00
Will Fancher
9adb4d25e6 Haskell: Added haskellPackages.shellFor 2018-03-06 16:34:05 -05:00
Shea Levy
62a1abe204
haskellPackages.callCabal2nix: Depend on the expression.
This ensures that as long as the package derivation is alive, its nix
expressions do not need to be regenerated.

Fixes #36190.
2018-03-02 09:37:02 -05:00
Shea Levy
7f623cfa45
callCabal2nix: Fix filtering for non-cleanSourceable sources.
What was here before wasn't correct anyway, and now it works in
restricted mode.

Fixes #35207
2018-02-28 14:22:19 -05:00
Will Fancher
627444cfc2 Use static cabal2nix in callCabal2nix 2018-02-11 18:33:20 -05:00
Shea Levy
943592f698
Add setFunctionArgs lib function.
Among other things, this will allow *2nix tools to output plain data
while still being composable with the traditional
callPackage/.override interfaces.
2018-01-31 14:02:19 -05:00
pjan vandaele
bdffbc775e
Adds modifier option to developPackage 2018-01-30 12:29:59 +09:00
Ben Gamari
bf687907d7 haskell lib: Make Cabal compiler names explicit
Cabal2nix expects a --compiler flag that contains a Cabal Compiler description.
We used to use the compiler's derivation name for this, but this breaks when
cross-compiling due to the target suffix. Instead we add an explicit
haskellCompilerName attribute to Haskell compiler derivations.
2018-01-21 23:31:05 -05: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
Will Fancher
9047a7dd33 Move packageSourceOverrides to haskellLib 2018-01-18 16:42:56 -05:00
Shea Levy
4e78aeb441
callCabal2nix: Fix calling with a path in the store. 2018-01-11 10:17:56 -05:00
Shea Levy
fb2b6ac373
callCabal2nix: Use cleanSourceWith for composable filtering 2018-01-10 12:46:45 -05:00
Robin Gloster
b2e9096f68
ghcWithPackages: fix ghc version passing
The correct ghc version was not passed through anymore, I'm not entirely
sure this is the correct fix or if this is the only argument that was
missing.

broken by 5e31e828f8

cc @Ericson2314
2018-01-07 03:36:19 +01:00
John Ericson
dea9fceb0b ghcWithPackages: Get rid of unused passthrough
If you want the whole packages set...don't use ghcWithPackages.
2018-01-04 14:49:50 -05:00
John Ericson
5e31e828f8 ghcWithPackages: Fix cross, and avoid needless C compiler 2018-01-03 01:24:57 -05:00
John Ericson
a224dfc253 haskell infra: Fix cross as much as possible without changing hashes 2018-01-02 21:00:13 -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
42519a0f87
callCabal2nix: Take advantage of new hpack support. 2017-12-07 15:26:51 -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
Will Fancher
a38a3e2129 Extract files one at a time from all-cabal-hashes 2017-11-06 16:49:09 -05:00
Will Fancher
8caf9f13a6 Revert "Merge branch 'all-cabal-hashes-components'"
This reverts commit ad6b8f438d, reversing
changes made to 2d44e72801.
2017-11-06 16:47:29 -05:00
Ryan Trinkle
160685725e haskell-packages: fix all-cabal-hashes component lookup
Previously, if a package name in a later component was a substring of a package name in an earlier component, the earlier component would be selected due to a partial-name match.  This commit prevents partial matches.
2017-10-24 09:43:29 -04:00
Will Fancher
aadbef00bd callCabal2nix: Don't rebuild unchanged cabal file (Fixed #23880) 2017-10-24 03:00:07 -04:00
Shea Levy
843e0992ca
Partition all-cabal-hashes into case-insensitive-safe components.
OS X by default has a case-insensitive filesystem, and fetching
all-cabal-hashes there fails due to a hash mismatch caused by package
pairs like compactable and Compactable. This partitions the package set
such that each partition contains no equivalent-up-to-case pairs.
2017-10-12 14:57:21 -04:00
Shea Levy
1a1ad1a17d Revert "Merge branch 'improved-make-overridable' of git://github.com/ElvishJerricco/nixpkgs"
This reverts commit c3af1210b4, reversing
changes made to 49f175cd0c.
2017-09-29 09:11:26 -04:00
Will Fancher
dbd5009376 Merge branch 'master' into improved-make-overridable 2017-09-12 17:30:35 -04: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
Peter Simons
1357268b90 Merge pull request #28478 from obsidiansystems/haskell-custom-stdenv
haskell infra: Make sure packages get custom stdenv
2017-09-05 11:14:57 +02:00
Nicholas Clarke
330d874ee3 Disable separate etc output for hscolour.
This is not needed, since `hscolour` has no output to `/etc`, and it
breaks certain old builds (see https://hydra.nixos.org/build/57925511)
because the older cabal used does not understand this flag.
2017-09-04 12:35:57 +01:00
Will Fancher
4d860389d8 Merge branch 'master' into improved-make-overridable 2017-08-26 11:39:13 -04:00
John Ericson
19de1f537e haskell infra: Make sure packages get custom stdenv
One of the goals of 74f5fe5 was to allow passing in a custom stdenv,
which would be used for genericBuilder's `mkDerivation` call. That does
work, but if packages takes `stdenv` as an parameter for any reason,
they'll get the default one instead. This change remedies it.
2017-08-22 16:00:21 -04:00
Profpatsch
3f27a36912 pkgs/haskell-modules: two small vanity fixes 2017-08-06 21:46:49 +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
Will Fancher
8b764960e9 Added overrideScope for callPackageWith
Consequently removing several ad-hoc definitions of the same concept.
2017-07-13 14:56:13 -04:00
Gleb Peregud
0123200dee stdenv: add stawman docs for makeOverridable
Also fix a typo in docs in haskell-modules.
2017-06-24 12:47:57 +02:00
Shea Levy
b349d4b899 haskellPackages.developPackage: Add overrides argument 2017-06-12 19:29:46 -04:00
Shea Levy
01e047d088 Add haskellPackages.developPackage for local development default.nixes 2017-06-10 20:13:21 -04:00
Shea Levy
219bb1c80c Add packageSourceOverrides function to haskell package sets 2017-06-10 20:13:17 -04:00
Shea Levy
ac1599971f hackage2nix: Pull haskellSrc2nix from the final package set 2017-05-10 08:03:57 -04:00
Shea Levy
9f2bbf65af haskellSrc2nix: preferLocalBuild and use unwrapped cabal2nix.
No need to download bazaar etc...
2017-05-01 18:21:42 -04:00
Benno Fünfstück
6b36d26a24 haskell: add more callPackageWithScope docs 2017-04-25 16:08:44 +02:00
Benno Fünfstück
731e0fa742 haskell: preserve overrideScope on override
We want code such as `(pkg.override {}).overrideScope (self: super: {})` to
work. This didn't work before, since `override` will call the original package
again, and the attribute `overideScope`, which `callPackageWithScope` added,
wasn't added again. The fix for this is to modify the package function itself
to include the `callPackageWithScope` attribute, so it'll be re-added whenever
the function is overriden for with arguments.

There is a small problem here though: since callPackage uses some magic
(`builtins.functionArgs`) to determine the auto-arguments of a function, we
can't just write `callPackageWith scope drvScope`, since
`builtins.functionArgs drvScope` will be `{}`. To fix this, we implement our own
`callPackageWith`.

Fixes https://github.com/NixOS/nixpkgs/issues/7953.
Closes https://github.com/NixOS/nixpkgs/pull/9336.
2017-04-25 16:08:43 +02: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