I would like to test my Haskell library with different versions of its dependencies using continuous integration. Is there an easy way to accomplish this with Hydra (http://nixos.org/hydra)?
One solution would be to override the versions of the dependencies of interest and use Nixpkgs versions for the other dependencies. However, I can't figure out how to override one Haskell package version while ensuring that all other Haskell packages are called with the overridden package.
Here is a simplification of my attempt to override a Haskell dependency in release.nix
. The referenced Nix expressions were created with cabal2nix. The build depends on json-assertions, which depends on aeson, which depends on mtl. Since aeson is not called with the overridden mtl, the expression specifies two versions of mtl. The two versions of mtl cause the build to fail.
let pkgs = import <nixpkgs> {};
in {
example = pkgs.haskellPackages.cabal.mkDerivation (self: {
pname = "example";
version = "0.1.0.0";
isExecutable = true;
src = ./.;
buildDepends = [ (pkgs.haskellPackages.ghcWithPackages (self:
[ self.cabalInstall_1_18_0_3
(self.callPackage (import ./mtl_2_2.nix) {
transformers = self.callPackage (import ./transformers_0_4_2_0.nix) {};
})
(self.callPackage (import ./jsonAssertions_1_0_4.nix) {})
]))
];
});
}
Another solution would be to use publicly available Nix expressions for compatible sets of Haskell packages other than the ones in Nixpkgs. I have not found any, though.
Are there any projects online that use Hydra to test a Haskell package against multiple versions of its dependencies that I could use as an example?