From fd7a6ea0aff44e90b999958c58cc3acc8579ae72 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 20 Jun 2018 17:57:35 -0400 Subject: [PATCH] =?UTF-8?q?haskell:=20make=20generic=20builder=20follow=20?= =?UTF-8?q?compiler=E2=80=99s=20shared=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit enableShared in generic-builder.nix should default to what the GHC compiler was compiled with. Add a passthru to all of the GHC compilers to hold the value of enableShared. If enableShared is not set in the GHC we just use false as the default value for enableSharedLibraries. Note: I may have missed some compilers. Only GHC & GHCJS are covered by this commit but this shouldn’t break evaluation of anything else. --- pkgs/development/compilers/ghc/7.10.3-binary.nix | 5 ++++- pkgs/development/compilers/ghc/7.10.3.nix | 1 + pkgs/development/compilers/ghc/8.0.2.nix | 1 + pkgs/development/compilers/ghc/8.2.1-binary.nix | 5 ++++- pkgs/development/compilers/ghc/8.2.2.nix | 1 + pkgs/development/compilers/ghc/8.4.3.nix | 1 + pkgs/development/compilers/ghc/head.nix | 1 + pkgs/development/compilers/ghcjs-ng/default.nix | 3 ++- pkgs/development/compilers/ghcjs/base.nix | 2 ++ pkgs/development/haskell-modules/generic-builder.nix | 2 +- 10 files changed, 18 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/ghc/7.10.3-binary.nix b/pkgs/development/compilers/ghc/7.10.3-binary.nix index 48e2ca0a585..53693ff5052 100644 --- a/pkgs/development/compilers/ghc/7.10.3-binary.nix +++ b/pkgs/development/compilers/ghc/7.10.3-binary.nix @@ -153,7 +153,10 @@ stdenv.mkDerivation rec { [ $(./main) == "yes" ] ''; - passthru = { targetPrefix = ""; }; + passthru = { + targetPrefix = ""; + enableShared = true; + }; meta.license = stdenv.lib.licenses.bsd3; meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin" "armv7l-linux"]; diff --git a/pkgs/development/compilers/ghc/7.10.3.nix b/pkgs/development/compilers/ghc/7.10.3.nix index 3dd320e0257..2a906d918aa 100644 --- a/pkgs/development/compilers/ghc/7.10.3.nix +++ b/pkgs/development/compilers/ghc/7.10.3.nix @@ -177,6 +177,7 @@ stdenv.mkDerivation rec { inherit bootPkgs targetPrefix; inherit llvmPackages; + inherit enableShared; # Our Cabal compiler name haskellCompilerName = "ghc-7.10.3"; diff --git a/pkgs/development/compilers/ghc/8.0.2.nix b/pkgs/development/compilers/ghc/8.0.2.nix index 53c5a218cb1..8062e93df54 100644 --- a/pkgs/development/compilers/ghc/8.0.2.nix +++ b/pkgs/development/compilers/ghc/8.0.2.nix @@ -183,6 +183,7 @@ stdenv.mkDerivation rec { inherit bootPkgs targetPrefix; inherit llvmPackages; + inherit enableShared; # Our Cabal compiler name haskellCompilerName = "ghc-8.0.2"; diff --git a/pkgs/development/compilers/ghc/8.2.1-binary.nix b/pkgs/development/compilers/ghc/8.2.1-binary.nix index c88d2a8685a..9bd7dfcb9fc 100644 --- a/pkgs/development/compilers/ghc/8.2.1-binary.nix +++ b/pkgs/development/compilers/ghc/8.2.1-binary.nix @@ -155,7 +155,10 @@ stdenv.mkDerivation rec { [ $(./main) == "yes" ] ''; - passthru = { targetPrefix = ""; }; + passthru = { + targetPrefix = ""; + enableShared = true; + }; meta.license = stdenv.lib.licenses.bsd3; # AArch64 should work in theory but eventually some builds start segfaulting diff --git a/pkgs/development/compilers/ghc/8.2.2.nix b/pkgs/development/compilers/ghc/8.2.2.nix index 4e9eff06f26..0aa573ed6d1 100644 --- a/pkgs/development/compilers/ghc/8.2.2.nix +++ b/pkgs/development/compilers/ghc/8.2.2.nix @@ -199,6 +199,7 @@ stdenv.mkDerivation rec { inherit bootPkgs targetPrefix; inherit llvmPackages; + inherit enableShared; # Our Cabal compiler name haskellCompilerName = "ghc-8.2.2"; diff --git a/pkgs/development/compilers/ghc/8.4.3.nix b/pkgs/development/compilers/ghc/8.4.3.nix index c57058a6352..864e93756e8 100644 --- a/pkgs/development/compilers/ghc/8.4.3.nix +++ b/pkgs/development/compilers/ghc/8.4.3.nix @@ -193,6 +193,7 @@ stdenv.mkDerivation rec { inherit bootPkgs targetPrefix; inherit llvmPackages; + inherit enableShared; # Our Cabal compiler name haskellCompilerName = "ghc-8.4.3"; diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index c128891ec38..8ccd72ef55a 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -191,6 +191,7 @@ stdenv.mkDerivation rec { inherit bootPkgs targetPrefix; inherit llvmPackages; + inherit enableShared; # Our Cabal compiler name haskellCompilerName = "ghc-8.5"; diff --git a/pkgs/development/compilers/ghcjs-ng/default.nix b/pkgs/development/compilers/ghcjs-ng/default.nix index affed7e2d07..65b43f712ae 100644 --- a/pkgs/development/compilers/ghcjs-ng/default.nix +++ b/pkgs/development/compilers/ghcjs-ng/default.nix @@ -42,6 +42,8 @@ let inherit (bootGhcjs) version; isGhcjs = true; + enableShared = true; + socket-io = nodePackages."socket.io"; # Relics of the old GHCJS build system @@ -96,4 +98,3 @@ in stdenv.mkDerivation { meta.platforms = passthru.bootPkgs.ghc.meta.platforms; } - diff --git a/pkgs/development/compilers/ghcjs/base.nix b/pkgs/development/compilers/ghcjs/base.nix index 98eb58e6aae..f09a577110b 100644 --- a/pkgs/development/compilers/ghcjs/base.nix +++ b/pkgs/development/compilers/ghcjs/base.nix @@ -179,6 +179,8 @@ in mkDerivation (rec { # let us assume ghcjs is never actually cross compiled targetPrefix = ""; + enableShared = true; + inherit stage1Packages; mkStage2 = stage2 { inherit ghcjsBoot; diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index 52128d3fc5d..3dd023f3430 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -30,7 +30,7 @@ in , profilingDetail ? "all-functions" # TODO enable shared libs for cross-compiling , enableSharedExecutables ? false -, enableSharedLibraries ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version) +, enableSharedLibraries ? (ghc.enableShared or false) , enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin , enableStaticLibraries ? !hostPlatform.isWindows , enableHsc2hsViaAsm ? hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4"