input-output-hk / haskell.nix

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

Simple shell.nix example against Stackage snapshot fails to build #1104

Closed thomasjm closed 3 years ago

thomasjm commented 3 years ago

I'm trying to build a simple shell containing a package, by following the instructions for an ad-hoc development shell.

My shell.nix looks like this:

{ pkgs ? import <nixpkgs> {} }:

let
  haskellNix = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/94a399540722a42d6c1ec33d1414e3dd98a2c818.tar.gz) {};
  nixpkgs = import haskellNix.sources.nixpkgs haskellNix.nixpkgsArgs;
  haskell = nixpkgs.haskell-nix;

in

nixpkgs.mkShell {
  buildInputs = [
    (haskell.snapshots."lts-17.9".ghcWithPackages (ps: with ps; [ conduit ]))
  ];
}

But unfortunately it fails to build with the message below. It seems like stm fails to build because its constraint on base can't be solved, which seems strange since everything should come from the same Stackage snapshot (?). The version info on stm's dependencies on Stackage's site doesn't match the constraints I found in the Cabal file this derivation is trying to build with, so I'm confused about what's going on...

Trying to build with aeson instead of conduit works, so it doesn't affect all packages.

building '/nix/store/a2i7m6jqbpq6l72gzkdpd4vzl05v3jk0-stm-lib-stm-2.5.0.0.drv'...
unpacking sources
unpacking source archive /nix/store/k1qkp52xaka5jailk6fxs563znmxyyn3-stm-2.5.0.0.tar.gz
source root is stm-2.5.0.0
setting SOURCE_DATE_EPOCH to timestamp 1537613225 of file stm-2.5.0.0/stm.cabal
patching sources
configuring
Configure flags:
--prefix=/nix/store/ix83iwv58xsfhqahhibwc1l4pd9dwya7-stm-lib-stm-2.5.0.0 lib:stm --package-db=clear --package-db=/nix/store/cppipzpyaa7kx2g6d9pyzgf58nkg5gc2-stm-lib-stm-2.5.0.0-config/lib/ghc-8.10.4/package.conf.d --with-ghc=ghc --with-ghc-pkg=ghc-pkg --with-hsc2hs=hsc2hs --with-gcc=cc --with-ld=ld.gold --ghc-option=-optl-fuse-ld=gold --ld-option=-fuse-ld=gold --with-ar=ar --with-strip=strip --disable-executable-stripping --disable-library-stripping --disable-library-profiling --disable-executable-profiling --enable-static --enable-shared --disable-coverage --enable-library-for-ghci --enable-split-sections
Configuring library for stm-2.5.0.0..
Warning: The flag --disable-executable-profiling is deprecated. Please use
--disable-profiling instead.
Setup: Encountered missing or private dependencies:
base >=4.3 && <4.14
thomasjm commented 3 years ago

I tracked this down to this issue: https://github.com/haskell/stm/issues/45

Going to close this since it's an upstream problem with stm.