···4647- `conduwuit` was removed due to upstream ceasing development and deleting their repository. For existing data, a migration to `matrix-conduit`, `matrix-continuwuity` or `matrix-tuwunel` may be possible.
48000000000049- `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).
5051- `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".
···4647- `conduwuit` was removed due to upstream ceasing development and deleting their repository. For existing data, a migration to `matrix-conduit`, `matrix-continuwuity` or `matrix-tuwunel` may be possible.
4849+- 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. Haskell packaging code, like `haskellPackages.mkDerivation`, `ghcWithPackages` and `hoogleWithPackages`, also no longer supports GHCJS.
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+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).
6061- `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".
···16let
17 isCross = stdenv.buildPlatform != stdenv.hostPlatform;
1819- # Note that ghc.isGhcjs != stdenv.hostPlatform.isGhcjs.
20- # ghc.isGhcjs implies that we are using ghcjs, a project separate from GHC.
21- # (mere) stdenv.hostPlatform.isGhcjs means that we are using GHC's JavaScript
22- # backend. The latter is a normal cross compilation backend and needs little
23- # special accommodation.
24- outputsJS = ghc.isGhcjs or false || stdenv.hostPlatform.isGhcjs;
25-26 # Pass the "wrong" C compiler rather than none at all so packages that just
27 # use the C preproccessor still work, see
28 # https://github.com/haskell/cabal/issues/6466 for details.
···4748{
49 pname,
50- dontStrip ? outputsJS,
51 version,
52 revision ? null,
53 sha256 ? null,
···80 doHaddockQuickjump ? doHoogle,
81 doInstallIntermediates ? false,
82 editedCabalFile ? null,
83- enableLibraryProfiling ? !outputsJS,
84 enableExecutableProfiling ? false,
85 profilingDetail ? "exported-functions",
86 # TODO enable shared libs for cross-compiling
···90 && (ghc.enableShared or false)
91 && !stdenv.hostPlatform.useAndroidPrebuilt, # TODO: figure out why /build leaks into RPATH
92 enableDeadCodeElimination ? (!stdenv.hostPlatform.isDarwin), # TODO: use -dead_strip for darwin
93- # Disabling this for ghcjs prevents this crash: https://gitlab.haskell.org/ghc/ghc/-/issues/23235
94 enableStaticLibraries ?
95 !(stdenv.hostPlatform.isWindows || stdenv.hostPlatform.isWasm || stdenv.hostPlatform.isGhcjs),
96 enableHsc2hsViaAsm ? stdenv.hostPlatform.isWindows,
···228 optionalAttrs
229 ;
230231- isGhcjs = ghc.isGhcjs or false;
232 isHaLVM = ghc.isHaLVM or false;
233234 # GHC used for building Setup.hs
235 #
236 # Same as our GHC, unless we're cross, in which case it is native GHC with the
237- # same version, or ghcjs, in which case its the ghc used to build ghcjs.
238 nativeGhc = buildHaskellPackages.ghc;
239240 # the target dir for haddock documentation
···358 (enableFeature (!dontStrip) "library-stripping")
359 (enableFeature (!dontStrip) "executable-stripping")
360 ]
361- ++ optionals isGhcjs [
362- "--ghcjs"
363- ]
364 ++ optionals isCross (
365 [
366 "--configure-option=--host=${stdenv.hostPlatform.config}"
···490491 setupCommand = "./Setup";
492493- ghcCommand' = if isGhcjs then "ghcjs" else "ghc";
494 ghcCommand = "${ghc.targetPrefix}${ghcCommand'}";
495496 ghcNameWithPrefix = "${ghc.targetPrefix}${ghc.haskellCompilerName}";
···519520 intermediatesDir = "share/haskell/${ghc.version}/${pname}-${version}/dist";
521522- # On old ghcjs, the jsexe directories are the output but on the js backend they seem to be treated as intermediates
523 jsexe = rec {
524- shouldUseNode = isGhcjs;
525 shouldAdd = stdenv.hostPlatform.isGhcjs && isExecutable;
526 shouldCopy = shouldAdd && !doInstallIntermediates;
527 shouldSymlink = shouldAdd && doInstallIntermediates;
···849 ''
850 }
851852- ${optionalString jsexe.shouldUseNode ''
853- for exeDir in "${binDir}/"*.jsexe; do
854- exe="''${exeDir%.jsexe}"
855- printWords '#!${nodejs}/bin/node' > "$exe"
856- echo >> "$exe"
857- cat "$exeDir/all.js" >> "$exe"
858- chmod +x "$exe"
859- done
860- ''}
861 ${optionalString doCoverage "mkdir -p $out/share && cp -r dist/hpc $out/share"}
862863 ${optionalString jsexe.shouldCopy ''
···16let
17 isCross = stdenv.buildPlatform != stdenv.hostPlatform;
18000000019 # Pass the "wrong" C compiler rather than none at all so packages that just
20 # use the C preproccessor still work, see
21 # https://github.com/haskell/cabal/issues/6466 for details.
···4041{
42 pname,
43+ dontStrip ? stdenv.hostPlatform.isGhcjs,
44 version,
45 revision ? null,
46 sha256 ? null,
···73 doHaddockQuickjump ? doHoogle,
74 doInstallIntermediates ? false,
75 editedCabalFile ? null,
76+ enableLibraryProfiling ? !stdenv.hostPlatform.isGhcjs,
77 enableExecutableProfiling ? false,
78 profilingDetail ? "exported-functions",
79 # TODO enable shared libs for cross-compiling
···83 && (ghc.enableShared or false)
84 && !stdenv.hostPlatform.useAndroidPrebuilt, # TODO: figure out why /build leaks into RPATH
85 enableDeadCodeElimination ? (!stdenv.hostPlatform.isDarwin), # TODO: use -dead_strip for darwin
86+ # Disabling this for JS prevents this crash: https://gitlab.haskell.org/ghc/ghc/-/issues/23235
87 enableStaticLibraries ?
88 !(stdenv.hostPlatform.isWindows || stdenv.hostPlatform.isWasm || stdenv.hostPlatform.isGhcjs),
89 enableHsc2hsViaAsm ? stdenv.hostPlatform.isWindows,
···221 optionalAttrs
222 ;
2230224 isHaLVM = ghc.isHaLVM or false;
225226 # GHC used for building Setup.hs
227 #
228 # Same as our GHC, unless we're cross, in which case it is native GHC with the
229+ # same version.
230 nativeGhc = buildHaskellPackages.ghc;
231232 # the target dir for haddock documentation
···350 (enableFeature (!dontStrip) "library-stripping")
351 (enableFeature (!dontStrip) "executable-stripping")
352 ]
000353 ++ optionals isCross (
354 [
355 "--configure-option=--host=${stdenv.hostPlatform.config}"
···479480 setupCommand = "./Setup";
481482+ ghcCommand' = "ghc";
483 ghcCommand = "${ghc.targetPrefix}${ghcCommand'}";
484485 ghcNameWithPrefix = "${ghc.targetPrefix}${ghc.haskellCompilerName}";
···508509 intermediatesDir = "share/haskell/${ghc.version}/${pname}-${version}/dist";
5100511 jsexe = rec {
0512 shouldAdd = stdenv.hostPlatform.isGhcjs && isExecutable;
513 shouldCopy = shouldAdd && !doInstallIntermediates;
514 shouldSymlink = shouldAdd && doInstallIntermediates;
···836 ''
837 }
838839+00000000840 ${optionalString doCoverage "mkdir -p $out/share && cp -r dist/hpc $out/share"}
841842 ${optionalString jsexe.shouldCopy ''
···23 packages = selectPackages haskellPackages;
2425 wrapper = ./hoogle-local-wrapper.sh;
26- isGhcjs = ghc.isGhcjs or false;
27- opts = lib.optionalString;
28- haddockExe = if !isGhcjs then "haddock" else "haddock-ghcjs";
29- ghcDocLibDir = if !isGhcjs then ghc.doc + "/share/doc/ghc*/html/libraries" else ghc + "/doc/lib";
30- # On GHCJS, use a stripped down version of GHC's prologue.txt
31- prologue =
32- if !isGhcjs then
33- "${ghcDocLibDir}/prologue.txt"
34- else
35- writeText "ghcjs-prologue.txt" ''
36- This index includes documentation for many Haskell modules.
37- '';
3839 docPackages =
40 lib.closePropagation
···84 echo importing builtin packages
85 for docdir in ${ghcDocLibDir}"/"*; do
86 name="$(basename $docdir)"
87- ${opts isGhcjs ''docdir="$docdir/html"''}
88 if [[ -d $docdir ]]; then
89 ln -sfn $docdir $out/share/doc/hoogle/$name
90 fi
···23 packages = selectPackages haskellPackages;
2425 wrapper = ./hoogle-local-wrapper.sh;
26+ haddockExe = "haddock";
27+ ghcDocLibDir = ghc.doc + "/share/doc/ghc*/html/libraries";
28+ prologue = "${ghcDocLibDir}/prologue.txt";
0000000002930 docPackages =
31 lib.closePropagation
···75 echo importing builtin packages
76 for docdir in ${ghcDocLibDir}"/"*; do
77 name="$(basename $docdir)"
078 if [[ -d $docdir ]]; then
79 ln -sfn $docdir $out/share/doc/hoogle/$name
80 fi
-30
pkgs/development/haskell-modules/lib/compose.nix
···572 # nix-shell evaluation, return a nix-shell optimized environment.
573 shellAware = p: if lib.inNixShell then p.env else p;
574575- 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 # Utility to convert a directory full of `cabal2nix`-generated files into a
606 # package override set
607 #
···572 # nix-shell evaluation, return a nix-shell optimized environment.
573 shellAware = p: if lib.inNixShell then p.env else p;
574000000000000000000000000000000575 # Utility to convert a directory full of `cabal2nix`-generated files into a
576 # package override set
577 #
-14
pkgs/development/haskell-modules/lib/default.nix
···333 # nix-shell evaluation, return a nix-shell optimized environment.
334 shellAware = compose.shellAware;
335336- 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 # Utility to convert a directory full of `cabal2nix`-generated files into a
351 # package override set
352 #
···333 # nix-shell evaluation, return a nix-shell optimized environment.
334 shellAware = compose.shellAware;
33500000000000000336 # Utility to convert a directory full of `cabal2nix`-generated files into a
337 # package override set
338 #
···13 installDocumentation ? true,
14 hoogleWithPackages,
15 postBuild ? "",
16- ghcLibdir ? null, # only used by ghcjs, when resolving plugins
17}:
1819# This argument is a function which selects a list of Haskell packages from any
···5152 packages = selectPackages haskellPackages ++ [ hoogleWithPackages' ];
5354- isGhcjs = ghc.isGhcjs or false;
55 isHaLVM = ghc.isHaLVM or false;
56- ghcCommand' = if isGhcjs then "ghcjs" else "ghc";
57 ghcCommand = "${ghc.targetPrefix}${ghcCommand'}";
58 ghcCommandCaps = lib.toUpper ghcCommand';
59 libDir =
···77 );
78in
7980-assert ghcLibdir != null -> (ghc.isGhcjs or false);
81-82if paths == [ ] && !useLLVM then
83 ghc
84else
···101 --set "NIX_${ghcCommandCaps}PKG" "$out/bin/${ghcCommand}-pkg" \
102 --set "NIX_${ghcCommandCaps}_DOCDIR" "${docDir}" \
103 --set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}" \
104- ${
105- lib.optionalString (ghc.isGhcjs or false) ''--set NODE_PATH "${ghc.socket-io}/lib/node_modules"''
106- } \
107 ${lib.optionalString useLLVM ''--prefix "PATH" ":" "${llvm}"''}
108 fi
109 done
···136 fi
137138 ''
139- + (lib.optionalString (stdenv.targetPlatform.isDarwin && !isGhcjs && !stdenv.targetPlatform.isiOS)
140- ''
141- # Work around a linker limit in macOS Sierra (see generic-builder.nix):
142- local packageConfDir="${packageCfgDir}";
143- local dynamicLinksDir="$out/lib/links";
144- mkdir -p $dynamicLinksDir
145- # Clean up the old links that may have been (transitively) included by
146- # symlinkJoin:
147- rm -f $dynamicLinksDir/*
148149- dynamicLibraryDirs=()
150151- for pkg in $($out/bin/ghc-pkg list --simple-output); do
152- dynamicLibraryDirs+=($($out/bin/ghc-pkg --simple-output field "$pkg" dynamic-library-dirs))
153- done
154155- for dynamicLibraryDir in $(echo "''${dynamicLibraryDirs[@]}" | tr ' ' '\n' | sort -u); do
156- echo "Linking $dynamicLibraryDir/*.dylib from $dynamicLinksDir"
157- find "$dynamicLibraryDir" -name '*.dylib' -exec ln -s {} "$dynamicLinksDir" \;
158- done
159160- for f in $packageConfDir/*.conf; do
161- # Initially, $f is a symlink to a read-only file in one of the inputs
162- # (as a result of this symlinkJoin derivation).
163- # Replace it with a copy whose dynamic-library-dirs points to
164- # $dynamicLinksDir
165- cp $f $f-tmp
166- rm $f
167- sed "N;s,dynamic-library-dirs:\s*.*\n,dynamic-library-dirs: $dynamicLinksDir\n," $f-tmp > $f
168- rm $f-tmp
169- done
170- ''
171- )
172 + ''
173 ${lib.optionalString hasLibraries ''
174 # GHC 8.10 changes.
···182183 $out/bin/${ghcCommand}-pkg recache
184 ''}
185- ${
186- # ghcjs will read the ghc_libdir file when resolving plugins.
187- lib.optionalString (isGhcjs && ghcLibdir != null) ''
188- mkdir -p "${libDir}"
189- rm -f "${libDir}/ghc_libdir"
190- printf '%s' '${ghcLibdir}' > "${libDir}/ghc_libdir"
191- ''
192- }
193 $out/bin/${ghcCommand}-pkg check
194 ''
195 + postBuild;
···13 installDocumentation ? true,
14 hoogleWithPackages,
15 postBuild ? "",
016}:
1718# This argument is a function which selects a list of Haskell packages from any
···5051 packages = selectPackages haskellPackages ++ [ hoogleWithPackages' ];
52053 isHaLVM = ghc.isHaLVM or false;
54+ ghcCommand' = "ghc";
55 ghcCommand = "${ghc.targetPrefix}${ghcCommand'}";
56 ghcCommandCaps = lib.toUpper ghcCommand';
57 libDir =
···75 );
76in
770078if paths == [ ] && !useLLVM then
79 ghc
80else
···97 --set "NIX_${ghcCommandCaps}PKG" "$out/bin/${ghcCommand}-pkg" \
98 --set "NIX_${ghcCommandCaps}_DOCDIR" "${docDir}" \
99 --set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}" \
000100 ${lib.optionalString useLLVM ''--prefix "PATH" ":" "${llvm}"''}
101 fi
102 done
···129 fi
130131 ''
132+ + (lib.optionalString (stdenv.targetPlatform.isDarwin && !stdenv.targetPlatform.isiOS) ''
133+ # Work around a linker limit in macOS Sierra (see generic-builder.nix):
134+ local packageConfDir="${packageCfgDir}";
135+ local dynamicLinksDir="$out/lib/links";
136+ mkdir -p $dynamicLinksDir
137+ # Clean up the old links that may have been (transitively) included by
138+ # symlinkJoin:
139+ rm -f $dynamicLinksDir/*
0140141+ dynamicLibraryDirs=()
142143+ for pkg in $($out/bin/ghc-pkg list --simple-output); do
144+ dynamicLibraryDirs+=($($out/bin/ghc-pkg --simple-output field "$pkg" dynamic-library-dirs))
145+ done
146147+ for dynamicLibraryDir in $(echo "''${dynamicLibraryDirs[@]}" | tr ' ' '\n' | sort -u); do
148+ echo "Linking $dynamicLibraryDir/*.dylib from $dynamicLinksDir"
149+ find "$dynamicLibraryDir" -name '*.dylib' -exec ln -s {} "$dynamicLinksDir" \;
150+ done
151152+ for f in $packageConfDir/*.conf; do
153+ # Initially, $f is a symlink to a read-only file in one of the inputs
154+ # (as a result of this symlinkJoin derivation).
155+ # Replace it with a copy whose dynamic-library-dirs points to
156+ # $dynamicLinksDir
157+ cp $f $f-tmp
158+ rm $f
159+ sed "N;s,dynamic-library-dirs:\s*.*\n,dynamic-library-dirs: $dynamicLinksDir\n," $f-tmp > $f
160+ rm $f-tmp
161+ done
162+ '')
0163 + ''
164 ${lib.optionalString hasLibraries ''
165 # GHC 8.10 changes.
···173174 $out/bin/${ghcCommand}-pkg recache
175 ''}
00000000176 $out/bin/${ghcCommand}-pkg check
177 ''
178 + postBuild;
···231 jobs = recursiveUpdateMany [
232 (mapTestOn {
233 haskellPackages = packagePlatforms pkgs.haskellPackages;
234- haskell.compiler =
235- packagePlatforms pkgs.haskell.compiler
236- // (lib.genAttrs
237- [
238- "ghcjs"
239- "ghcjs810"
240- ]
241- (ghcjsName: {
242- # We can't build ghcjs itself, since it exceeds 3GB (Hydra's output limit) due
243- # to the size of its bundled libs. We can however save users a bit of compile
244- # time by building the bootstrap ghcjs on Hydra. For this reason, we overwrite
245- # the ghcjs attributes in haskell.compiler with a reference to the bootstrap
246- # ghcjs attribute in their bootstrap package set (exposed via passthru) which
247- # would otherwise be ignored by Hydra.
248- bootGhcjs = (packagePlatforms pkgs.haskell.compiler.${ghcjsName}.passthru).bootGhcjs;
249- })
250- );
251-252 tests.haskell = packagePlatforms pkgs.tests.haskell;
253254 nixosTests = {
···406 # remove musl ghc865Binary since it is known to be broken and
407 # causes an evaluation error on darwin.
408 ghc865Binary = { };
409-410- ghcjs = { };
411- ghcjs810 = { };
412 };
413414 # Get some cache going for MUSL-enabled GHC.
···231 jobs = recursiveUpdateMany [
232 (mapTestOn {
233 haskellPackages = packagePlatforms pkgs.haskellPackages;
234+ haskell.compiler = packagePlatforms pkgs.haskell.compiler;
00000000000000000235 tests.haskell = packagePlatforms pkgs.tests.haskell;
236237 nixosTests = {
···389 # remove musl ghc865Binary since it is known to be broken and
390 # causes an evaluation error on darwin.
391 ghc865Binary = { };
000392 };
393394 # Get some cache going for MUSL-enabled GHC.