Skip to content

Commit a9f592e

Browse files
committed
Merge branch 'master' of github.com:input-output-hk/haskell.nix into circuithub
2 parents 476181f + e552efe commit a9f592e

File tree

7 files changed

+23
-22
lines changed

7 files changed

+23
-22
lines changed

build.nix

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,9 @@ in rec {
4343
} // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.4" < 0) {
4444
stack = tool compiler-nix-name "stack" { version = "2.9.3"; inherit evalPackages; };
4545
} // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.6" < 0) {
46-
hls-latest = tool compiler-nix-name "haskell-language-server" rec {
46+
hls-latest = tool compiler-nix-name "haskell-language-server" {
4747
inherit evalPackages;
4848
src = pkgs.haskell-nix.sources."hls-1.10";
49-
cabalProject = __readFile (src + "/cabal.project");
50-
sha256map."https://github.com/pepeiborra/ekg-json"."7a0af7a8fd38045fd15fb13445bdcc7085325460" = "sha256-fVwKxGgM0S4Kv/4egVAAiAjV7QB5PBqMVMCfsv7otIQ=";
5149
};
5250
})
5351
);

compiler/ghc/default.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,13 @@ let
252252
packages.hadrian.postPatch = ''
253253
cd hadrian
254254
'';
255-
}];
255+
}];
256+
cabalProject = ''
257+
packages:
258+
.
259+
'';
260+
cabalProjectLocal = null;
261+
cabalProjectFreeze = null;
256262
src = haskell-nix.haskellLib.cleanSourceWith {
257263
inherit src;
258264
subDir = "hadrian";

flake.lock

Lines changed: 6 additions & 6 deletions
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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{ pkgs, runCommand, cacert, index-state-hashes, haskellLib }@defaults:
22
let readIfExists = src: fileName:
33
# Using origSrcSubDir bypasses any cleanSourceWith.
4+
# `lookForCabalProject` allows us to avoid looking in source from hackage
5+
# for cabal.project files. It is set in `modules/hackage-project.nix`.
46
let origSrcDir = src.origSrcSubDir or src;
57
in
6-
if builtins.elem ((__readDir origSrcDir)."${fileName}" or "") ["regular" "symlink"]
8+
if (src.lookForCabalProject or true) && builtins.elem ((__readDir origSrcDir)."${fileName}" or "") ["regular" "symlink"]
79
then __readFile (origSrcDir + "/${fileName}")
810
else null;
911
in

modules/cabal-project.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ in {
9696
};
9797
sha256map = mkOption {
9898
type = nullOr (attrsOf (either str (attrsOf str)));
99-
default = null;
99+
# Default needed for haskell-language-server 1.10
100+
default."https://github.com/pepeiborra/ekg-json"."7a0af7a8fd38045fd15fb13445bdcc7085325460" = "sha256-fVwKxGgM0S4Kv/4egVAAiAjV7QB5PBqMVMCfsv7otIQ=";
100101
description = ''
101102
An alternative to adding `--sha256` comments into the
102103
cabal.project file:

modules/hackage-project.nix

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ in {
2424
};
2525
};
2626
config = {
27-
# Avoid readDir and readFile IFD functions looking for these files in the hackage source
28-
# `mkOverride 1100` means this will be used in preference to the mkOption default,
29-
# but a `mkDefault` can still override this.
30-
cabalProject = lib.mkOverride 1100 ''
31-
packages: .
32-
'';
33-
cabalProjectLocal = lib.mkOverride 1100 null;
34-
cabalProjectFreeze = lib.mkOverride 1100 null;
3527
src =
3628
let
3729
tarball = config.evalPackages.fetchurl {
@@ -43,7 +35,10 @@ in {
4335
inherit (rev) sha256;
4436
};
4537
revSuffix = lib.optionalString (rev.revNum > 0) "-r${toString rev.revNum}";
46-
in lib.mkOverride 1100 (config.evalPackages.runCommand "${name}-${version}${revSuffix}-src" {} (''
38+
in lib.mkOverride 1100 (config.evalPackages.runCommand "${name}-${version}${revSuffix}-src" {
39+
# Avoid readDir and readFile IFD functions looking for these project files in the hackage source
40+
passthru.lookForCabalProject = false;
41+
} (''
4742
tmp=$(mktemp -d)
4843
cd $tmp
4944
tar xzf ${tarball}

test/haskell-language-server/cabal.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ let
44
inherit compiler-nix-name evalPackages;
55
name = "haskell-language-server";
66
src = haskell-nix.sources."hls-1.10";
7-
sha256map."https://github.com/pepeiborra/ekg-json"."7a0af7a8fd38045fd15fb13445bdcc7085325460" = "sha256-fVwKxGgM0S4Kv/4egVAAiAjV7QB5PBqMVMCfsv7otIQ=";
87
};
98
in recurseIntoAttrs {
109
ifdInputs = {

0 commit comments

Comments
 (0)