on iko/ghcjs-patch-master help sign in
Fix cross compilation issues for musl and aarch64 (#322)
775c8cfHamish Mackenzie
builder/comp-builder.nix+12−3
@@ -24,7 +24,7 @@
24, dontStrip ? component.dontStrip
24, dontStrip ? component.dontStrip
25
25
26, enableStatic ? component.enableStatic
26, enableStatic ? component.enableStatic
27−, enableShared ? component.enableShared && !stdenv.hostPlatform.isWindows && !stdenv.hostPlatform.useiOSPrebuilt
27+, enableShared ? component.enableShared && !haskellLib.isCrossHost
28, enableDeadCodeElimination ? component.enableDeadCodeElimination
28, enableDeadCodeElimination ? component.enableDeadCodeElimination
29
29
30# Options for Haddock generation
30# Options for Haddock generation
@@ -95,11 +95,20 @@ let
95 (enableFeature enableExecutableProfiling "executable-profiling")
95 (enableFeature enableExecutableProfiling "executable-profiling")
96 (enableFeature enableStatic "static")
96 (enableFeature enableStatic "static")
97 (enableFeature enableShared "shared")
97 (enableFeature enableShared "shared")
98+ ] ++ lib.optionals (stdenv.hostPlatform.isMusl && (haskellLib.isExecutableType componentId)) [
99+ # These flags will make sure the resulting executable is statically linked.
100+ # If it uses other libraries it may be necessary for to add more
101+ # `--ghc-option=-optl=-L` options to the `configurationFlags` of the
102+ # component.
103+ "--disable-executable-dynamic"
104+ "--ghc-option=-optl=-pthread"
105+ "--ghc-option=-optl=-static"
106+ "--ghc-option=-optl=-L${gmp.override { withStatic = true; }}/lib"
98 ] ++ lib.optional enableSeparateDataOutput "--datadir=$data/share/${ghc.name}"
107 ] ++ lib.optional enableSeparateDataOutput "--datadir=$data/share/${ghc.name}"
99 ++ lib.optional doHaddock' "--docdir=${docdir "$doc"}"
108 ++ lib.optional doHaddock' "--docdir=${docdir "$doc"}"
100 ++ lib.optional (enableLibraryProfiling || enableExecutableProfiling) "--profiling-detail=${profilingDetail}"
109 ++ lib.optional (enableLibraryProfiling || enableExecutableProfiling) "--profiling-detail=${profilingDetail}"
101 ++ lib.optional stdenv.hostPlatform.isLinux (enableFeature enableDeadCodeElimination "split-sections")
110 ++ lib.optional stdenv.hostPlatform.isLinux (enableFeature enableDeadCodeElimination "split-sections")
102− ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) (
111+ ++ lib.optionals haskellLib.isCrossHost (
103 map (arg: "--hsc2hs-option=" + arg) (["--cross-compile"] ++ lib.optionals (stdenv.hostPlatform.isWindows) ["--via-asm"])
112 map (arg: "--hsc2hs-option=" + arg) (["--cross-compile"] ++ lib.optionals (stdenv.hostPlatform.isWindows) ["--via-asm"])
104 ++ lib.optional (package.buildType == "Configure") "--configure-option=--host=${stdenv.hostPlatform.config}" )
113 ++ lib.optional (package.buildType == "Configure") "--configure-option=--host=${stdenv.hostPlatform.config}" )
105 ++ component.configureFlags
114 ++ component.configureFlags
@@ -131,7 +140,7 @@ let
131
140
132 doHaddock' = doHaddock
141 doHaddock' = doHaddock
133 && (haskellLib.isLibrary componentId)
142 && (haskellLib.isLibrary componentId)
134− && stdenv.hostPlatform == stdenv.buildPlatform;
143+ && !haskellLib.isCrossHost;
135
144
136 exeExt = lib.optionalString stdenv.hostPlatform.isWindows ".exe";
145 exeExt = lib.optionalString stdenv.hostPlatform.isWindows ".exe";
137 exeName = componentId.cname + exeExt;
146 exeName = componentId.cname + exeExt;
builder/default.nix+7−3
@@ -39,10 +39,14 @@ let
39
39
40
40
41 hoogleLocal = let
41 hoogleLocal = let
42+ # Use the latest default nixpkgs hoogle.nix, as the 19.03 one does not work with cross compilers
42− nixpkgsHoogleLocal = import (pkgs.path + /pkgs/development/haskell-modules/hoogle.nix);
43+ nixpkgsHoogleLocal = import ((import ../nixpkgs {}).path + /pkgs/development/haskell-modules/hoogle.nix);
43− in { packages ? [], hoogle ? pkgs.haskell-nix.haskellPackages.hoogle.components.exes.hoogle }:
44+ in { packages ? [], hoogle ? pkgs.buildPackages.haskell-nix.haskellPackages.hoogle.components.exes.hoogle }:
44 haskellLib.weakCallPackage pkgs nixpkgsHoogleLocal {
45 haskellLib.weakCallPackage pkgs nixpkgsHoogleLocal {
45− ghc = pkgs.haskell-nix.ghc;
46+ # For musl we can use haddock from the buildGHC
47+ ghc = if stdenv.hostPlatform.isLinux && stdenv.targetPlatform.isMusl
48+ then ghc.buildGHC
49+ else ghc;
46 inherit packages hoogle;
50 inherit packages hoogle;
47 };
51 };
48
52
builder/ghc-for-component-wrapper.nix+9−4
@@ -15,14 +15,19 @@
15}:
15}:
16
16
17let
17let
18− inherit (configFiles) ghcCommand ghcCommandCaps packageCfgDir;
18+ inherit (configFiles) targetPrefix ghcCommand ghcCommandCaps packageCfgDir;
19 libDir = "$out/${configFiles.libDir}";
19 libDir = "$out/${configFiles.libDir}";
20 docDir = "$out/share/doc/ghc/html";
20 docDir = "$out/share/doc/ghc/html";
21+ # For musl we can use haddock from the buildGHC
22+ haddock = if stdenv.hostPlatform.isLinux && stdenv.targetPlatform.isMusl
23+ then ghc.buildGHC
24+ else ghc;
21
25
22in runCommand "${componentName}-${ghc.name}-env" {
26in runCommand "${componentName}-${ghc.name}-env" {
23 preferLocalBuild = true;
27 preferLocalBuild = true;
24 passthru = {
28 passthru = {
25 inherit (ghc) version meta;
29 inherit (ghc) version meta;
30+ inherit targetPrefix;
26 baseGhc = ghc;
31 baseGhc = ghc;
27 };
32 };
28} (
33} (
@@ -62,7 +67,7 @@ in runCommand "${componentName}-${ghc.name}-env" {
62 fi
67 fi
63 done
68 done
64
69
65− for prg in runghc runhaskell; do
70+ for prg in "${targetPrefix}runghc" "${targetPrefix}runhaskell"; do
66 if [[ -x "${ghc}/bin/$prg" ]]; then
71 if [[ -x "${ghc}/bin/$prg" ]]; then
67 rm -f $out/bin/$prg
72 rm -f $out/bin/$prg
68 makeWrapper ${ghc}/bin/$prg $out/bin/$prg \
73 makeWrapper ${ghc}/bin/$prg $out/bin/$prg \
@@ -75,9 +80,9 @@ in runCommand "${componentName}-${ghc.name}-env" {
75 done
80 done
76
81
77 # Wrap haddock, if the base GHC provides it.
82 # Wrap haddock, if the base GHC provides it.
78− if [[ -x "${ghc}/bin/haddock" ]]; then
83+ if [[ -x "${haddock}/bin/haddock" ]]; then
79 rm -f $out/bin/haddock
84 rm -f $out/bin/haddock
80− makeWrapper ${ghc}/bin/haddock $out/bin/haddock \
85+ makeWrapper ${haddock}/bin/haddock $out/bin/haddock \
81 --add-flags '"-B$NIX_${ghcCommandCaps}_LIBDIR"' \
86 --add-flags '"-B$NIX_${ghcCommandCaps}_LIBDIR"' \
82 --set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}"
87 --set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}"
83 fi
88 fi
builder/make-config-files.nix+2−1
@@ -66,7 +66,8 @@ let
66in { identifier, component, fullName, flags ? {} }:
66in { identifier, component, fullName, flags ? {} }:
67 # Filters out only library packages that for this GHC target
67 # Filters out only library packages that for this GHC target
68 # TODO investigate why this is needed
68 # TODO investigate why this is needed
69+ # TODO find out why p ? configFiles helps (for instance for `R1909.aarch64-unknown-linux-gnu.tests.cabal-22.run.x86_64-linux`)
69− let libDeps = lib.filter (p: p.configFiles.targetPrefix == ghc.targetPrefix)
70+ let libDeps = lib.filter (p: (p ? configFiles) && p.configFiles.targetPrefix == ghc.targetPrefix)
70 (map getLibComponent component.depends);
71 (map getLibComponent component.depends);
71 cfgFiles =
72 cfgFiles =
72 let xs = map
73 let xs = map
builder/shell-for.nix+4−2
@@ -12,6 +12,8 @@
12, ... } @ args:
12, ... } @ args:
13
13
14let
14let
15+ # TODO find out why hoogle index creation can be made to work for cross compilers
16+ withHoogle' = withHoogle && !haskellLib.isCrossHost;
15 selected = packages hsPkgs;
17 selected = packages hsPkgs;
16 additionalSelected = additional hsPkgs;
18 additionalSelected = additional hsPkgs;
17 selectedConfigs = map (p: p.components.all.config) selected;
19 selectedConfigs = map (p: p.components.all.config) selected;
@@ -53,7 +55,7 @@ let
53 ghcEnv = ghcForComponent {
55 ghcEnv = ghcForComponent {
54 inherit configFiles;
56 inherit configFiles;
55 componentName = name;
57 componentName = name;
56− postInstall = lib.optionalString withHoogle ''
58+ postInstall = lib.optionalString withHoogle' ''
57 ln -s ${hoogleIndex}/bin/hoogle $out/bin
59 ln -s ${hoogleIndex}/bin/hoogle $out/bin
58 '';
60 '';
59 };
61 };
@@ -79,7 +81,7 @@ in
79
81
80 buildInputs = systemInputs
82 buildInputs = systemInputs
81 ++ mkDrvArgs.buildInputs or []
83 ++ mkDrvArgs.buildInputs or []
82− ++ lib.optional withHoogle hoogleIndex;
84+ ++ lib.optional withHoogle' hoogleIndex;
83 nativeBuildInputs = [ ghcEnv ]
85 nativeBuildInputs = [ ghcEnv ]
84 ++ nativeBuildInputs
86 ++ nativeBuildInputs
85 ++ mkDrvArgs.nativeBuildInputs or [];
87 ++ mkDrvArgs.nativeBuildInputs or [];
compiler/ghc/default.nix+39−10
@@ -3,7 +3,7 @@
3# haskell.nix ships its own version of the ghc expression as it needs more
3# haskell.nix ships its own version of the ghc expression as it needs more
4# control over the expression to isolate it against varying <nixpkgs> and
4# control over the expression to isolate it against varying <nixpkgs> and
5# allow us to customize it to the way haskell.nix works.
5# allow us to customize it to the way haskell.nix works.
6−{ stdenv, targetPackages
6+{ stdenv, haskell-nix, targetPackages
7
7
8# build-tools
8# build-tools
9, bootPkgs
9, bootPkgs
@@ -33,15 +33,24 @@
33
33
34, # Whether to build dynamic libs for the standard library (on the target
34, # Whether to build dynamic libs for the standard library (on the target
35 # platform). Static libs are always built.
35 # platform). Static libs are always built.
36− enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
36+ enableShared ? !haskell-nix.haskellLib.isCrossTarget
37
37
38−, # Whetherto build terminfo.
38+, # Whetherto build terminfo. Musl fails to build terminfo as ncurses seems to be linked to glibc
39− enableTerminfo ? !stdenv.targetPlatform.isWindows
39+ enableTerminfo ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.isMusl
40
40
41, # What flavour to build. An empty string indicates no
41, # What flavour to build. An empty string indicates no
42 # specific flavour and falls back to ghc default values.
42 # specific flavour and falls back to ghc default values.
43− ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
43+ ghcFlavour ? stdenv.lib.optionalString haskell-nix.haskellLib.isCrossTarget (
44+ if useLLVM
45+ then (
46+ # TODO check if the issues with qemu and Aarch32 persist. See
47+ # https://github.com/input-output-hk/haskell.nix/pull/411/commits/1986264683067198e7fdc1d665351622b664712e
48+ if stdenv.targetPlatform.isAarch32
49+ then "quick-cross"
50+ else "perf-cross"
51+ )
44− (if useLLVM then "quick-cross" else "perf-cross-ncg")
52+ else "perf-cross-ncg"
53+ )
45
54
46, # Whether to disable the large address space allocator
55, # Whether to disable the large address space allocator
47 # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
56 # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
@@ -59,9 +68,15 @@ assert !enableIntegerSimple -> gmp != null;
59
68
60let
69let
61 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
70 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
71+ inherit (haskell-nix.haskellLib) isCrossTarget;
62
72
63 inherit (bootPkgs) ghc;
73 inherit (bootPkgs) ghc;
64
74
75+ # TODO check if this posible fix for segfaults works or not.
76+ libffiStaticEnabled = if libffi == null || !stdenv.targetPlatform.isMusl
77+ then libffi
78+ else targetPackages.libffi.overrideAttrs (old: { dontDisableStatic = true; });
79+
65 # TODO(@Ericson2314) Make unconditional
80 # TODO(@Ericson2314) Make unconditional
66 targetPrefix = stdenv.lib.optionalString
81 targetPrefix = stdenv.lib.optionalString
67 (targetPlatform != hostPlatform)
82 (targetPlatform != hostPlatform)
@@ -75,8 +90,9 @@ let
75 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
90 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
76 INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
91 INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
77 '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
92 '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
78− Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
79 CrossCompilePrefix = ${targetPrefix}
93 CrossCompilePrefix = ${targetPrefix}
94+ '' + stdenv.lib.optionalString isCrossTarget ''
95+ Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
80 HADDOCK_DOCS = NO
96 HADDOCK_DOCS = NO
81 BUILD_SPHINX_HTML = NO
97 BUILD_SPHINX_HTML = NO
82 BUILD_SPHINX_PDF = NO
98 BUILD_SPHINX_PDF = NO
@@ -88,11 +104,19 @@ let
88 '' + stdenv.lib.optionalString useLLVM ''
104 '' + stdenv.lib.optionalString useLLVM ''
89 GhcStage2HcOpts += -fast-llvm
105 GhcStage2HcOpts += -fast-llvm
90 GhcLibHcOpts += -fast-llvm
106 GhcLibHcOpts += -fast-llvm
107+ '' + stdenv.lib.optionalString (!enableTerminfo) ''
108+ WITH_TERMINFO=NO
109+ ''
110+ # While split sections are now enabled by default in ghc 8.8 for windows,
111+ # the seem to lead to `too many sections` errors when building base for
112+ # profiling.
113+ + stdenv.lib.optionalString targetPlatform.isWindows ''
114+ SplitSections = NO
91 '';
115 '';
92
116
93 # Splicer will pull out correct variations
117 # Splicer will pull out correct variations
94 libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
118 libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
95− ++ [libffi]
119+ ++ [libffiStaticEnabled]
96 ++ stdenv.lib.optional (!enableIntegerSimple) gmp
120 ++ stdenv.lib.optional (!enableIntegerSimple) gmp
97 ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
121 ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
98
122
@@ -184,7 +208,7 @@ in let configured-src = stdenv.mkDerivation (rec {
184 configureFlags = [
208 configureFlags = [
185 "--datadir=$doc/share/doc/ghc"
209 "--datadir=$doc/share/doc/ghc"
186 "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
210 "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
187− ] ++ stdenv.lib.optionals (libffi != null) ["--with-system-libffi" "--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
211+ ] ++ stdenv.lib.optionals (libffiStaticEnabled != null) ["--with-system-libffi" "--with-ffi-includes=${libffiStaticEnabled.dev}/include" "--with-ffi-libraries=${libffiStaticEnabled.out}/lib"
188 ] ++ stdenv.lib.optional (!enableIntegerSimple) [
212 ] ++ stdenv.lib.optional (!enableIntegerSimple) [
189 "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
213 "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
190 ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
214 ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
@@ -298,7 +322,12 @@ in let configured-src = stdenv.mkDerivation (rec {
298 for i in "$out/bin/"*; do
322 for i in "$out/bin/"*; do
299 test ! -h $i || continue
323 test ! -h $i || continue
300 egrep --quiet '^#!' <(head -n 1 $i) || continue
324 egrep --quiet '^#!' <(head -n 1 $i) || continue
325+ # The ghcprog fixup is for musl (where runhaskell script just needs to point to the correct
326+ # ghc program to work).
327+ sed -i \
301− sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
328+ -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' \
329+ -e 's/ghcprog="ghc-/ghcprog="${targetPrefix}ghc-/' \
330+ $i
302 done
331 done
303 '' + installDeps targetPrefix;
332 '' + installDeps targetPrefix;
304
333
lib/default.nix+11
@@ -177,4 +177,15 @@ with haskellLib;
177 check = import ./check.nix {
177 check = import ./check.nix {
178 inherit stdenv lib haskellLib srcOnly;
178 inherit stdenv lib haskellLib srcOnly;
179 };
179 };
180+
181+ # Use `isCrossHost` to identify when we are cross compiling and
182+ # the code we are producing will not run on the build system
183+ # without an emulator.
184+ # In most cases we do not want to treat musl as a cross compiler.
185+ # For instance when building ghc we want to include ghci.
186+ isCrossHost = stdenv.hostPlatform != stdenv.buildPlatform
187+ && !(stdenv.buildPlatform.isLinux && stdenv.hostPlatform.isMusl);
188+ # This is the same as isCrossHost but for use when building ghc itself
189+ isCrossTarget = stdenv.targetPlatform != stdenv.hostPlatform
190+ && !(stdenv.hostPlatform.isLinux && stdenv.targetPlatform.isMusl);
180}
191}
nixpkgs/github.json+3−3
@@ -1,7 +1,7 @@
1{
1{
2 "url": "https://github.com/input-output-hk/nixpkgs",
2 "url": "https://github.com/input-output-hk/nixpkgs",
3− "rev": "31aa5316ca232a53667790a99e8b1e76252e065c",
3+ "rev": "8215f2ee01c56a764416f703c66767404a321d92",
4− "date": "2019-11-16T23:51:02+13:00",
4+ "date": "2020-01-25T20:38:55+13:00",
5− "sha256": "0g0r473rdrh5vsdvr45nmfs6ibp0pqyzbw9f0iv6r0jkg6jjiykr",
5+ "sha256": "0cdmpwpi19354hqvph7mnxrdbphina1vg61fk487i9559bsv545m",
6 "fetchSubmodules": false
6 "fetchSubmodules": false
7}
7}
overlays/armv6l-linux.nix+2−2
@@ -15,10 +15,10 @@ self: super:
15 inherit (pkgs) gmp;
15 inherit (pkgs) gmp;
16 # iserv-proxy needs to come from the buildPackages, as it needs to run on the
16 # iserv-proxy needs to come from the buildPackages, as it needs to run on the
17 # build host.
17 # build host.
18− inherit (config.hsPkgs.buildPackages.iserv-proxy.components.exes) iserv-proxy;
18+ inherit (self.buildPackages.ghc-extra-packages."${config.compiler.nix-name}".iserv-proxy.components.exes) iserv-proxy;
19 # remote-iserv however needs to come from the regular packages as it has to
19 # remote-iserv however needs to come from the regular packages as it has to
20 # run on the target host.
20 # run on the target host.
21− inherit (config.hsPkgs.remote-iserv.components.exes) remote-iserv;
21+ inherit (self.ghc-extra-packages."${config.compiler.nix-name}".remote-iserv.components.exes) remote-iserv;
22 # we need to use openssl.bin here, because the .dll's are in the .bin expression.
22 # we need to use openssl.bin here, because the .dll's are in the .bin expression.
23 extra-test-libs = [
23 extra-test-libs = [
24 # pkgs.rocksdb
24 # pkgs.rocksdb
overlays/bootstrap.nix+16
@@ -247,6 +247,22 @@ in {
247
247
248 ghc-patches = ghc-patches "8.8.2";
248 ghc-patches = ghc-patches "8.8.2";
249 };
249 };
250+ ghc883 = self.callPackage ../compiler/ghc {
251+ extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc883; };
252+
253+ inherit bootPkgs sphinx installDeps;
254+
255+ buildLlvmPackages = self.buildPackages.llvmPackages_7;
256+ llvmPackages = self.llvmPackages_7;
257+
258+ src-spec = rec {
259+ version = "8.8.3";
260+ url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
261+ sha256 = "128g932i3wix6ic03v04nh5755vyjiidzri9iybwad72yfmc1p70";
262+ };
263+
264+ ghc-patches = ghc-patches "8.8.3";
265+ };
250 } // self.lib.optionalAttrs (self.targetPlatform.isGhcjs or false)
266 } // self.lib.optionalAttrs (self.targetPlatform.isGhcjs or false)
251 # This will inject `exactDeps` and `envDeps` into the ghcjs
267 # This will inject `exactDeps` and `envDeps` into the ghcjs
252 # compiler defined below. This is crucial to build packages
268 # compiler defined below. This is crucial to build packages
overlays/ghc.nix−4
@@ -2,10 +2,6 @@ self: super: with super;
2 # sadly we need to patch GHC a bit.
2 # sadly we need to patch GHC a bit.
3 let
3 let
4 ghcPkgOverrides = {
4 ghcPkgOverrides = {
5− # Required for cross-compilation, otherwise it throws
6− # Failed to load interface for ‘GHC.Integer.Type’
7− # Perhaps you haven't installed the "dyn" libraries for package ‘integer-gmp-1.0.2.0’?
8− enableShared = super.stdenv.buildPlatform == super.stdenv.hostPlatform;
9 enableIntegerSimple = false;
5 enableIntegerSimple = false;
10 } // lib.optionalAttrs self.stdenv.hostPlatform.isAarch32 {
6 } // lib.optionalAttrs self.stdenv.hostPlatform.isAarch32 {
11 enableRelocatableStaticLibs = false;
7 enableRelocatableStaticLibs = false;
overlays/haskell.nix+2−1
@@ -477,7 +477,7 @@ self: super: {
477 };
477 };
478
478
479 haskellNixRoots' = ifdLevel:
479 haskellNixRoots' = ifdLevel:
480− let filterSupportedGhc = self.lib.filterAttrs (n: _: n == "ghc865" || n == "ghc882");
480+ let filterSupportedGhc = self.lib.filterAttrs (n: _: n == "ghc865" || n == "ghc882" || n == "ghc883");
481 in self.recurseIntoAttrs ({
481 in self.recurseIntoAttrs ({
482 # Things that require no IFD to build
482 # Things that require no IFD to build
483 inherit (self.buildPackages.haskell-nix) nix-tools source-pins;
483 inherit (self.buildPackages.haskell-nix) nix-tools source-pins;
@@ -492,6 +492,7 @@ self: super: {
492 hscolour = self.buildPackages.haskell-nix.bootstrap.packages.hscolour;
492 hscolour = self.buildPackages.haskell-nix.bootstrap.packages.hscolour;
493 ghc865 = self.buildPackages.haskell-nix.compiler.ghc865;
493 ghc865 = self.buildPackages.haskell-nix.compiler.ghc865;
494 ghc882 = self.buildPackages.haskell-nix.compiler.ghc882;
494 ghc882 = self.buildPackages.haskell-nix.compiler.ghc882;
495+ ghc883 = self.buildPackages.haskell-nix.compiler.ghc883;
495 ghc-extra-projects = self.recurseIntoAttrs (builtins.mapAttrs (_: proj: withInputs proj.plan-nix)
496 ghc-extra-projects = self.recurseIntoAttrs (builtins.mapAttrs (_: proj: withInputs proj.plan-nix)
496 (filterSupportedGhc self.ghc-extra-projects));
497 (filterSupportedGhc self.ghc-extra-projects));
497 } // self.lib.optionalAttrs (ifdLevel > 1) {
498 } // self.lib.optionalAttrs (ifdLevel > 1) {
overlays/linux-cross.nix+3−2
@@ -53,7 +53,8 @@ let
53 set -euo pipefail
53 set -euo pipefail
54 ${qemu}/bin/qemu-${qemuSuffix} $@*
54 ${qemu}/bin/qemu-${qemuSuffix} $@*
55 '';
55 '';
56− testFlags = lib.optionals isLinuxCross [ "--test-wrapper ${qemuTestWrapper}/bin/test-wrapper" ];
56+ testWrapper = lib.optional isLinuxCross "${qemuTestWrapper}/bin/test-wrapper";
57+
57 preCheck = lib.optionalString isLinuxCross ''
58 preCheck = lib.optionalString isLinuxCross ''
58 echo "================================================================="
59 echo "================================================================="
59 echo "RUNNING TESTS for $name via qemu-${qemuSuffix}"
60 echo "RUNNING TESTS for $name via qemu-${qemuSuffix}"
@@ -71,4 +72,4 @@ let
71
72
72 enableShared = lib.mkDefault (!isLinuxCross);
73 enableShared = lib.mkDefault (!isLinuxCross);
73
74
74−in { inherit preCheck postCheck configureFlags setupBuildFlags testFlags enableShared; }
75+in { inherit preCheck postCheck configureFlags setupBuildFlags testWrapper enableShared; }
overlays/windows.nix+2−2
@@ -36,10 +36,10 @@ self: super:
36 inherit (pkgs) gmp;
36 inherit (pkgs) gmp;
37 # iserv-proxy needs to come from the buildPackages, as it needs to run on the
37 # iserv-proxy needs to come from the buildPackages, as it needs to run on the
38 # build host.
38 # build host.
39− inherit (self.buildPackages.ghc-extra-packages.ghc865.iserv-proxy.components.exes) iserv-proxy;
39+ inherit (self.buildPackages.ghc-extra-packages."${config.compiler.nix-name}".iserv-proxy.components.exes) iserv-proxy;
40 # remote-iserv however needs to come from the regular packages as it has to
40 # remote-iserv however needs to come from the regular packages as it has to
41 # run on the target host.
41 # run on the target host.
42− inherit (self.ghc-extra-packages.ghc865.remote-iserv.components.exes) remote-iserv;
42+ inherit (self.ghc-extra-packages."${config.compiler.nix-name}".remote-iserv.components.exes) remote-iserv;
43 # we need to use openssl.bin here, because the .dll's are in the .bin expression.
43 # we need to use openssl.bin here, because the .dll's are in the .bin expression.
44 # extra-test-libs = [ pkgs.rocksdb pkgs.openssl.bin pkgs.libffi pkgs.gmp ];
44 # extra-test-libs = [ pkgs.rocksdb pkgs.openssl.bin pkgs.libffi pkgs.gmp ];
45 } // {
45 } // {
release.nix+38−19
@@ -22,25 +22,39 @@ let
22 # to `x86_64-w64-mingw32` in 19.09.
22 # to `x86_64-w64-mingw32` in 19.09.
23 let pinnedNixpkgs = import ./nixpkgs { inherit nixpkgs-pin; }; in
23 let pinnedNixpkgs = import ./nixpkgs { inherit nixpkgs-pin; }; in
24 with pinnedNixpkgs.lib;
24 with pinnedNixpkgs.lib;
25+ let
25− let inherit (systems.examples) musl64 mingwW64; in
26+ inherit (systems.examples) musl64 mingwW64 aarch64-multiplatform raspberryPi;
27+ packages = supportedSystems:
26− with (import (pinnedNixpkgs.path + "/pkgs/top-level/release-lib.nix") {
28+ with (import (pinnedNixpkgs.path + "/pkgs/top-level/release-lib.nix") {
27− inherit supportedSystems scrubJobs nixpkgsArgs;
29+ inherit supportedSystems scrubJobs nixpkgsArgs;
28− packageSet = {
30+ packageSet = {
29− system ? builtins.currentSystem
31+ system ? builtins.currentSystem
30− , crossSystem ? null
32+ , crossSystem ? null
31− , nixpkgsArgs ? { inherit system crossSystem; }
33+ , nixpkgsArgs ? { inherit system crossSystem; }
32− , ...}@args:
34+ , ...}@args:
33− import (haskell-nix + /build.nix) (args // {
35+ import (haskell-nix + /build.nix) (args // {
34− nixpkgsArgs = nixpkgsArgs // { inherit nixpkgs-pin; };
36+ nixpkgsArgs = nixpkgsArgs // {
37+ inherit nixpkgs-pin;
38+ };
35− inherit ifdLevel;
39+ inherit ifdLevel;
36− });
40+ });
37− });
41+ });
38−
42+ {
43+ mapTestOn = mapTestOn (packagePlatforms pkgs);
44+ mapTestOnCross = p: mapTestOnCross p (packagePlatforms pkgs);
45+ };
46+ in
39 {
47 {
40− native = filterTests (mapTestOn (packagePlatforms pkgs));
48+ native = filterTests ((packages supportedSystems).mapTestOn);
41− # Disabled for now. Something is wrong and this would require `allowBroken`
49+ # Musl cross compile does not work on macOS
42− # "${musl64.config}" = filterTests (mapTestOnCross musl64 (packagePlatforms pkgs));
50+ "${musl64.config}" = filterTests ((packages (filter (x: x == "x86_64-linux") supportedSystems)).mapTestOnCross musl64);
43− "${mingwW64.config}" = filterTests (mapTestOnCross mingwW64 (packagePlatforms pkgs));
51+ # Windows cross compilation is currently broken on macOS for nixpkgs 19.09 (works on 19.03)
52+ "${mingwW64.config}" = filterTests ((packages (filter
53+ (x: x == "x86_64-linux" || nixpkgs-pin == "release-19.03") supportedSystems)).mapTestOnCross mingwW64);
54+ "${aarch64-multiplatform.config}" = filterTests ((packages (filter (x: x == "x86_64-linux") supportedSystems))
55+ .mapTestOnCross aarch64-multiplatform);
56+ # "${raspberryPi.config}" = filterTests ((packages (filter (x: x == "x86_64-linux") supportedSystems))
57+ # .mapTestOnCross raspberryPi);
44 };
58 };
45
59
46 allJobs =
60 allJobs =
@@ -57,7 +71,12 @@ in allJobs // {
57 meta.description = "All jobs required to pass CI";
71 meta.description = "All jobs required to pass CI";
58 constituents =
72 constituents =
59 collect isDerivation allJobs.R1903.native
73 collect isDerivation allJobs.R1903.native
60− ++ collect isDerivation allJobs.R1909.native;
74+ ++ collect isDerivation allJobs.R1909.native
75+ # Windows cross compiling with GHC 8.8.2 is broken
76+ # ++ collect isDerivation allJobs.R1903.x86_64-pc-mingw32
77+ # ++ collect isDerivation allJobs.R1909.x86_64-w64-mingw32
78+ ++ collect isDerivation allJobs.R1903.x86_64-unknown-linux-musl
79+ ++ collect isDerivation allJobs.R1909.x86_64-unknown-linux-musl;
61 };
80 };
62 }
81 }
63
82
test/cabal-22/default.nix+7−3
@@ -24,11 +24,15 @@ in recurseIntoAttrs {
24 printf "size of executable $exe is $size. \n" >& 2
24 printf "size of executable $exe is $size. \n" >& 2
25
25
26 # fixme: run on target platform when cross-compiled
26 # fixme: run on target platform when cross-compiled
27− printf "checking whether executable rans... " >& 2
27+ printf "checking whether executable runs... " >& 2
28 cat ${haskellLib.check packages.project.components.exes.project}
28 cat ${haskellLib.check packages.project.components.exes.project}
29
29
30+ '' +
31+ # Aarch is statically linked and does not produce a .so file.
32+ # Musl is also statically linked, but it does make a .so file so we should check that still.
33+ optionalString (!stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64) (''
30 printf "checking that executable is dynamically linked to system libraries... " >& 2
34 printf "checking that executable is dynamically linked to system libraries... " >& 2
31− '' + optionalString stdenv.isLinux ''
35+ '' + optionalString (stdenv.isLinux && !stdenv.hostPlatform.isMusl) ''
32 ldd $exe | grep libgmp
36 ldd $exe | grep libgmp
33 '' + optionalString stdenv.isDarwin ''
37 '' + optionalString stdenv.isDarwin ''
34 otool -L $exe | grep "libSystem.B"
38 otool -L $exe | grep "libSystem.B"
@@ -47,7 +51,7 @@ in recurseIntoAttrs {
47 ldd $sofile | grep libHSghc-prim
51 ldd $sofile | grep libHSghc-prim
48 '' + optionalString stdenv.isDarwin ''
52 '' + optionalString stdenv.isDarwin ''
49 otool -L $sofile | grep libHSghc-prim
53 otool -L $sofile | grep libHSghc-prim
50− '') + ''
54+ '')) + ''
51 touch $out
55 touch $out
52
56
53 printf "checking whether benchmark ran... " >& 2
57 printf "checking whether benchmark ran... " >& 2
test/cabal-simple-prof/default.nix+4−1
@@ -37,7 +37,10 @@ in recurseIntoAttrs {
37
37
38 # fixme: run on target platform when cross-compiled
38 # fixme: run on target platform when cross-compiled
39 printf "checking whether executable runs with profiling... " >& 2
39 printf "checking whether executable runs with profiling... " >& 2
40+ # Curiosity: cross compilers prodcing profiling with `+RTS -p -h` lead to the following cryptic message:
41+ # cabal-simple: invalid heap profile option: -h*
42+ # Hence we pass `-hc`.
40− ${toString packages.cabal-simple.components.exes.cabal-simple.config.testWrapper} $exe +RTS -p -h
43+ ${toString packages.cabal-simple.components.exes.cabal-simple.config.testWrapper} $exe +RTS -p -hc
41
44
42 touch $out
45 touch $out
43 '';
46 '';
test/cabal-simple/default.nix+13−22
@@ -1,5 +1,5 @@
1# Test a package set
1# Test a package set
2−{ stdenv, util, mkCabalProjectPkgSet, cabalProject', haskellLib, gmp6, zlib, recurseIntoAttrs }:
2+{ stdenv, util, mkCabalProjectPkgSet, cabalProject', haskellLib, recurseIntoAttrs }:
3
3
4with stdenv.lib;
4with stdenv.lib;
5
5
@@ -9,19 +9,6 @@ let
9 # Package has no exposed modules which causes
9 # Package has no exposed modules which causes
10 # haddock: No input file(s)
10 # haddock: No input file(s)
11 packages.cabal-simple.doHaddock = false;
11 packages.cabal-simple.doHaddock = false;
12−
13− # When compiling with musl ghc, build a statically linked
14− # executable against static libraries.
15− # Ref: https://vaibhavsagar.com/blog/2018/01/03/static-haskell-nix/
16− packages.cabal-simple.components.exes.cabal-simple.configureFlags =
17− optionals stdenv.hostPlatform.isMusl [
18− "--disable-executable-dynamic"
19− "--disable-shared"
20− "--ghc-option=-optl=-pthread"
21− "--ghc-option=-optl=-static"
22− "--ghc-option=-optl=-L${gmp6.override { withStatic = true; }}/lib"
23− # "--ghc-option=-optl=-L${zlib.static}/lib"
24− ];
25 }
12 }
26 ];
13 ];
27
14
@@ -53,16 +40,20 @@ in recurseIntoAttrs {
53 # fixme: run on target platform when cross-compiled
40 # fixme: run on target platform when cross-compiled
54 printf "checking whether executable runs... " >& 2
41 printf "checking whether executable runs... " >& 2
55 cat ${haskellLib.check packages.cabal-simple.components.exes.cabal-simple}
42 cat ${haskellLib.check packages.cabal-simple.components.exes.cabal-simple}
56− '' + (if stdenv.hostPlatform.isMusl then ''
43+ '' + (if stdenv.hostPlatform.isMusl
44+ then ''
57 printf "checking that executable is statically linked... " >& 2
45 printf "checking that executable is statically linked... " >& 2
58 (ldd $exe 2>&1 || true) | grep -i "not a"
46 (ldd $exe 2>&1 || true) | grep -i "not a"
47+ ''
59− '' else ''
48+ else
49+ # Skip this on aarch as we do not have an `ldd` tool
50+ optionalString (!stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64) (''
60− printf "checking that executable is dynamically linked to system libraries... " >& 2
51+ printf "checking that executable is dynamically linked to system libraries... " >& 2
61− '' + optionalString stdenv.isLinux ''
52+ '' + optionalString stdenv.isLinux ''
62− ldd $exe | grep libpthread
53+ ldd $exe | grep libpthread
63− '' + optionalString stdenv.isDarwin ''
54+ '' + optionalString stdenv.isDarwin ''
64− otool -L $exe |grep .dylib
55+ otool -L $exe |grep .dylib
65− '') + ''
56+ '')) + ''
66
57
67 printf "Checking that \"all\" component has the programs... " >& 2
58 printf "Checking that \"all\" component has the programs... " >& 2
68 all_exe="${packages.cabal-simple.components.all}/bin/cabal-simple${stdenv.hostPlatform.extensions.executable}"
59 all_exe="${packages.cabal-simple.components.all}/bin/cabal-simple${stdenv.hostPlatform.extensions.executable}"
test/cabal-sublib/default.nix+5−2
@@ -37,12 +37,15 @@ in recurseIntoAttrs {
37 printf "checking whether executable runs... " >& 2
37 printf "checking whether executable runs... " >& 2
38 cat ${haskellLib.check packages.cabal-sublib.components.exes.cabal-sublib}
38 cat ${haskellLib.check packages.cabal-sublib.components.exes.cabal-sublib}
39
39
40+ '' +
41+ # Musl and Aarch are statically linked..
42+ optionalString (!stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64 && !stdenv.hostPlatform.isMusl) (''
40 printf "checking that executable is dynamically linked to system libraries... " >& 2
43 printf "checking that executable is dynamically linked to system libraries... " >& 2
41− '' + optionalString stdenv.isLinux ''
44+ '' + optionalString (stdenv.isLinux && !stdenv.hostPlatform.isMusl) ''
42 ldd $exe | grep libgmp
45 ldd $exe | grep libgmp
43 '' + optionalString stdenv.isDarwin ''
46 '' + optionalString stdenv.isDarwin ''
44 otool -L $exe |grep .dylib
47 otool -L $exe |grep .dylib
45− '' + ''
48+ '') + ''
46
49
47 printf "Checking that \"all\" component has the programs... " >& 2
50 printf "Checking that \"all\" component has the programs... " >& 2
48 all_exe="${packages.cabal-sublib.components.all}/bin/cabal-sublib${stdenv.hostPlatform.extensions.executable}"
51 all_exe="${packages.cabal-sublib.components.all}/bin/cabal-sublib${stdenv.hostPlatform.extensions.executable}"
test/exe-only/default.nix+4−1
@@ -26,7 +26,10 @@ in recurseIntoAttrs {
26 # fixme: run on target platform when cross-compiled
26 # fixme: run on target platform when cross-compiled
27 printf "checking whether executable ran... " >& 2
27 printf "checking whether executable ran... " >& 2
28 cat ${haskellLib.check packages.exe-only.components.exes.exe-only}
28 cat ${haskellLib.check packages.exe-only.components.exes.exe-only}
29+ '' +
30+ # Aarch are statically linked and does not have ldd for these tests.
31+ optionalString (!stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64) (
29− '' + (if stdenv.hostPlatform.isMusl then ''
32+ if stdenv.hostPlatform.isMusl then ''
30 printf "checking that executable is statically linked... " >& 2
33 printf "checking that executable is statically linked... " >& 2
31 (ldd $exe 2>&1 || true) | grep -i "not a"
34 (ldd $exe 2>&1 || true) | grep -i "not a"
32 '' else ''
35 '' else ''
test/fully-static/default.nix+1−6
@@ -32,12 +32,7 @@ let
32
32
33 withFullyStatic = {
33 withFullyStatic = {
34 configureFlags =
34 configureFlags =
35− optionals stdenv.hostPlatform.isMusl ([
36− "--disable-executable-dynamic"
37− "--disable-shared"
38− "--ghc-option=-optl=-pthread"
39− "--ghc-option=-optl=-static"
40− ] ++ map (drv: "--ghc-option=-optl=-L${drv}/lib") staticLibs);
35+ optionals stdenv.hostPlatform.isMusl (map (drv: "--ghc-option=-optl=-L${drv}/lib") staticLibs);
41 };
36 };
42 in {
37 in {
43 # Select a non-GMP compiler, usually for software licensing reasons.
38 # Select a non-GMP compiler, usually for software licensing reasons.
test/setup-deps/default.nix+2−2
@@ -15,10 +15,10 @@ let
15 };
15 };
16
16
17 packages = project.hsPkgs;
17 packages = project.hsPkgs;
18−in recurseIntoAttrs (if stdenv.hostPlatform.isWindows
18+in recurseIntoAttrs (if stdenv.buildPlatform != stdenv.hostPlatform
19 then
19 then
20 let skip = pkgs.runCommand "skip-test-setup-deps" {} ''
20 let skip = pkgs.runCommand "skip-test-setup-deps" {} ''
21− echo "Skipping setup-deps test on windows as it needs the ghc lib" >& 2
21+ echo "Skipping setup-deps test when cross compiling as it needs the ghc lib" >& 2
22 touch $out
22 touch $out
23 '';
23 '';
24 in {
24 in {
test/shell-for-setup-deps/default.nix+11−5
@@ -14,10 +14,15 @@ let
14
14
15 env = project.hsPkgs.shellFor {};
15 env = project.hsPkgs.shellFor {};
16
16
17+# Making this work for cross compilers will be dificult as setup-deps are
18+# built for the build platform and the shell will be for the host platform.
19+# We probably need a shell that provides both build and host ghc
20+# and corrisponding package DBs and a way to use them.
21+# This problem affects musl as well as the build libraries are linked to glibc.
17−in recurseIntoAttrs (if stdenv.hostPlatform.isWindows
22+in recurseIntoAttrs (if stdenv.buildPlatform != stdenv.hostPlatform
18 then
23 then
19 let skip = runCommand "skipping-test-shell-for-setup-deps" {} ''
24 let skip = runCommand "skipping-test-shell-for-setup-deps" {} ''
20− echo "Skipping shell-for-setup-deps test on windows as does not work yet" >& 2
25+ echo "Skipping shell-for-setup-deps test on cross compilers (does not work yet)" >& 2
21 touch $out
26 touch $out
22 '';
27 '';
23 in {
28 in {
@@ -31,7 +36,7 @@ in recurseIntoAttrs (if stdenv.hostPlatform.isWindows
31 };
36 };
32 inherit env;
37 inherit env;
33 run = stdenv.mkDerivation {
38 run = stdenv.mkDerivation {
34− name = "shell-for-test";
39+ name = "shell-for-setup-deps-test";
35
40
36 buildCommand = ''
41 buildCommand = ''
37 ########################################################################
42 ########################################################################
@@ -40,13 +45,14 @@ in recurseIntoAttrs (if stdenv.hostPlatform.isWindows
40 cp ${./pkg/src}/*.hs .
45 cp ${./pkg/src}/*.hs .
41
46
42 printf "checking that the shell env has the dependencies...\n" >& 2
47 printf "checking that the shell env has the dependencies...\n" >& 2
48+ ${env.ghc}/bin/${env.ghc.targetPrefix}ghc-pkg list
43− ${env.ghc}/bin/runghc conduit-test.hs
49+ ${env.ghc}/bin/${env.ghc.targetPrefix}runghc conduit-test.hs
44
50
45 touch $out
51 touch $out
46 '';
52 '';
47
53
48 meta.platforms = platforms.all;
54 meta.platforms = platforms.all;
49− meta.disabled = stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWindows;
55+ meta.disabled = stdenv.buildPlatform != stdenv.hostPlatform;
50
56
51 passthru = {
57 passthru = {
52 # Used for debugging with nix repl
58 # Used for debugging with nix repl
test/shell-for/default.nix+2−2
@@ -68,10 +68,10 @@ in recurseIntoAttrs (if stdenv.hostPlatform.isWindows
68 cp ${./pkgb/src}/*.hs .
68 cp ${./pkgb/src}/*.hs .
69
69
70 printf "checking that the shell env has the dependencies...\n" >& 2
70 printf "checking that the shell env has the dependencies...\n" >& 2
71− ${env.ghc}/bin/runghc conduit-test.hs
71+ ${env.ghc}/bin/${env.ghc.targetPrefix}runghc conduit-test.hs
72
72
73 printf "checking that the shell envDefault has the dependencies...\n" >& 2
73 printf "checking that the shell envDefault has the dependencies...\n" >& 2
74− ${envDefault.ghc}/bin/runghc conduit-test.hs
74+ ${envDefault.ghc}/bin/${env.ghc.targetPrefix}runghc conduit-test.hs
75
75
76 touch $out
76 touch $out
77 '';
77 '';
test/snapshots/default.nix+8−4
@@ -37,10 +37,14 @@ in recurseIntoAttrs (if stdenv.hostPlatform.isWindows
37 # test snapshot ghcWithHoogle
37 # test snapshot ghcWithHoogle
38
38
39 printf "checking that the ghcWithPackages env has the package...\n" >& 2
39 printf "checking that the ghcWithPackages env has the package...\n" >& 2
40− ${env}/bin/ghc-pkg list | grep conduit
40+ ${env}/bin/${env.targetPrefix}ghc-pkg list | grep conduit
41−
41+
42+ ''
43+ # Hoogle support is currently disabled in cross compiler shells
44+ + (optionalString (!stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64) ''
42− printf "checking that the ghcWithPackages env has a hoogle index...\n" >& 2
45+ printf "checking that the ghcWithPackages env has a hoogle index...\n" >& 2
43− ${env}/bin/hoogle search Conduit --count=100 | grep ConduitT
46+ ${env}/bin/hoogle search Conduit --count=100 | grep ConduitT
47+ '') +''
44
48
45 touch $out
49 touch $out
46 '';
50 '';
test/with-packages/default.nix+2−2
@@ -73,11 +73,11 @@ in recurseIntoAttrs {
73 ''
73 ''
74 else ''
74 else ''
75 printf "checking that the package env has the dependencies... " >& 2
75 printf "checking that the package env has the dependencies... " >& 2
76− ${package.components.all.env}/bin/runghc ${./Point.hs}
76+ ${package.components.all.env}/bin/${package.components.all.env.targetPrefix}runghc ${./Point.hs}
77 echo >& 2
77 echo >& 2
78
78
79 printf "checking that components.library.env has the dependencies... " >& 2
79 printf "checking that components.library.env has the dependencies... " >& 2
80− ${library.env}/bin/runghc ${./Point.hs}
80+ ${library.env}/bin/${library.env.targetPrefix}runghc ${./Point.hs}
81 echo >& 2
81 echo >& 2
82 '') + ''
82 '') + ''
83 touch $out
83 touch $out