Skip to content

Instantly share code, notes, and snippets.

@4e6
Last active December 16, 2018 16:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4e6/fb9749f4cc439086da0667ec0a892f3d to your computer and use it in GitHub Desktop.
Save 4e6/fb9749f4cc439086da0667ec0a892f3d to your computer and use it in GitHub Desktop.
The result of running stackage2nix on stack git repo
# Generated by stackage2nix 0.7.0 from "./stack.yaml"
{ _nixpkgs ? import <nixpkgs> {} }:
let
stackageOverlay = builtins.fetchGit {
url = "https://github.com/typeable/nixpkgs-stackage.git";
rev = "0852a4b5097c576a4d42a6cd1fdb9e1746a85e3e";
};
nixpkgs = import <nixpkgs> {
overlays = [ (import stackageOverlay) ];
};
overrides = self: super: {
mkDerivation = args: super.mkDerivation (args // {
doCheck = false;
doHaddock = false;
});
};
stackPackages =
{ pkgs, stdenv, callPackage }:
self: {
"stack" = callPackage
({ mkDerivation, aeson, annotated-wl-pprint, ansi-terminal, async
, attoparsec, base, base64-bytestring, bindings-uname, bytestring
, Cabal, conduit, conduit-extra, containers, cryptonite
, cryptonite-conduit, deepseq, directory, echo, exceptions, extra
, file-embed, filelock, filepath, fsnotify, generic-deriving
, githash, hackage-security, hashable, hpack, hpc, hspec
, http-client, http-client-tls, http-conduit, http-types, memory
, microlens, mintty, monad-logger, mono-traversable, mtl, mustache
, neat-interpolation, network-uri, open-browser
, optparse-applicative, optparse-simple, path, path-io, persistent
, persistent-sqlite, persistent-template, pretty, primitive
, process, project-template, QuickCheck, regex-applicative-text
, resourcet, retry, rio, semigroups, smallcheck, split, stm, store
, store-core, streaming-commons, tar, template-haskell, temporary
, text, text-metrics, th-reify-many, time, tls, transformers
, typed-process, unicode-transforms, unix, unix-compat, unliftio
, unordered-containers, vector, yaml, zip-archive, zlib
}:
mkDerivation {
pname = "stack";
version = "1.8.0";
src = pkgs.fetchgit {
url = "https://github.com/commercialhaskell/stack.git";
rev = "bcbfb1e90d1470ed6b9748b79e1655c52fc65b88";
sha256 = "1ibrhx0c7v1zg61n9900d404mcm3d38058zyk3pq43rxxfn3jpdf";
};
enableSharedExecutables = false;
isLibrary = true;
isExecutable = true;
setupHaskellDepends = [ base Cabal filepath ];
libraryHaskellDepends = [
aeson annotated-wl-pprint ansi-terminal async attoparsec base
base64-bytestring bindings-uname bytestring Cabal conduit
conduit-extra containers cryptonite cryptonite-conduit deepseq
directory echo exceptions extra file-embed filelock filepath
fsnotify generic-deriving hackage-security hashable hpack hpc
http-client http-client-tls http-conduit http-types memory
microlens mintty monad-logger mono-traversable mtl mustache
neat-interpolation network-uri open-browser optparse-applicative
path path-io persistent persistent-sqlite persistent-template
pretty primitive process project-template regex-applicative-text
resourcet retry rio semigroups split stm store store-core
streaming-commons tar template-haskell temporary text text-metrics
th-reify-many time tls transformers typed-process
unicode-transforms unix unix-compat unliftio unordered-containers
vector yaml zip-archive zlib
];
executableHaskellDepends = [
aeson annotated-wl-pprint ansi-terminal async attoparsec base
base64-bytestring bindings-uname bytestring Cabal conduit
conduit-extra containers cryptonite cryptonite-conduit deepseq
directory echo exceptions extra file-embed filelock filepath
fsnotify generic-deriving githash hackage-security hashable hpack
hpc http-client http-client-tls http-conduit http-types memory
microlens mintty monad-logger mono-traversable mtl mustache
neat-interpolation network-uri open-browser optparse-applicative
optparse-simple path path-io persistent persistent-sqlite
persistent-template pretty primitive process project-template
regex-applicative-text resourcet retry rio semigroups split stm
store store-core streaming-commons tar template-haskell temporary
text text-metrics th-reify-many time tls transformers typed-process
unicode-transforms unix unix-compat unliftio unordered-containers
vector yaml zip-archive zlib
];
testHaskellDepends = [
aeson annotated-wl-pprint ansi-terminal async attoparsec base
base64-bytestring bindings-uname bytestring Cabal conduit
conduit-extra containers cryptonite cryptonite-conduit deepseq
directory echo exceptions extra file-embed filelock filepath
fsnotify generic-deriving hackage-security hashable hpack hpc hspec
http-client http-client-tls http-conduit http-types memory
microlens mintty monad-logger mono-traversable mtl mustache
neat-interpolation network-uri open-browser optparse-applicative
path path-io persistent persistent-sqlite persistent-template
pretty primitive process project-template QuickCheck
regex-applicative-text resourcet retry rio semigroups smallcheck
split stm store store-core streaming-commons tar template-haskell
temporary text text-metrics th-reify-many time tls transformers
typed-process unicode-transforms unix unix-compat unliftio
unordered-containers vector yaml zip-archive zlib
];
doHaddock = false;
doCheck = false;
preCheck = "export HOME=$TMPDIR";
postInstall = ''
exe=$out/bin/stack
mkdir -p $out/share/bash-completion/completions
$exe --bash-completion-script $exe >$out/share/bash-completion/completions/stack
'';
preConfigure = "hpack";
configureFlags = [ "-fdisable-git-info" ];
homepage = "http://haskellstack.org";
description = "The Haskell Tool Stack";
license = stdenv.lib.licenses.bsd3;
}) {};
"rio" = callPackage
({ mkDerivation, base, bytestring, containers, deepseq, directory
, exceptions, filepath, hashable, hspec, microlens, mtl, primitive
, process, text, time, typed-process, unix, unliftio
, unordered-containers, vector
}:
mkDerivation {
pname = "rio";
version = "0.1.1.0";
sha256 = "ba812fdc3b0b8249b443c4dc785716cfaefec099e1c37d587f04b35eda422757";
libraryHaskellDepends = [
base bytestring containers deepseq directory exceptions filepath
hashable microlens mtl primitive process text time typed-process
unix unliftio unordered-containers vector
];
testHaskellDepends = [
base bytestring containers deepseq directory exceptions filepath
hashable hspec microlens mtl primitive process text time
typed-process unix unliftio unordered-containers vector
];
doHaddock = false;
doCheck = false;
homepage = "https://github.com/commercialhaskell/rio#readme";
description = "A standard library for Haskell";
license = stdenv.lib.licenses.mit;
}) {};
"Cabal" = callPackage
({ mkDerivation, array, base, base-compat, base-orphans, binary
, bytestring, containers, deepseq, Diff, directory, filepath
, integer-logarithms, mtl, optparse-applicative, parsec, pretty
, process, QuickCheck, tagged, tar, tasty, tasty-golden
, tasty-hunit, tasty-quickcheck, text, time, transformers
, tree-diff, unix
}:
mkDerivation {
pname = "Cabal";
version = "2.2.0.1";
sha256 = "02b5301304df73cea3c7d544b5026b228141dc3ac1d5b08c9a206f99aa330a7b";
libraryHaskellDepends = [
array base binary bytestring containers deepseq directory filepath
mtl parsec pretty process text time transformers unix
];
testHaskellDepends = [
array base base-compat base-orphans bytestring containers deepseq
Diff directory filepath integer-logarithms optparse-applicative
pretty process QuickCheck tagged tar tasty tasty-golden tasty-hunit
tasty-quickcheck text tree-diff
];
doHaddock = false;
doCheck = false;
homepage = "http://www.haskell.org/cabal/";
description = "A framework for packaging Haskell software";
license = stdenv.lib.licenses.bsd3;
}) {};
"hpack" = callPackage
({ mkDerivation, aeson, base, bifunctors, bytestring, Cabal
, containers, cryptonite, deepseq, directory, filepath, Glob, hspec
, http-client, http-client-tls, http-types, HUnit, interpolate
, mockery, pretty, QuickCheck, scientific, template-haskell
, temporary, text, transformers, unordered-containers, vector, yaml
}:
mkDerivation {
pname = "hpack";
version = "0.28.2";
sha256 = "b9601332bbac2f042947be1f7478ed0c72367e4caa211b779a75dc26cd8180a3";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson base bifunctors bytestring Cabal containers cryptonite
deepseq directory filepath Glob http-client http-client-tls
http-types pretty scientific text transformers unordered-containers
vector yaml
];
executableHaskellDepends = [
aeson base bifunctors bytestring Cabal containers cryptonite
deepseq directory filepath Glob http-client http-client-tls
http-types pretty scientific text transformers unordered-containers
vector yaml
];
testHaskellDepends = [
aeson base bifunctors bytestring Cabal containers cryptonite
deepseq directory filepath Glob hspec http-client http-client-tls
http-types HUnit interpolate mockery pretty QuickCheck scientific
template-haskell temporary text transformers unordered-containers
vector yaml
];
doHaddock = false;
doCheck = false;
homepage = "https://github.com/sol/hpack#readme";
description = "An alternative format for Haskell packages";
license = stdenv.lib.licenses.mit;
}) {};
"http-api-data" = callPackage
({ mkDerivation, attoparsec, attoparsec-iso8601, base, bytestring
, Cabal, cabal-doctest, containers, directory, doctest, filepath
, hashable, hspec, hspec-discover, http-types, HUnit, QuickCheck
, quickcheck-instances, text, time, time-locale-compat
, unordered-containers, uri-bytestring, uuid-types
}:
mkDerivation {
pname = "http-api-data";
version = "0.3.8.1";
sha256 = "6eeaba4b29a00407cb20b865825b17b8d884c26b09c5bbe7b6e673b4522106b3";
setupHaskellDepends = [ base Cabal cabal-doctest ];
libraryHaskellDepends = [
attoparsec attoparsec-iso8601 base bytestring containers hashable
http-types text time time-locale-compat unordered-containers
uri-bytestring uuid-types
];
testHaskellDepends = [
base bytestring directory doctest filepath hspec HUnit QuickCheck
quickcheck-instances text time unordered-containers uuid-types
];
testToolDepends = [ hspec-discover ];
doHaddock = false;
doCheck = false;
homepage = "http://github.com/fizruk/http-api-data";
description = "Converting to/from HTTP API data like URL pieces, headers and query parameters";
license = stdenv.lib.licenses.bsd3;
}) {};
"githash" = callPackage
({ mkDerivation, base, bytestring, directory, filepath, hspec
, process, template-haskell, temporary
}:
mkDerivation {
pname = "githash";
version = "0.1.0.0";
sha256 = "91b1a908149da4a3852c7c33baec8314d6089bcaa756d544dd33b2edd70c6ea0";
libraryHaskellDepends = [
base bytestring directory filepath process template-haskell
];
testHaskellDepends = [
base bytestring directory filepath hspec process template-haskell
temporary
];
doHaddock = false;
doCheck = false;
homepage = "https://github.com/snoyberg/githash#readme";
description = "Compile git revision info into Haskell projects";
license = stdenv.lib.licenses.bsd3;
}) {};
"persistent" = callPackage
({ mkDerivation, aeson, attoparsec, base, base64-bytestring
, blaze-html, blaze-markup, bytestring, conduit, containers
, exceptions, fast-logger, hspec, http-api-data, lifted-base
, monad-control, monad-logger, mtl, old-locale, path-pieces
, resource-pool, resourcet, scientific, silently, tagged
, template-haskell, text, time, transformers, transformers-base
, unordered-containers, vector
}:
mkDerivation {
pname = "persistent";
version = "2.7.1";
sha256 = "c2896ef228486c02c08b8594c9eccef8ca246291c4f16eff538fef9dc332391d";
revision = "1";
editedCabalFile = "0ag2fd1iaiwiviskr5qzhgq7a0vr5x7vjq9zi75j25lahrqxxfm1";
libraryHaskellDepends = [
aeson attoparsec base base64-bytestring blaze-html blaze-markup
bytestring conduit containers exceptions fast-logger http-api-data
lifted-base monad-control monad-logger mtl old-locale path-pieces
resource-pool resourcet scientific silently tagged template-haskell
text time transformers transformers-base unordered-containers
vector
];
testHaskellDepends = [
aeson attoparsec base base64-bytestring blaze-html bytestring
conduit containers fast-logger hspec http-api-data lifted-base
monad-control monad-logger mtl old-locale path-pieces resource-pool
resourcet scientific tagged template-haskell text time transformers
unordered-containers vector
];
doHaddock = false;
doCheck = false;
homepage = "http://www.yesodweb.com/book/persistent";
description = "Type-safe, multi-backend data serialization";
license = stdenv.lib.licenses.mit;
}) {};
"persistent-sqlite" = callPackage
({ mkDerivation, aeson, base, bytestring, conduit, containers
, hspec, microlens-th, monad-control, monad-logger, old-locale
, persistent, persistent-template, resource-pool, resourcet
, temporary, text, time, transformers, unordered-containers
}:
mkDerivation {
pname = "persistent-sqlite";
version = "2.6.4";
sha256 = "75e5dbd330337e6e60346f309457f56deabb4260bd53391962de2f085416ac9a";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson base bytestring conduit containers microlens-th monad-control
monad-logger old-locale persistent resource-pool resourcet text
time transformers unordered-containers
];
executableHaskellDepends = [ base monad-logger ];
testHaskellDepends = [
base hspec persistent persistent-template temporary text time
transformers
];
doHaddock = false;
doCheck = false;
homepage = "http://www.yesodweb.com/book/persistent";
description = "Backend for the persistent library using sqlite3";
license = stdenv.lib.licenses.mit;
}) {};
"resourcet" = callPackage
({ mkDerivation, base, containers, exceptions, hspec, lifted-base
, mmorph, monad-control, mtl, transformers, transformers-base
, transformers-compat, unliftio-core
}:
mkDerivation {
pname = "resourcet";
version = "1.1.11";
sha256 = "346ed5c3eca87e1b2df5ca97419bd896e27ad39d997b8eea5b62f67c98a824d9";
revision = "1";
editedCabalFile = "09sgrzaaishx645hrfflxckyaq0dwk22agjf4sz8nwjafyv3ssh9";
libraryHaskellDepends = [
base containers exceptions lifted-base mmorph monad-control mtl
transformers transformers-base transformers-compat unliftio-core
];
testHaskellDepends = [ base hspec lifted-base transformers ];
doHaddock = false;
doCheck = false;
homepage = "http://github.com/snoyberg/conduit";
description = "Deterministic allocation and freeing of scarce resources";
license = stdenv.lib.licenses.bsd3;
}) {};
"conduit" = callPackage
({ mkDerivation, base, containers, criterion, deepseq, exceptions
, hspec, kan-extensions, lifted-base, mmorph, monad-control, mtl
, mwc-random, primitive, QuickCheck, resourcet, safe, split
, transformers, transformers-base, transformers-compat, vector
}:
mkDerivation {
pname = "conduit";
version = "1.2.13";
sha256 = "239d1bac614bc1085315ad8d15275471fc7c0eaef05950429d40a65bd73711ac";
libraryHaskellDepends = [
base exceptions lifted-base mmorph monad-control mtl primitive
resourcet transformers transformers-base transformers-compat
];
testHaskellDepends = [
base containers exceptions hspec mtl QuickCheck resourcet safe
split transformers
];
benchmarkHaskellDepends = [
base containers criterion deepseq hspec kan-extensions mwc-random
transformers vector
];
doHaddock = false;
doCheck = false;
homepage = "http://github.com/snoyberg/conduit";
description = "Streaming data processing library";
license = stdenv.lib.licenses.mit;
}) {};
"conduit-extra" = callPackage
({ mkDerivation, async, attoparsec, base, blaze-builder, bytestring
, bytestring-builder, conduit, criterion, directory, exceptions
, filepath, hspec, monad-control, network, primitive, process
, QuickCheck, resourcet, stm, streaming-commons, text, transformers
, transformers-base, typed-process, unliftio-core
}:
mkDerivation {
pname = "conduit-extra";
version = "1.2.3.2";
sha256 = "1d5b66284703a4b9fb96a4c6a2213727208639871a675da9755e9a963fa230f6";
revision = "1";
editedCabalFile = "10smqv7xrjj5vhpdfj9ha89dm8nw04cv09avg58c6y8yybbz5i01";
libraryHaskellDepends = [
async attoparsec base blaze-builder bytestring conduit directory
exceptions filepath monad-control network primitive process
resourcet stm streaming-commons text transformers transformers-base
typed-process unliftio-core
];
testHaskellDepends = [
async attoparsec base blaze-builder bytestring bytestring-builder
conduit directory exceptions hspec process QuickCheck resourcet stm
streaming-commons text transformers transformers-base
];
benchmarkHaskellDepends = [
base blaze-builder bytestring bytestring-builder conduit criterion
transformers
];
doHaddock = false;
doCheck = false;
homepage = "http://github.com/snoyberg/conduit";
description = "Batteries included conduit: adapters for common libraries";
license = stdenv.lib.licenses.mit;
}) {};
"ansi-terminal" = callPackage
({ mkDerivation, base, colour }:
mkDerivation {
pname = "ansi-terminal";
version = "0.8.0.4";
sha256 = "eb3cb8b0d0ce1c67ae3146c0b73a83e640c6f049d36bd6e859b6b951117e4810";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [ base colour ];
executableHaskellDepends = [ base ];
doHaddock = false;
doCheck = false;
homepage = "https://github.com/feuerbach/ansi-terminal";
description = "Simple ANSI terminal support, with Windows compatibility";
license = stdenv.lib.licenses.bsd3;
}) {};
};
in nixpkgs.haskell.packages.stackage.lts-116.override {
packageSetConfig = self: super: stackPackages { inherit (nixpkgs) pkgs stdenv; inherit (self) callPackage; } super;
inherit overrides;
}
@georgewsinger
Copy link

Here is the error I'm getting:

Preprocessing test suite 'cryptonite-conduit-test' for cryptonite-conduit-0.2.2..
Building test suite 'cryptonite-conduit-test' for cryptonite-conduit-0.2.2..
Package has no test suites.
haddockPhase
[1 of 1] Compiling Main             ( test/Spec.hs, dist/build/cryptonite-conduit-test/cryptonite-conduit-test-tmp/Main.dyn_o )
Running hscolour for connection-0.2.8...
Preprocessing library for connection-0.2.8..

test/Spec.hs:2:1: error:
    Could not find module ‘Conduit’
    Use -v to see a list of the files searched for.
  |
2 | import Conduit
  | ^^^^^^^^^^^^^^
builder for '/nix/store/9z89kbbbn36db7qhlmjqwsji7k4d0b9h-cryptonite-conduit-0.2.2.drv' failed with exit code 1
cannot build derivation '/nix/store/pzyjbr1dkykmxjmkxwvpyj4ccsyrkssj-stack-1.8.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/d7fl3v6abj7cjqaf3dy9fd9a2m8k7w7r-system-path.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/mkiq5hcy81qnqxxqjmw3hzn4ggbsf8sr-nixos-system-NixBox-18.03.132847.aec217852f2.drv': 1 dependencies couldn't be built
error: build of '/nix/store/mkiq5hcy81qnqxxqjmw3hzn4ggbsf8sr-nixos-system-NixBox-18.03.132847.aec217852f2.drv' failed

@4e6
Copy link
Author

4e6 commented Jul 13, 2018

This is weird, cryptonite-conduit definitely has conduit dependency

https://github.com/typeable/nixpkgs-stackage/blob/53db4b166083834d6b9bccb6826ae62586b56dd3/stackage/lts-11.6/packages.nix

  "cryptonite-conduit" = callPackage
    ({ mkDerivation, base, bytestring, conduit, conduit-combinators
     , conduit-extra, cryptonite, exceptions, memory, resourcet, tasty
     , tasty-hunit, tasty-quickcheck, transformers
     }:
     mkDerivation {
       pname = "cryptonite-conduit";
       version = "0.2.2";
       sha256 = "1bldcmda4xh52mw1wfrjljv8crhw3al7v7kv1j0vidvr7ymnjpbh";
       libraryHaskellDepends = [
         base bytestring conduit conduit-extra cryptonite exceptions memory
         resourcet transformers
       ];
       testHaskellDepends = [
         base bytestring conduit conduit-combinators cryptonite memory tasty
         tasty-hunit tasty-quickcheck
       ];
       homepage = "https://github.com/haskell-crypto/cryptonite-conduit";
       description = "cryptonite conduit";
       license = stdenv.lib.licenses.bsd3;
     }) {};

I'll try to reproduce this issue tomorrow

@georgewsinger
Copy link

georgewsinger commented Jul 13, 2018

Ok thanks -- let me know if there's anything I can do to help.

@4e6
Copy link
Author

4e6 commented Jul 14, 2018

OMG, it's unbelievable. So, lts-11.6 has conduit-1.3.0.2 which exposes the Conduit module. Stack overrides it with conduit-1.2.13 which does not expose Conduit module. cryptonite-conduit doesn't have version bounds on conduit dependency. Nix tries to build it with conduit-1.2.13 and fails during tests (on the import of Conduit module).

This setup works with the stack because stack doesn't test (and haddock) the dependencies. We can replicate this behavior in nix:

overrides = self: super: {
  overrides = self: super: {
    mkDerivation = args: super.mkDerivation (args // {
      doCheck = false;
      doHaddock = false;
    });
  };
}

I've updated the gist, and was able to build the stack with:

$ nix-build default.nix -A stack
$ result/bin/stack --version
1.8.0 x86_64

@georgewsinger
Copy link

It works ! Thanks so much.

@4e6
Copy link
Author

4e6 commented Jul 14, 2018

My pleasure!

@georgewsinger
Copy link

I'm in need of something like this again for Stack 1.10. Do you know how one can generalize your solution into a script or something that can make it reproducible for all new future stack builds?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment