Hi,
I tried to upgrade ghc in a Haskell program. Usually such operation requires to override many transitive dependencies with custom forks. Until now transitive dependency override was working fine in nix, but today I definitely notice the difference.
error: hash mismatch in fixed-output derivation ‘/nix/store/fy8gkfsdv0jlp8mlbgj823sjfp7xzkg8-indexed-traversable-0.1.4-r1.cabal.drv’:
specified: sha256-Gpc9IkFqzUrnqQjqpE6PaxNs2oZUg/uk6UOMWiRdgbQ=
got: sha256-QtnoSmWgwXwkgjPKuYrahy/2FA36JNEJ1usoUgTQfn0=
error: Cannot build ‘/nix/store/qmjyzl9mnkyg7izisp10flr2g3xk2k2k-indexed-traversable-0.1.4.drv’.
Reason: 1 dependency failed.
Output paths:
/nix/store/6qhgpbvxbd7fckvfw914q5jm66vr3mqq-indexed-traversable-0.1.4-doc
/nix/store/a6yvldd1g08xp1v6zx8wmi7s6f1ylw8g-indexed-traversable-0.1.4
error: Cannot build ‘/nix/store/rczyv0amr0kr99jvljxl0zpdv6w3bj38-aeson-2.2.4.0.drv’.
Reason: 1 dependency failed.
Output paths:
/nix/store/bg1hksapkkz8n0f5xm8mfgfb34gf1ra1-aeson-2.2.4.0-doc
/nix/store/dw87p71svyh72ba0rrpvhj9hya6ayjq0-aeson-2.2.4.0
I even tried to switch to flake but the issue persist.
As far as I understand the error I cannot override depB without overriding depA:
myApp → depA → depB → depC
I would like to disable the check at least in development because height of dependency tree can be tall. DepA might not require any work because it works with new ghc and their dependency constraints are very loose.
nix build –impure does not make difference.
{
description = "d";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
haskellPackagesO = pkgs.haskell.packages.ghc9141; # ghc9122;
haskellPackages = haskellPackagesO.override {
overrides = final: prev: {
inspection-testing = final.callHackageDirect
{ pkg = "inspection-testing";
ver = "0.6.3";
sha256 = "sha256-2ikcQuEzc9Bcz6lMIIQPPn2n+aSJAk/QXLUDAQ9S5ko=";
} {};
tagged = final.callCabal2nix
"tagged"
(fetchTarball { url = "https://github.com/ekmett/tagged/archive/refs/heads/master.zip";
sha256 = "0z96a1861n4fdsjigziqgnj5j8wap1xjj8ganhni37dqqknzkcix"; })
{};
assoc = final.callCabal2nix
"assoc"
(fetchTarball { url = "https://github.com/haskellari/assoc/archive/refs/heads/master.zip";
sha256 = "114aybk3cpwa68kr6hndqj5cisfzq3gnsjibqxplib08mjqnl024"; })
{};
generically = final.callCabal2nix
"genericall"
(fetchTarball { url = "https://github.com/haskell-compat/generically/archive/refs/heads/master.zip";
sha256 = "0xmsq2z8a3qw63d7hnqfw5wqvwrm81ipzpnpmc5y18ry6z7llz2k"; })
{};
indexed-traversable = final.callCabal2nix
"indexed-traversable"
"${fetchTarball { url = "https://github.com/yaitskov/indexed-traversable/archive/refs/heads/master.zip";
sha256 = "09a9asi8jil284a1vk2lw8b9ciz2jx45is96hmp68m4qqjppbc50"; }}/indexed-traversable"
{};
aeson = final.callCabal2nix
"aeson"
(fetchTarball { url = "https://github.com/yaitskov/aeson/archive/refs/heads/master.zip";
sha256 = "0j9ha2vq54qc4b2m87w4jkzljz83zqcby0nck5gw4sh4z1j7psxs"; })
{};
};
};
jailbreakUnbreak = pkg:
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
packageName = "foo";
in {
packages.${packageName} = haskellPackages.callCabal2nix packageName self rec {};
packages.default = self.packages.${system}.${packageName};
defaultPackage = self.packages.${system}.default;
});
}