Nixpkgs: haskellPackages.brittany fails to build

Created on 24 Jan 2019  路  6Comments  路  Source: NixOS/nixpkgs

Issue description

haskellPackages.brittany fails to build https://github.com/lspitzner/brittany

Setup: Encountered missing dependencies:
hspec >=2 && <2.6

Steps to reproduce

nix-env -f "" -iA haskellPackages.brittany

Technical details

 - system: `"x86_64-linux"`
 - host os: `Linux 4.20.3, NixOS, 19.03pre167225.1b3affcbaa8 (Koi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.2`
 - channels(root): `"nixos-19.03pre167225.1b3affcbaa8"`
 - channels(aria): `"home-manager"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Most helpful comment

I just pushed a fix to haskell-updates which fixes the build. The working build should be available soon in the unstable channels (after haskell-updates has been merged to master and the hydra evaluation succeeded).

All 6 comments

Jailbreaking brittany and ministat allows the current master of brittany to compile and it appears to be working at first glance. IMO this is just a workaround, a proper fix would be to change/fix the dependency boundaries upstream.

# ~/.config/nixpkgs/overlays/haskell-brittany.nix
self: pkgs:

let
  doJailbreak = pkgs.haskell.lib.doJailbreak;
in {
  haskell = pkgs.haskell // {
    packages = pkgs.haskell.packages // {
      ghc863 = pkgs.haskell.packages.ghc863.override (oldArgs: {
        overrides = self.lib.composeExtensions (oldArgs.overrides or (_: _: {}))
          (self: super: {

            brittany = doJailbreak (self.callCabal2nix "brittany"
              (pkgs.fetchFromGitHub {
                owner  = "lspitzner";
                repo   = "brittany";
                rev    = "6c187da8f8166d595f36d6aaf419370283b3d1e9";
                sha256 = "0nmnxprbwws3w1sh63p80qj09rkrgn9888g7iim5p8611qyhdgky";
                }) {});

            multistate = doJailbreak super.multistate;

          });
      });
    };
  };

  haskellPackages = self.haskell.packages.ghc863;
}
 - system: `"x86_64-linux"`
 - host os: `Linux 4.19.16, NixOS, 19.03pre166987.bc41317e243 (Koi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.2`
 - channels(dkellner): `"unstable-19.03pre166987.bc41317e243"`
 - channels(root): `"nixos-19.03pre166987.bc41317e243"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Edit: Use composeExtensions, see #44718.

I'm also affected by this upon trying to upgrade to 19.03. @dkellner you mentioned fixing the boundaries upstream. Am I understanding correctly that you mean version bounds in brittany's cabal file? I'm game for trying to help but my enthusiasm outweighs my expertise here.

Another workaround for those caught upgrading is as follows:

{ config, pkgs, ... }:

let
  oldTarball = fetchTarball https://nixos.org/channels/nixos-18.09/nixexprs.tar.xz;
in

{
  # Setup nixpkgs
  nixpkgs.config = {
    allowUnfree = true;
    firefox = {
      enableGnomeExtensions = true;
    };
    packageOverrides = pkgs: {
      old = import oldTarball {
        config = config.nixpkgs.config;
      };
    };
  };

  # List packages installed in system profile. To search by name, run:
  # $ nix-env -qaP | grep wget
  environment.systemPackages = with pkgs; [
    cabal2nix
    chrome-gnome-shell
    chromium
    firefox
    fish
    ghostscript
    gimp
    git
    gnupg
    inkscape
    keepass
    krita
    mimeo
    msmtp
    nixops
    nix-prefetch-git
    notmuch
    offlineimap
    pass
    python37Full
    scribusUnstable
    stockfish
    unzip
    zeal

    # Haskell packages
    cabal-install
    ghc
    old.haskellPackages.brittany
    haskellPackages.hakyll
    hlint
  ];
}

@garry-cairns Yes, with upstream I meant Brittany itself.

Can this be reported to brittany upstream?

I just pushed a fix to haskell-updates which fixes the build. The working build should be available soon in the unstable channels (after haskell-updates has been merged to master and the hydra evaluation succeeded).

Lovely. Thank-you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

retrry picture retrry  路  3Comments

teto picture teto  路  3Comments

copumpkin picture copumpkin  路  3Comments

grahamc picture grahamc  路  3Comments

copumpkin picture copumpkin  路  3Comments