input-output-hk / haskell.nix

Alternative Haskell Infrastructure for Nixpkgs
https://input-output-hk.github.io/haskell.nix
Apache License 2.0
545 stars 236 forks source link

Building haskell-ide-engine via `stackProject` fails #550

Open reactormonk opened 4 years ago

reactormonk commented 4 years ago

I'm using the following derivation:

pkgs.haskell-nix.stackProject {
    src = pkgs.fetchFromGitHub {
      owner = "haskell";
      repo = "haskell-ide-engine";
      rev = "f2c727b284587484b7ca0ab4096336190c3834c6";
      sha256 = "0i48pps842mn4xc2xzj0mm77z4vf2s1ydql8ma4b5hhwj198hb7v";
    };
    stackYaml = "stack-8.8.3.yaml";
    # Invalidate and update if you change the version
    stack-sha256 = "00vcggb31sl5a405gifb1d8yl1p4mam9b1hzmrgsjn04c8d67w09";
    inherit checkMaterialization;
    pkg-def-extras = [
      # Workaround for https://github.com/input-output-hk/haskell.nix/issues/214
      (hackage: {
        packages = {
          "hsc2hs" = (((hackage.hsc2hs)."0.68.6").revisions).default;
        };
      })
    ];
  };

Which gives me

builder for '/nix/store/pmxqvzyyxcnzg165nbcw4pjr28mkk6nj-stack-to-nix-pkgs.drv' failed with exit code 1; last 1 log lines:
  stack-to-nix: /nix/store/ddx7f0vx2xshhg6yi9lbhcfamzr8f7sf-source/bytestring-trie-0.2.5.0@rev1: getDirectoryContents:openDirStream: does not exist (No such file or directory)
infinisil commented 4 years ago

See https://github.com/haskell/haskell-ide-engine/pull/1770, this occurs because the project has @rev1 as an extra dependency specified, which is not valid syntax, it should be @rev:1 instead.

I think the problem in stack-to-nix is that it for some reason tries to treat such an entry as a local path, which subsequently it can't read because it doesn't exist. I think the problem needs to be fixed around here: https://github.com/input-output-hk/nix-tools/blob/856f3d5a3873f19099ad6d399a8cb52629a92155/lib/Stack2nix/Stack.hs#L212-L215

infinisil commented 4 years ago

This is also the same issue as reported in https://github.com/input-output-hk/haskell.nix/issues/1684