Nixpkgs: haskellPackages.postgrest broken

Created on 20 Mar 2018  Â·  8Comments  Â·  Source: NixOS/nixpkgs

Issue description

Some dependencies did not build due to outdated test dependencies and I fixed it in 47bbd819c78, Tests of critbit are failing for some other reason, though, and even if I disable them, postgrest will not build due to outdated dependencies. Jailbreaking does not help – the version bounds seem to be there for a reason.

nixpkgs 47bbd819c78b6966165b5a35050191e5700e8460

bug haskell

Most helpful comment

After tinkering around a bit I got the new 0.6.0 version working, which is not yet released on hackage. Here's a file to build it:

let

  overlay = self: super: let hlib = super.haskell.lib; in {
    haskellPackages = super.haskellPackages.override (old: {
      overrides = super.lib.composeExtensions (old.overrides or (self: super: {})) (hself: hsuper: {
        hasql_1_4 = hlib.dontCheck hsuper.hasql_1_4;
        hasql-transaction_0_7_2 = hlib.dontCheck (hsuper.hasql-transaction_0_7_2.override {
          hasql = hself.hasql_1_4;
        });

        postgrest = hlib.dontCheck (hlib.doJailbreak (hsuper.callCabal2nix "postgrest" (pkgs.fetchFromGitHub {
          owner = "PostgREST";
          repo = "postgrest";
          rev = "v6.0.0";
          sha256 = "0qbqnpcapnqfxcrllkczi5k0hgi6sd51g0phgrh27gqs9zs5ipwx";
        }) {
          hasql-pool = hlib.unmarkBroken (hlib.dontCheck (hself.hasql-pool.override {
            hasql = hself.hasql_1_4;
          }));
          hasql = hself.hasql_1_4;
          hasql-transaction = hself.hasql-transaction_0_7_2;
        }));
      });
    });
  };

  pkgs = import (fetchTarball {
    url = "https://github.com/NixOS/nixpkgs/tarball/7ca7d3fc236c4015e0fa65d5a919a29ed4fcab21";
    sha256 = "1l8plp2bk6b2dj6lx5qkn8x7wablr7plhjsxgnsp0fvj96wflpwb";
  }) {
    overlays = [ overlay ];
  };


in pkgs.haskellPackages.postgrest

All 8 comments

I spent about 3 hours trying to build postgrest 0.4.4.0 using the latest nixpkgs and failed. It's thoroughly incompatible with current cabal/hackage, and it's not in stackage.
I decided to wait for 0.5.0.0 to come out on hackage.
In the mean time I build postgrest from an old version of nixpkgs, by nixpkgs-pinned.nix containing something like:

{ pkgs ? import <nixpkgs> {}, ...} :
let
  pinned_pkgs_path = pkgs.fetchFromGitHub {
    owner = "NixOS";
    repo = "nixpkgs";
    rev = "3fe7cddc304abb86e61a750a4f807270c7ca7825";
    sha256 = "13z9whcylsr76z3npc8v8hxalli6jz9h3jv5z4b97cli1kp9y04k";
  };
in
  import pinned_pkgs_path {}

with an appropriate rev from nixpkgs-channels 17.03 or 17.09, and using it like

(import ./nixpkgs-pinned.nix {}).haskellPackages.postgrest

I'm still getting this on 18.09:

$ nix-env -iA nixos.haskellPackages.postgrest 
installing 'postgrest-5.1.0'
these derivations will be built:
  /nix/store/30bydshlqysy97mr6zhzp4527gjk9a39-critbit-0.2.0.0.drv
  /nix/store/2yvylv19lkl6vly1fz37w9lzddy50f6n-configurator-ng-0.0.0.1.drv
  /nix/store/v0amwa74kymw74x4q7vka7wh2cya8a7n-hasql-1.3.0.3.drv
  /nix/store/97fgv05ghisw63z2qj56mp0knv0m6gf9-hasql-pool-0.5.drv
  /nix/store/d439p7cjyg31r1v8j5kz7cpnf5l53y7h-hasql-transaction-0.7.drv
  /nix/store/l7pvdzj3rvajsxzzdkyrv5drnjf2z4sz-Ranged-sets-0.3.0.drv
  /nix/store/691m6m16d6fvbwrgbd8zq4wnrqll03zj-postgrest-5.1.0.drv
[...]
CallStack (from HasCallStack):
  die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:958:20 in Cabal-2.2.0.1:Distribution.Simple.Configure
  configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:462:12 in Cabal-2.2.0.1:Distribution.Simple.Configure
  configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:596:20 in Cabal-2.2.0.1:Distribution.Simple
  confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.2.0.1:Distribution.Simple.UserHooks
  configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:178:19 in Cabal-2.2.0.1:Distribution.Simple
  defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:115:27 in Cabal-2.2.0.1:Distribution.Simple
  defaultMain, called at Setup.lhs:3:10 in main:Main
Setup: Encountered missing dependencies:
base >=4 && <4.11

builder for '/nix/store/30bydshlqysy97mr6zhzp4527gjk9a39-critbit-0.2.0.0.drv' failed with exit code 1
cannot build derivation '/nix/store/2yvylv19lkl6vly1fz37w9lzddy50f6n-configurator-ng-0.0.0.1.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/691m6m16d6fvbwrgbd8zq4wnrqll03zj-postgrest-5.1.0.drv': 1 dependencies couldn't be built
error: build of '/nix/store/691m6m16d6fvbwrgbd8zq4wnrqll03zj-postgrest-5.1.0.drv' failed

Attempted the pinned solution by @brainrape but getting:

Configuring postgrest-0.4.3.0...
Setup: Encountered missing dependencies:
protolude >=0.2

Revisited this today, still broken on the channel but was able to pin as originally suggested:

(import (fetchTarball {
  url = "https://github.com/nixos/nixpkgs/archive/aea148274b531f0a0cfe66dabb74bb2f22d3d83d.tar.gz";
  sha256 = "1mfab58i8v9xbnshb0y3hi37m45g8pxm0465vm7dq0fykf71w6mc";
}) {}).haskellPackages.postgrest

I took the rev of a working Hydra build: https://hydra.nixos.org/build/62868373

Further to this setting up a shell with postgrest looks like:

{ pkgs ? import <nixpkgs> {} }:
let
  postgrest = (import (fetchTarball {
    url = "https://github.com/nixos/nixpkgs/archive/aea148274b531f0a0cfe66dabb74bb2f22d3d83d.tar.gz";
    sha256 = "1mfab58i8v9xbnshb0y3hi37m45g8pxm0465vm7dq0fykf71w6mc";
  }) {}).haskellPackages.postgrest;
in
pkgs.mkShell {
  buildInputs = [ postgrest ];
  shellHook = ''
    export PATH="${postgrest}/bin:$PATH"
  '';
}

Then just nix-shell in and the postgrest command should be available (in PATH)

After tinkering around a bit I got the new 0.6.0 version working, which is not yet released on hackage. Here's a file to build it:

let

  overlay = self: super: let hlib = super.haskell.lib; in {
    haskellPackages = super.haskellPackages.override (old: {
      overrides = super.lib.composeExtensions (old.overrides or (self: super: {})) (hself: hsuper: {
        hasql_1_4 = hlib.dontCheck hsuper.hasql_1_4;
        hasql-transaction_0_7_2 = hlib.dontCheck (hsuper.hasql-transaction_0_7_2.override {
          hasql = hself.hasql_1_4;
        });

        postgrest = hlib.dontCheck (hlib.doJailbreak (hsuper.callCabal2nix "postgrest" (pkgs.fetchFromGitHub {
          owner = "PostgREST";
          repo = "postgrest";
          rev = "v6.0.0";
          sha256 = "0qbqnpcapnqfxcrllkczi5k0hgi6sd51g0phgrh27gqs9zs5ipwx";
        }) {
          hasql-pool = hlib.unmarkBroken (hlib.dontCheck (hself.hasql-pool.override {
            hasql = hself.hasql_1_4;
          }));
          hasql = hself.hasql_1_4;
          hasql-transaction = hself.hasql-transaction_0_7_2;
        }));
      });
    });
  };

  pkgs = import (fetchTarball {
    url = "https://github.com/NixOS/nixpkgs/tarball/7ca7d3fc236c4015e0fa65d5a919a29ed4fcab21";
    sha256 = "1l8plp2bk6b2dj6lx5qkn8x7wablr7plhjsxgnsp0fvj96wflpwb";
  }) {
    overlays = [ overlay ];
  };


in pkgs.haskellPackages.postgrest

@Infinisil Thanks!

It seems this could be closed, as duplicate of #81801 if nothing else.

Closing in favour of #81801 as it comes with resolution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lverns picture lverns  Â·  3Comments

matthiasbeyer picture matthiasbeyer  Â·  3Comments

domenkozar picture domenkozar  Â·  3Comments

chris-martin picture chris-martin  Â·  3Comments

ghost picture ghost  Â·  3Comments