Skip to content

Commit 6bd0802

Browse files
sternenseemannwolfgangwalther
authored andcommitted
haskell.lib: remove controlPhases and ghcInfo
1 parent 60dfb9b commit 6bd0802

3 files changed

Lines changed: 8 additions & 44 deletions

File tree

doc/release-notes/rl-2511.section.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@
4848

4949
- The GHCJS 8.10.7, exposed via `haskell.compiler.ghcjs` and `haskell.compiler.ghcjs810`, has been removed. Downstream users should migrate their projects to the new JavaScript backend of GHC proper which can be used via `pkgsCross.ghcjs` from Nixpkgs.
5050

51+
- The `ghcInfo` and `controlPhases` functions have been removed from `haskell.lib.compose` and `haskell.lib`. They were unused and would return incorrect results.
52+
53+
- Instead of using `controlPhases`, the `doCheck` attribute of derivations can be accessed which is more accurate. `doBenchmark` can't be introspected at the moment.
54+
- To detect cross compilation, the relevant platforms exposed by `stdenv` should be compared instead of using `ghcInfo`.
55+
- Nixpkgs no longer packages any `ghcjs` compiler.
56+
- To find a suitable `nativeGhc`, `buildHaskellPackages` should be used. `ghcInfo` would use `ghc.bootPkgs.ghc` if cross compiling,
57+
and the given `ghc` otherwise. This approach is not recommended since it results in mismatched GHC versions.
58+
5159
- `gnome-keyring` no longer ships with an SSH agent anymore because it has been deprecated upstream. You should use `gcr_4` instead, which provides the same features. More information on why this was done can be found on [the relevant GCR upstream PR](https://gitlab.gnome.org/GNOME/gcr/-/merge_requests/67).
5260

5361
- `stdenv.mkDerivation` and other derivation builders that use it no longer allow the value of `env` to be anything but an attribute set, for the purpose of setting environment variables that are available to the [builder](https://nix.dev/manual/nix/latest/store/derivation/#builder) process. An environment variable called `env` can still be provided by means of `mkDerivation { env.env = ...; }`, though we recommend to use a more specific name than "env".

pkgs/development/haskell-modules/lib/compose.nix

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -572,36 +572,6 @@ rec {
572572
# nix-shell evaluation, return a nix-shell optimized environment.
573573
shellAware = p: if lib.inNixShell then p.env else p;
574574

575-
ghcInfo = ghc: rec {
576-
isCross = (ghc.cross or null) != null;
577-
isGhcjs = ghc.isGhcjs or false;
578-
nativeGhc = if isCross || isGhcjs then ghc.bootPkgs.ghc else ghc;
579-
};
580-
581-
### mkDerivation helpers
582-
# These allow external users of a haskell package to extract
583-
# information about how it is built in the same way that the
584-
# generic haskell builder does, by reusing the same functions.
585-
# Each function here has the same interface as mkDerivation and thus
586-
# can be called for a given package simply by overriding the
587-
# mkDerivation argument it used. See getHaskellBuildInputs above for
588-
# an example of this.
589-
590-
# Some information about which phases should be run.
591-
controlPhases =
592-
ghc:
593-
let
594-
inherit (ghcInfo ghc) isCross;
595-
in
596-
{
597-
doCheck ? !isCross,
598-
doBenchmark ? false,
599-
...
600-
}:
601-
{
602-
inherit doCheck doBenchmark;
603-
};
604-
605575
# Utility to convert a directory full of `cabal2nix`-generated files into a
606576
# package override set
607577
#

pkgs/development/haskell-modules/lib/default.nix

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -333,20 +333,6 @@ rec {
333333
# nix-shell evaluation, return a nix-shell optimized environment.
334334
shellAware = compose.shellAware;
335335

336-
ghcInfo = compose.ghcInfo;
337-
338-
### mkDerivation helpers
339-
# These allow external users of a haskell package to extract
340-
# information about how it is built in the same way that the
341-
# generic haskell builder does, by reusing the same functions.
342-
# Each function here has the same interface as mkDerivation and thus
343-
# can be called for a given package simply by overriding the
344-
# mkDerivation argument it used. See getHaskellBuildInputs above for
345-
# an example of this.
346-
347-
# Some information about which phases should be run.
348-
controlPhases = compose.controlPhases;
349-
350336
# Utility to convert a directory full of `cabal2nix`-generated files into a
351337
# package override set
352338
#

0 commit comments

Comments
 (0)