Merge pull request #147400 from sternenseemann/top-level-ghc-more-intuitive-cross
ghc: make sure top level exposed GHC is always host->target
This commit is contained in:
commit
303999a073
@ -24,8 +24,29 @@
|
|||||||
</section>
|
</section>
|
||||||
<section xml:id="sec-release-22.05-incompatibilities">
|
<section xml:id="sec-release-22.05-incompatibilities">
|
||||||
<title>Backward Incompatibilities</title>
|
<title>Backward Incompatibilities</title>
|
||||||
<para>
|
<itemizedlist spacing="compact">
|
||||||
</para>
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<literal>pkgs.ghc</literal> now refers to
|
||||||
|
<literal>pkgs.targetPackages.haskellPackages.ghc</literal>.
|
||||||
|
This <emphasis>only</emphasis> makes a difference if you are
|
||||||
|
cross-compiling and will ensure that
|
||||||
|
<literal>pkgs.ghc</literal> always runs on the host platform
|
||||||
|
and compiles for the target platform (similar to
|
||||||
|
<literal>pkgs.gcc</literal> for example).
|
||||||
|
<literal>haskellPackages.ghc</literal> still behaves as
|
||||||
|
before, running on the build platform and compiling for the
|
||||||
|
host platform (similar to <literal>stdenv.cc</literal>). This
|
||||||
|
means you don’t have to adjust your derivations if you use
|
||||||
|
<literal>haskellPackages.callPackage</literal>, but when using
|
||||||
|
<literal>pkgs.callPackage</literal> and taking
|
||||||
|
<literal>ghc</literal> as an input, you should now use
|
||||||
|
<literal>buildPackages.ghc</literal> instead to ensure cross
|
||||||
|
compilation keeps working (or switch to
|
||||||
|
<literal>haskellPackages.callPackage</literal>).
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
</section>
|
</section>
|
||||||
<section xml:id="sec-release-22.05-notable-changes">
|
<section xml:id="sec-release-22.05-notable-changes">
|
||||||
<title>Other Notable Changes</title>
|
<title>Other Notable Changes</title>
|
||||||
|
@ -10,4 +10,16 @@ In addition to numerous new and upgraded packages, this release has the followin
|
|||||||
|
|
||||||
## Backward Incompatibilities {#sec-release-22.05-incompatibilities}
|
## Backward Incompatibilities {#sec-release-22.05-incompatibilities}
|
||||||
|
|
||||||
|
* `pkgs.ghc` now refers to `pkgs.targetPackages.haskellPackages.ghc`.
|
||||||
|
This *only* makes a difference if you are cross-compiling and will
|
||||||
|
ensure that `pkgs.ghc` always runs on the host platform and compiles
|
||||||
|
for the target platform (similar to `pkgs.gcc` for example).
|
||||||
|
`haskellPackages.ghc` still behaves as before, running on the build
|
||||||
|
platform and compiling for the host platform (similar to `stdenv.cc`).
|
||||||
|
This means you don't have to adjust your derivations if you use
|
||||||
|
`haskellPackages.callPackage`, but when using `pkgs.callPackage` and
|
||||||
|
taking `ghc` as an input, you should now use `buildPackages.ghc`
|
||||||
|
instead to ensure cross compilation keeps working (or switch to
|
||||||
|
`haskellPackages.callPackage`).
|
||||||
|
|
||||||
## Other Notable Changes {#sec-release-22.05-notable-changes}
|
## Other Notable Changes {#sec-release-22.05-notable-changes}
|
||||||
|
@ -12070,7 +12070,15 @@ with pkgs;
|
|||||||
# current default compiler is”, if you bump this:
|
# current default compiler is”, if you bump this:
|
||||||
haskellPackages = dontRecurseIntoAttrs haskell.packages.ghc8107;
|
haskellPackages = dontRecurseIntoAttrs haskell.packages.ghc8107;
|
||||||
|
|
||||||
inherit (haskellPackages) ghc;
|
# haskellPackages.ghc is build->host (it exposes the compiler used to build the
|
||||||
|
# set, similarly to stdenv.cc), but pkgs.ghc should be host->target to be more
|
||||||
|
# consistent with the gcc, gnat, clang etc. derivations
|
||||||
|
#
|
||||||
|
# We use targetPackages.haskellPackages.ghc if available since this also has
|
||||||
|
# the withPackages wrapper available. In the final cross-compiled package set
|
||||||
|
# however, targetPackages won't be populated, so we need to fall back to the
|
||||||
|
# plain, cross-compiled compiler (which is only theoretical at the moment).
|
||||||
|
ghc = targetPackages.haskellPackages.ghc or haskell.compiler.ghc8107;
|
||||||
|
|
||||||
cabal-install = haskell.lib.compose.justStaticExecutables haskellPackages.cabal-install;
|
cabal-install = haskell.lib.compose.justStaticExecutables haskellPackages.cabal-install;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user