Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ghc: 8.10.4 -> 8.10.6 #126195

Merged
merged 2 commits into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# build-tools
, bootPkgs
, autoconf, automake, coreutils, fetchpatch, fetchurl, perl, python3, m4, sphinx
, autoconf, automake, coreutils, fetchpatch, fetchurl, perl, python3, m4, sphinx, xattr
, bash

, libiconv ? null, ncurses
Expand Down Expand Up @@ -135,12 +135,12 @@ let

in
stdenv.mkDerivation (rec {
version = "8.10.4";
version = "8.10.6";
name = "${targetPrefix}ghc-${version}";

src = fetchurl {
url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz";
sha256 = "03li4k10hxgyxcdyyz2092wx09spr1599hi0sxbh4m889qdqgbsj";
sha256 = "43afba72a533408b42c1492bd047b5e37e5f7204e41a5cedd3182cc841610ce9";
};

enableParallelBuilding = true;
Expand All @@ -155,9 +155,6 @@ stdenv.mkDerivation (rec {
# upstream patch. Don't forget to check backport status of the upstream patch
# when adding new GHC releases in nixpkgs.
./respect-ar-path.patch
# Fix documentation configuration which causes a syntax error with sphinx 4.*
# See https://gitlab.haskell.org/ghc/ghc/-/issues/19962, remove at 8.10.6.
./sphinx-4-configuration.patch
] ++ lib.optionals stdenv.isDarwin [
# Make Block.h compile with c++ compilers. Remove with the next release
(fetchpatch {
Expand Down Expand Up @@ -192,6 +189,9 @@ stdenv.mkDerivation (rec {
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
'' + lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof"

# GHC tries the host xattr /usr/bin/xattr by default which fails since it expects python to be 2.7
export XATTR=${lib.getBin xattr}/bin/xattr
'' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
'' + lib.optionalString targetPlatform.isMusl ''
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, supportedGhcVersions ? [ "884" "8104" ], stdenv, haskellPackages
{ lib, supportedGhcVersions ? [ "884" "8106" ], stdenv, haskellPackages
, haskell }:
#
# The recommended way to override this package is
Expand Down
73 changes: 73 additions & 0 deletions pkgs/os-specific/darwin/xattr/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{ lib
, stdenv
, fetchzip
, buildPythonPackage
, python
, ed
, unifdef
}:

buildPythonPackage rec {
pname = "xattr";
version = "61.60.1";

src = fetchzip rec {
url = "https://opensource.apple.com/tarballs/python_modules/python_modules-${version}.tar.gz";
sha256 = "19kydl7w4vpdi7zmfd5z9vjkq24jfk2cv4j0pppw69j06czhdwwi";
};

sourceRoot = "${src.name}/Modules/xattr-0.6.4";
format = "other";

nativeBuildInputs = [
ed
unifdef
];

makeFlags = [
"OBJROOT=$(PWD)"
"DSTROOT=${placeholder "out"}"
"OSL=${placeholder "doc"}/share/xattr/OpenSourceLicenses"
"OSV=${placeholder "doc"}/share/xattr/OpenSourceVersions"
];

# need to use `out` instead of `bin` since buildPythonPackage ignores the latter
outputs = [ "out" "doc" "python" ];

# We need to patch a reference to gnutar in an included Makefile
postUnpack = ''
chmod u+w $sourceRoot/..
'';

postPatch = ''
substituteInPlace ../Makefile.inc --replace gnutar tar
substituteInPlace Makefile --replace "/usr" ""
'';

preInstall = ''
# prevent setup.py from trying to download setuptools
sed -i xattr-*/setup.py -e '/ez_setup/d'

# create our custom target dirs we patch in
mkdir -p "$doc/share/xattr/"OpenSource{Licenses,Versions}
mkdir -p "$python/lib/${python.libPrefix}"
'';

# move python package to its own output to reduce clutter
postInstall = ''
mv "$out/lib/python" "$python/${python.sitePackages}"
rmdir "$out/lib"
'';

makeWrapperArgs = [
"--prefix" "PYTHONPATH" ":" "${placeholder "python"}/${python.sitePackages}"
];

meta = with lib; {
description = "Display and manipulate extended attributes";
license = [ licenses.psfl licenses.mit ]; # see $doc/share/xattr/OpenSourceLicenses
maintainers = [ maintainers.sternenseemann ];
homepage = "https://opensource.apple.com/source/python_modules/";
platforms = lib.platforms.darwin;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
platforms = lib.platforms.darwin;
platforms = platforms.darwin;

};
}
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11411,7 +11411,7 @@ with pkgs;

# Please update doc/languages-frameworks/haskell.section.md, “Our
# current default compiler is”, if you bump this:
haskellPackages = dontRecurseIntoAttrs haskell.packages.ghc8104;
haskellPackages = dontRecurseIntoAttrs haskell.packages.ghc8106;

inherit (haskellPackages) ghc;

Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/darwin-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ impure-cmds // appleSourcePackages // chooseLibs // {

usr-include = callPackage ../os-specific/darwin/usr-include { };

xattr = pkgs.python3Packages.callPackage ../os-specific/darwin/xattr { };

inherit (pkgs.callPackages ../os-specific/darwin/xcode { })
xcode_8_1 xcode_8_2
xcode_9_1 xcode_9_2 xcode_9_4 xcode_9_4_1
Expand Down
12 changes: 8 additions & 4 deletions pkgs/top-level/haskell-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,18 @@ in {
buildLlvmPackages = buildPackages.llvmPackages_7;
llvmPackages = pkgs.llvmPackages_7;
};
ghc8104 = callPackage ../development/compilers/ghc/8.10.4.nix {
ghc8106 = callPackage ../development/compilers/ghc/8.10.6.nix {
# aarch64 ghc865Binary gets SEGVs due to haskell#15449 or similar
# Musl bindists do not exist for ghc 8.6.5, so we use 8.10.* for them
bootPkgs = if stdenv.isAarch64 || stdenv.isAarch32 || stdenv.targetPlatform.isMusl then
packages.ghc8102BinaryMinimal
else
packages.ghc865Binary;
inherit (buildPackages.python3Packages) sphinx;
# Need to use apple's patched xattr until
# https://github.com/xattr/xattr/issues/44 and
# https://github.com/xattr/xattr/issues/55 are solved.
inherit (buildPackages.darwin) xattr;
buildLlvmPackages = buildPackages.llvmPackages_9;
llvmPackages = pkgs.llvmPackages_9;
};
Expand Down Expand Up @@ -147,9 +151,9 @@ in {
ghc = bh.compiler.ghc884;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.8.x.nix { };
};
ghc8104 = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc8104;
ghc = bh.compiler.ghc8104;
ghc8106 = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc8106;
ghc = bh.compiler.ghc8106;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
};
ghc901 = callPackage ../development/haskell-modules {
Expand Down
6 changes: 3 additions & 3 deletions pkgs/top-level/release-haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ let
# list of all compilers to test specific packages on
all = with compilerNames; [
ghc884
ghc8104
ghc8106
ghc901
];

Expand Down Expand Up @@ -300,12 +300,12 @@ let
# package sets (like Cabal, jailbreak-cabal) are
# working as expected.
cabal-install = all;
Cabal_3_6_0_0 = with compilerNames; [ ghc884 ghc8104 ];
Cabal_3_6_0_0 = with compilerNames; [ ghc884 ghc8106 ];
cabal2nix-unstable = all;
funcmp = all;
# Doesn't currently work on ghc-9.0:
# https://github.com/haskell/haskell-language-server/issues/297
haskell-language-server = with compilerNames; [ ghc884 ghc8104 ];
haskell-language-server = with compilerNames; [ ghc884 ghc8106 ];
hoogle = all;
hsdns = all;
jailbreak-cabal = all;
Expand Down