lol
fork

Configure Feed

Select the types of activity you want to include in your feed.

haskell.lib: remove controlPhases and ghcInfo

authored by

sternenseemann and committed by
Wolfgang Walther
6bd08025 60dfb9ba

+8 -44
+8
doc/release-notes/rl-2511.section.md
··· 48 48 49 49 - 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. 50 50 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 + 51 59 - `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). 52 60 53 61 - `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".
-30
pkgs/development/haskell-modules/lib/compose.nix
··· 572 572 # nix-shell evaluation, return a nix-shell optimized environment. 573 573 shellAware = p: if lib.inNixShell then p.env else p; 574 574 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 - 605 575 # Utility to convert a directory full of `cabal2nix`-generated files into a 606 576 # package override set 607 577 #
-14
pkgs/development/haskell-modules/lib/default.nix
··· 333 333 # nix-shell evaluation, return a nix-shell optimized environment. 334 334 shellAware = compose.shellAware; 335 335 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 - 350 336 # Utility to convert a directory full of `cabal2nix`-generated files into a 351 337 # package override set 352 338 #