Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute 'ghc801' missing at all-packages.nix #15

Closed
Rizary opened this issue Mar 17, 2017 · 4 comments
Closed

Attribute 'ghc801' missing at all-packages.nix #15

Rizary opened this issue Mar 17, 2017 · 4 comments

Comments

@Rizary
Copy link

Rizary commented Mar 17, 2017

Hi @Gabriel439, thanks to your tutorial on adding dependencies, it works when i was dealing with missing them when i compile.

However, i don't know how to deal with the missing attribute, and why it happens.

I got the following error:

nix-build -A frontend release.nix
error: attribute ‘ghc801’ missing, at /nix/store/5kqp52f7p2mbhlpp8m7bs83j8wz0czw4-nixpkgs-channels-09c3d04b0e53d65f60569fc01698decff3a657a3-src/pkgs/top-level/all-packages.nix:4692:21
(use ‘--show-trace’ to show detailed location information)

here is my code;

{ compiler ? "ghcjs" }:

let
  cabal2nixResult = src: pkgs.runCommand "cabal2nixResult" {
    buildCommand = ''
      cabal2nix file://"${src}" > "$out"
    '';
    buildInputs = with pkgs; [ cabal2nix]; } "";

  sources = {
    gtk2hs = pkgs.fetchFromGitHub {
      owner = "gtk2hs";
      repo = "gtk2hs";
      rev = "eee61d84edf1dd44f8d380d7d7cae2405de50124";
      sha256 = "12i53grimni0dyjqjydl120z5amcn668w4pfhl8dxscjh4a0l5nb";
    };
  };

  config = rec {
    allowUnfree = true;
    allowBroken = true;
    packageOverrides = pkgs: with pkgs.haskell.lib; rec {
      haskell.packages.${compiler} = pkgs.haskell.packages.${compiler}.override {
        overrides = self: super: rec {

          gtk2hs-buildtools = self.callPackage (cabal2nixResult "${sources.gtk2hs}/tools") {};

          semigroups = pkgs.haskell.lib.addBuildDepends
                         super.semigroups (with self; [
			   hashable
			   tagged
			   text
			   unordered-containers
			 ]);

          tasty-ant-xml = self.callPackage ./tasty-ant-xml.nix {};          
	  
          frontend = self.callPackage ./default.nix {};
	 
          reflex   = self.callPackage ./reflex {};

          reflex-dom = self.callPackage ./reflex-dom {};
	};
      };
    };
    permittedInsecurePackages = [ "webkitgtk-2.4.11" ];
  };

  pkgs = import ./nixpkgs { inherit config; };

in
  { frontend = pkgs.haskell.packages.${compiler}.frontend; }
@Rizary
Copy link
Author

Rizary commented Mar 18, 2017

After I read a while and discuss with others, i came with question, does this is because the "packageOverrides" which override my entire config, and let only ghcjs that can be use?

How can we manage to only override specific packages then?

@Gabriella439
Copy link
Owner

Check the file/line/column that the error message points to:

/nix/store/5kqp52f7p2mbhlpp8m7bs83j8wz0czw4-nixpkgs-channels-09c3d04b0e53d65f60569fc01698decff3a657a3-src/pkgs/top-level/all-packages.nix:4692:21

What do you find on line 4692 of that file?

@Rizary
Copy link
Author

Rizary commented Mar 18, 2017

Yeah, i've looked at that and got the following:

  haskellPackages = haskell.packages.ghc801.override {
    overrides = config.haskellPackageOverrides or (self: super: {});
  };

That is when i think that in my line of code here :


haskell.packages.${compiler} = pkgs.haskell.packages.${compiler}.override {
        overrides = self: super: rec {...

is overriding the config on haskellPackages.. (i'm not sure though)..

@Gabriella439
Copy link
Owner

Gabriella439 commented Mar 18, 2017

@Rizary: Yes, that's correct. This means that there is a mistake in my tutorial. The fix should be to do something like this:

haskell = pkgs.haskell // {
  packages = pkgs.haskell.packages // {
    "${compiler}" = pkgs.haskell.packages."${compiler}".override {
      ...
    };
  };
};

I will also fix the tutorial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants