haskell.lib: remove controlPhases and ghcInfo

This commit is contained in:
sternenseemann
2025-07-07 23:07:39 +02:00
committed by Wolfgang Walther
parent 60dfb9bae8
commit 6bd080254c
3 changed files with 8 additions and 44 deletions
+8
View File
@@ -48,6 +48,14 @@
- 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.
- The `ghcInfo` and `controlPhases` functions have been removed from `haskell.lib.compose` and `haskell.lib`. They were unused and would return incorrect results.
- Instead of using `controlPhases`, the `doCheck` attribute of derivations can be accessed which is more accurate. `doBenchmark` can't be introspected at the moment.
- To detect cross compilation, the relevant platforms exposed by `stdenv` should be compared instead of using `ghcInfo`.
- Nixpkgs no longer packages any `ghcjs` compiler.
- To find a suitable `nativeGhc`, `buildHaskellPackages` should be used. `ghcInfo` would use `ghc.bootPkgs.ghc` if cross compiling,
and the given `ghc` otherwise. This approach is not recommended since it results in mismatched GHC versions.
- `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).
- `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".
@@ -572,36 +572,6 @@ rec {
# nix-shell evaluation, return a nix-shell optimized environment.
shellAware = p: if lib.inNixShell then p.env else p;
ghcInfo = ghc: rec {
isCross = (ghc.cross or null) != null;
isGhcjs = ghc.isGhcjs or false;
nativeGhc = if isCross || isGhcjs then ghc.bootPkgs.ghc else ghc;
};
### mkDerivation helpers
# These allow external users of a haskell package to extract
# information about how it is built in the same way that the
# generic haskell builder does, by reusing the same functions.
# Each function here has the same interface as mkDerivation and thus
# can be called for a given package simply by overriding the
# mkDerivation argument it used. See getHaskellBuildInputs above for
# an example of this.
# Some information about which phases should be run.
controlPhases =
ghc:
let
inherit (ghcInfo ghc) isCross;
in
{
doCheck ? !isCross,
doBenchmark ? false,
...
}:
{
inherit doCheck doBenchmark;
};
# Utility to convert a directory full of `cabal2nix`-generated files into a
# package override set
#
@@ -333,20 +333,6 @@ rec {
# nix-shell evaluation, return a nix-shell optimized environment.
shellAware = compose.shellAware;
ghcInfo = compose.ghcInfo;
### mkDerivation helpers
# These allow external users of a haskell package to extract
# information about how it is built in the same way that the
# generic haskell builder does, by reusing the same functions.
# Each function here has the same interface as mkDerivation and thus
# can be called for a given package simply by overriding the
# mkDerivation argument it used. See getHaskellBuildInputs above for
# an example of this.
# Some information about which phases should be run.
controlPhases = compose.controlPhases;
# Utility to convert a directory full of `cabal2nix`-generated files into a
# package override set
#