mpickering / ghc-artefact-nix

Create environments with GHC HEAD artefacts
28 stars 6 forks source link

Failed to build with `nixpkgs-unstable` #10

Open ckoparkar opened 4 years ago

ckoparkar commented 4 years ago

I'm using the derivation from this repository in another Nix shell derivation as:

{
   pkgs ? import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-20.03.tar.gz) {}
,  ghcHeadOl ? import (fetchTarball https://github.com/mpickering/ghc-artefact-nix/archive/master.tar.gz) {}
,  ghc ? ghcHeadOl.ghcHEAD
}:

with pkgs;

stdenv.mkDerivation {
  name = "ghcenv";

  buildInputs = [ ghc cabal-install ghcid ];
}

If I point my <nixpkgs> to nixpkgs-unstable or change np = import <nixpkgs> {}; to np = import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz) {}; in ghc-artefact-nix/default.nix, the above Nix shell derivation fails with:

error: anonymous function at ghc-artefact-nix/artifact.nix:1:1
called without required argument 'llvm_39', 
at /nix/store/dyca73pcc7d9zmmdnrcf35ycjg1gl4x6-source/lib/customisation.nix:69:16

I've fixed it by applying this patch to ghc-artefact-nix/default.nix:

   np = import <nixpkgs> {};
-  ghc = self: ref: self.callPackage ./artifact.nix { } ref; 
+  ghc = self: ref: self.callPackage ./artifact.nix { inherit (np.llvm_39) llvm_39; } ref; 

I'm not making a pull request because this was a result of lot Googling and I don't fully understand what's going on here. It's working for me now but do you think ghc-artefact-nix/default.nix needs to be patched?