···46464747- `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.
48484949+- 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.
5050+5151+- The `ghcInfo` and `controlPhases` functions have been removed from `haskell.lib.compose` and `haskell.lib`. They were unused and would return incorrect results.
5252+5353+ - Instead of using `controlPhases`, the `doCheck` attribute of derivations can be accessed which is more accurate. `doBenchmark` can't be introspected at the moment.
5454+ - To detect cross compilation, the relevant platforms exposed by `stdenv` should be compared instead of using `ghcInfo`.
5555+ - Nixpkgs no longer packages any `ghcjs` compiler.
5656+ - To find a suitable `nativeGhc`, `buildHaskellPackages` should be used. `ghcInfo` would use `ghc.bootPkgs.ghc` if cross compiling,
5757+ and the given `ghc` otherwise. This approach is not recommended since it results in mismatched GHC versions.
5858+4959- `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).
50605161- `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".
···1616let
1717 isCross = stdenv.buildPlatform != stdenv.hostPlatform;
18181919- # Note that ghc.isGhcjs != stdenv.hostPlatform.isGhcjs.
2020- # ghc.isGhcjs implies that we are using ghcjs, a project separate from GHC.
2121- # (mere) stdenv.hostPlatform.isGhcjs means that we are using GHC's JavaScript
2222- # backend. The latter is a normal cross compilation backend and needs little
2323- # special accommodation.
2424- outputsJS = ghc.isGhcjs or false || stdenv.hostPlatform.isGhcjs;
2525-2619 # Pass the "wrong" C compiler rather than none at all so packages that just
2720 # use the C preproccessor still work, see
2821 # https://github.com/haskell/cabal/issues/6466 for details.
···47404841{
4942 pname,
5050- dontStrip ? outputsJS,
4343+ dontStrip ? stdenv.hostPlatform.isGhcjs,
5144 version,
5245 revision ? null,
5346 sha256 ? null,
···8073 doHaddockQuickjump ? doHoogle,
8174 doInstallIntermediates ? false,
8275 editedCabalFile ? null,
8383- enableLibraryProfiling ? !outputsJS,
7676+ enableLibraryProfiling ? !stdenv.hostPlatform.isGhcjs,
8477 enableExecutableProfiling ? false,
8578 profilingDetail ? "exported-functions",
8679 # TODO enable shared libs for cross-compiling
···9083 && (ghc.enableShared or false)
9184 && !stdenv.hostPlatform.useAndroidPrebuilt, # TODO: figure out why /build leaks into RPATH
9285 enableDeadCodeElimination ? (!stdenv.hostPlatform.isDarwin), # TODO: use -dead_strip for darwin
9393- # Disabling this for ghcjs prevents this crash: https://gitlab.haskell.org/ghc/ghc/-/issues/23235
8686+ # Disabling this for JS prevents this crash: https://gitlab.haskell.org/ghc/ghc/-/issues/23235
9487 enableStaticLibraries ?
9588 !(stdenv.hostPlatform.isWindows || stdenv.hostPlatform.isWasm || stdenv.hostPlatform.isGhcjs),
9689 enableHsc2hsViaAsm ? stdenv.hostPlatform.isWindows,
···228221 optionalAttrs
229222 ;
230223231231- isGhcjs = ghc.isGhcjs or false;
232224 isHaLVM = ghc.isHaLVM or false;
233225234226 # GHC used for building Setup.hs
235227 #
236228 # Same as our GHC, unless we're cross, in which case it is native GHC with the
237237- # same version, or ghcjs, in which case its the ghc used to build ghcjs.
229229+ # same version.
238230 nativeGhc = buildHaskellPackages.ghc;
239231240232 # the target dir for haddock documentation
···358350 (enableFeature (!dontStrip) "library-stripping")
359351 (enableFeature (!dontStrip) "executable-stripping")
360352 ]
361361- ++ optionals isGhcjs [
362362- "--ghcjs"
363363- ]
364353 ++ optionals isCross (
365354 [
366355 "--configure-option=--host=${stdenv.hostPlatform.config}"
···490479491480 setupCommand = "./Setup";
492481493493- ghcCommand' = if isGhcjs then "ghcjs" else "ghc";
482482+ ghcCommand' = "ghc";
494483 ghcCommand = "${ghc.targetPrefix}${ghcCommand'}";
495484496485 ghcNameWithPrefix = "${ghc.targetPrefix}${ghc.haskellCompilerName}";
···519508520509 intermediatesDir = "share/haskell/${ghc.version}/${pname}-${version}/dist";
521510522522- # On old ghcjs, the jsexe directories are the output but on the js backend they seem to be treated as intermediates
523511 jsexe = rec {
524524- shouldUseNode = isGhcjs;
525512 shouldAdd = stdenv.hostPlatform.isGhcjs && isExecutable;
526513 shouldCopy = shouldAdd && !doInstallIntermediates;
527514 shouldSymlink = shouldAdd && doInstallIntermediates;
···849836 ''
850837 }
851838852852- ${optionalString jsexe.shouldUseNode ''
853853- for exeDir in "${binDir}/"*.jsexe; do
854854- exe="''${exeDir%.jsexe}"
855855- printWords '#!${nodejs}/bin/node' > "$exe"
856856- echo >> "$exe"
857857- cat "$exeDir/all.js" >> "$exe"
858858- chmod +x "$exe"
859859- done
860860- ''}
839839+861840 ${optionalString doCoverage "mkdir -p $out/share && cp -r dist/hpc $out/share"}
862841863842 ${optionalString jsexe.shouldCopy ''
···2323 packages = selectPackages haskellPackages;
24242525 wrapper = ./hoogle-local-wrapper.sh;
2626- isGhcjs = ghc.isGhcjs or false;
2727- opts = lib.optionalString;
2828- haddockExe = if !isGhcjs then "haddock" else "haddock-ghcjs";
2929- ghcDocLibDir = if !isGhcjs then ghc.doc + "/share/doc/ghc*/html/libraries" else ghc + "/doc/lib";
3030- # On GHCJS, use a stripped down version of GHC's prologue.txt
3131- prologue =
3232- if !isGhcjs then
3333- "${ghcDocLibDir}/prologue.txt"
3434- else
3535- writeText "ghcjs-prologue.txt" ''
3636- This index includes documentation for many Haskell modules.
3737- '';
2626+ haddockExe = "haddock";
2727+ ghcDocLibDir = ghc.doc + "/share/doc/ghc*/html/libraries";
2828+ prologue = "${ghcDocLibDir}/prologue.txt";
38293930 docPackages =
4031 lib.closePropagation
···8475 echo importing builtin packages
8576 for docdir in ${ghcDocLibDir}"/"*; do
8677 name="$(basename $docdir)"
8787- ${opts isGhcjs ''docdir="$docdir/html"''}
8878 if [[ -d $docdir ]]; then
8979 ln -sfn $docdir $out/share/doc/hoogle/$name
9080 fi
-30
pkgs/development/haskell-modules/lib/compose.nix
···572572 # nix-shell evaluation, return a nix-shell optimized environment.
573573 shellAware = p: if lib.inNixShell then p.env else p;
574574575575- ghcInfo = ghc: rec {
576576- isCross = (ghc.cross or null) != null;
577577- isGhcjs = ghc.isGhcjs or false;
578578- nativeGhc = if isCross || isGhcjs then ghc.bootPkgs.ghc else ghc;
579579- };
580580-581581- ### mkDerivation helpers
582582- # These allow external users of a haskell package to extract
583583- # information about how it is built in the same way that the
584584- # generic haskell builder does, by reusing the same functions.
585585- # Each function here has the same interface as mkDerivation and thus
586586- # can be called for a given package simply by overriding the
587587- # mkDerivation argument it used. See getHaskellBuildInputs above for
588588- # an example of this.
589589-590590- # Some information about which phases should be run.
591591- controlPhases =
592592- ghc:
593593- let
594594- inherit (ghcInfo ghc) isCross;
595595- in
596596- {
597597- doCheck ? !isCross,
598598- doBenchmark ? false,
599599- ...
600600- }:
601601- {
602602- inherit doCheck doBenchmark;
603603- };
604604-605575 # Utility to convert a directory full of `cabal2nix`-generated files into a
606576 # package override set
607577 #
-14
pkgs/development/haskell-modules/lib/default.nix
···333333 # nix-shell evaluation, return a nix-shell optimized environment.
334334 shellAware = compose.shellAware;
335335336336- ghcInfo = compose.ghcInfo;
337337-338338- ### mkDerivation helpers
339339- # These allow external users of a haskell package to extract
340340- # information about how it is built in the same way that the
341341- # generic haskell builder does, by reusing the same functions.
342342- # Each function here has the same interface as mkDerivation and thus
343343- # can be called for a given package simply by overriding the
344344- # mkDerivation argument it used. See getHaskellBuildInputs above for
345345- # an example of this.
346346-347347- # Some information about which phases should be run.
348348- controlPhases = compose.controlPhases;
349349-350336 # Utility to convert a directory full of `cabal2nix`-generated files into a
351337 # package override set
352338 #
···1313 installDocumentation ? true,
1414 hoogleWithPackages,
1515 postBuild ? "",
1616- ghcLibdir ? null, # only used by ghcjs, when resolving plugins
1716}:
18171918# This argument is a function which selects a list of Haskell packages from any
···51505251 packages = selectPackages haskellPackages ++ [ hoogleWithPackages' ];
53525454- isGhcjs = ghc.isGhcjs or false;
5553 isHaLVM = ghc.isHaLVM or false;
5656- ghcCommand' = if isGhcjs then "ghcjs" else "ghc";
5454+ ghcCommand' = "ghc";
5755 ghcCommand = "${ghc.targetPrefix}${ghcCommand'}";
5856 ghcCommandCaps = lib.toUpper ghcCommand';
5957 libDir =
···7775 );
7876in
79778080-assert ghcLibdir != null -> (ghc.isGhcjs or false);
8181-8278if paths == [ ] && !useLLVM then
8379 ghc
8480else
···10197 --set "NIX_${ghcCommandCaps}PKG" "$out/bin/${ghcCommand}-pkg" \
10298 --set "NIX_${ghcCommandCaps}_DOCDIR" "${docDir}" \
10399 --set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}" \
104104- ${
105105- lib.optionalString (ghc.isGhcjs or false) ''--set NODE_PATH "${ghc.socket-io}/lib/node_modules"''
106106- } \
107100 ${lib.optionalString useLLVM ''--prefix "PATH" ":" "${llvm}"''}
108101 fi
109102 done
···136129 fi
137130138131 ''
139139- + (lib.optionalString (stdenv.targetPlatform.isDarwin && !isGhcjs && !stdenv.targetPlatform.isiOS)
140140- ''
141141- # Work around a linker limit in macOS Sierra (see generic-builder.nix):
142142- local packageConfDir="${packageCfgDir}";
143143- local dynamicLinksDir="$out/lib/links";
144144- mkdir -p $dynamicLinksDir
145145- # Clean up the old links that may have been (transitively) included by
146146- # symlinkJoin:
147147- rm -f $dynamicLinksDir/*
132132+ + (lib.optionalString (stdenv.targetPlatform.isDarwin && !stdenv.targetPlatform.isiOS) ''
133133+ # Work around a linker limit in macOS Sierra (see generic-builder.nix):
134134+ local packageConfDir="${packageCfgDir}";
135135+ local dynamicLinksDir="$out/lib/links";
136136+ mkdir -p $dynamicLinksDir
137137+ # Clean up the old links that may have been (transitively) included by
138138+ # symlinkJoin:
139139+ rm -f $dynamicLinksDir/*
148140149149- dynamicLibraryDirs=()
141141+ dynamicLibraryDirs=()
150142151151- for pkg in $($out/bin/ghc-pkg list --simple-output); do
152152- dynamicLibraryDirs+=($($out/bin/ghc-pkg --simple-output field "$pkg" dynamic-library-dirs))
153153- done
143143+ for pkg in $($out/bin/ghc-pkg list --simple-output); do
144144+ dynamicLibraryDirs+=($($out/bin/ghc-pkg --simple-output field "$pkg" dynamic-library-dirs))
145145+ done
154146155155- for dynamicLibraryDir in $(echo "''${dynamicLibraryDirs[@]}" | tr ' ' '\n' | sort -u); do
156156- echo "Linking $dynamicLibraryDir/*.dylib from $dynamicLinksDir"
157157- find "$dynamicLibraryDir" -name '*.dylib' -exec ln -s {} "$dynamicLinksDir" \;
158158- done
147147+ for dynamicLibraryDir in $(echo "''${dynamicLibraryDirs[@]}" | tr ' ' '\n' | sort -u); do
148148+ echo "Linking $dynamicLibraryDir/*.dylib from $dynamicLinksDir"
149149+ find "$dynamicLibraryDir" -name '*.dylib' -exec ln -s {} "$dynamicLinksDir" \;
150150+ done
159151160160- for f in $packageConfDir/*.conf; do
161161- # Initially, $f is a symlink to a read-only file in one of the inputs
162162- # (as a result of this symlinkJoin derivation).
163163- # Replace it with a copy whose dynamic-library-dirs points to
164164- # $dynamicLinksDir
165165- cp $f $f-tmp
166166- rm $f
167167- sed "N;s,dynamic-library-dirs:\s*.*\n,dynamic-library-dirs: $dynamicLinksDir\n," $f-tmp > $f
168168- rm $f-tmp
169169- done
170170- ''
171171- )
152152+ for f in $packageConfDir/*.conf; do
153153+ # Initially, $f is a symlink to a read-only file in one of the inputs
154154+ # (as a result of this symlinkJoin derivation).
155155+ # Replace it with a copy whose dynamic-library-dirs points to
156156+ # $dynamicLinksDir
157157+ cp $f $f-tmp
158158+ rm $f
159159+ sed "N;s,dynamic-library-dirs:\s*.*\n,dynamic-library-dirs: $dynamicLinksDir\n," $f-tmp > $f
160160+ rm $f-tmp
161161+ done
162162+ '')
172163 + ''
173164 ${lib.optionalString hasLibraries ''
174165 # GHC 8.10 changes.
···182173183174 $out/bin/${ghcCommand}-pkg recache
184175 ''}
185185- ${
186186- # ghcjs will read the ghc_libdir file when resolving plugins.
187187- lib.optionalString (isGhcjs && ghcLibdir != null) ''
188188- mkdir -p "${libDir}"
189189- rm -f "${libDir}/ghc_libdir"
190190- printf '%s' '${ghcLibdir}' > "${libDir}/ghc_libdir"
191191- ''
192192- }
193176 $out/bin/${ghcCommand}-pkg check
194177 ''
195178 + postBuild;
···231231 jobs = recursiveUpdateMany [
232232 (mapTestOn {
233233 haskellPackages = packagePlatforms pkgs.haskellPackages;
234234- haskell.compiler =
235235- packagePlatforms pkgs.haskell.compiler
236236- // (lib.genAttrs
237237- [
238238- "ghcjs"
239239- "ghcjs810"
240240- ]
241241- (ghcjsName: {
242242- # We can't build ghcjs itself, since it exceeds 3GB (Hydra's output limit) due
243243- # to the size of its bundled libs. We can however save users a bit of compile
244244- # time by building the bootstrap ghcjs on Hydra. For this reason, we overwrite
245245- # the ghcjs attributes in haskell.compiler with a reference to the bootstrap
246246- # ghcjs attribute in their bootstrap package set (exposed via passthru) which
247247- # would otherwise be ignored by Hydra.
248248- bootGhcjs = (packagePlatforms pkgs.haskell.compiler.${ghcjsName}.passthru).bootGhcjs;
249249- })
250250- );
251251-234234+ haskell.compiler = packagePlatforms pkgs.haskell.compiler;
252235 tests.haskell = packagePlatforms pkgs.tests.haskell;
253236254237 nixosTests = {
···406389 # remove musl ghc865Binary since it is known to be broken and
407390 # causes an evaluation error on darwin.
408391 ghc865Binary = { };
409409-410410- ghcjs = { };
411411- ghcjs810 = { };
412392 };
413393414394 # Get some cache going for MUSL-enabled GHC.