Skip to content

Commit a9e2d7e

Browse files
committed
Merge remote-tracking branch 'origin/master' into hkm/wasm
2 parents e67dbba + 008e8cc commit a9e2d7e

File tree

8 files changed

+8592
-24
lines changed

8 files changed

+8592
-24
lines changed

compiler/ghc/default.nix

+13-1
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,18 @@ let
329329
subDir = "hadrian";
330330
includeSiblings = true;
331331
};
332+
# When building the plan we do not need a patched version
333+
# of the source and `buildPackages.srcOnly` requires introduces
334+
# a dependency on a build machine.
335+
evalSrc = haskell-nix.haskellLib.cleanSourceWith {
336+
src = {
337+
name = "hadrian";
338+
outPath = src;
339+
filterPath = { path, ... }: path;
340+
};
341+
subDir = "hadrian";
342+
includeSiblings = true;
343+
};
332344
};
333345

334346
hadrian = hadrianProject.hsPkgs.hadrian.components.exes.hadrian;
@@ -718,7 +730,7 @@ haskell-nix.haskellLib.makeCompilerDeps (stdenv.mkDerivation (rec {
718730
'';
719731

720732
passthru = {
721-
inherit bootPkgs targetPrefix libDir llvmPackages enableShared useLLVM hadrian hadrianProject;
733+
inherit bootPkgs targetPrefix libDir llvmPackages enableShared enableTerminfo useLLVM hadrian hadrianProject;
722734

723735
# Our Cabal compiler name
724736
haskellCompilerName = "ghc-${version}";

flake.lock

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/call-cabal-project-to-nix.nix

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{ pkgs, cacert, index-state-hashes, haskellLib }:
22
{ name ? src.name or null # optional name for better error messages
33
, src
4+
, evalSrc ? src
45
, materialized-dir ? ../materialized
56
, compiler-nix-name # The name of the ghc compiler to use eg. "ghc884"
67
, index-state ? null # Hackage index-state, eg. "2019-10-10T00:00:00Z"
@@ -94,13 +95,13 @@ in let
9495
ghc = if ghc' ? latestVersion
9596
then __trace "WARNING: ${ghc'.version} is out of date, consider using upgrading to ${ghc'.latestVersion}." ghc'
9697
else ghc';
97-
subDir' = src.origSubDir or "";
98+
subDir' = evalSrc.origSubDir or "";
9899
subDir = pkgs.lib.strings.removePrefix "/" subDir';
99100

100101
cleanedSource = haskellLib.cleanSourceWith {
101102
name = if name != null then "${name}-root-cabal-files" else "source-root-cabal-files";
102-
src = src.origSrc or src;
103-
filter = path: type: (!(src ? filter) || src.filter path type) && (
103+
src = evalSrc.origSrc or evalSrc;
104+
filter = path: type: (!(evalSrc ? filter) || evalSrc.filter path type) && (
104105
type == "directory" ||
105106
pkgs.lib.any (i: (pkgs.lib.hasSuffix i path)) [ ".cabal" "package.yaml" ]); };
106107

@@ -544,7 +545,17 @@ let
544545
''}
545546
${pkgs.lib.optionalString (!pkgs.stdenv.targetPlatform.isWindows) ''
546547
deps+=" $(jq -r '.components.lib."build-depends"[]|select(._if.not.os == "windows")|._then[]|.package' $json_cabal_file)"
547-
''}
548+
''
549+
# Fix problem with `haskeline` using a `terminfo` flag
550+
# For haskell-nix ghc we can use ghc.enableTerminfo to get the flag setting
551+
+ pkgs.lib.optionalString (name == "haskeline" && !pkgs.stdenv.targetPlatform.isWindows && ghc.enableTerminfo or true) ''
552+
deps+=" terminfo"
553+
''
554+
# Similar issue for Win32:filepath build-depends (hidden behind `if impl(ghc >= 8.0)`)
555+
+ pkgs.lib.optionalString (name == "Win32" && pkgs.stdenv.targetPlatform.isWindows) ''
556+
deps+=" filepath"
557+
''
558+
}
548559
DEPS_${varname name}="$(tr '\n' ' ' <<< "$deps")"
549560
VER_${varname name}="$(jq -r '.version' $json_cabal_file)"
550561
PKGS+=" ${name}"

0 commit comments

Comments
 (0)