Build Haskell package with boot package override

Hello,

I’d like to build a Haskell package that depends on a certain version of process. However, I can’t swap out the version of process naively, because it is a boot library.
I have tried to override it in the Haskell package set, and the boot package set used to build ghc in such Haskell package set, to no avail.

Every build results in some dependency failing with the following error:

doctest> Warning:
doctest>     This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure.
doctest>       package ghc (ghc-9.10.3-6fa2) requires process-1.6.26.1-9930
doctest>       package hspec-core (hspec-core-2.11.17-FTXg3GcX5G73rkBi8I9oNE) requires process-1.6.28.0-3rKWCyqU0lBBNctUv5wGYh
doctest>       package doctest (doctest-0.24.3) requires process-1.6.28.0-3rKWCyqU0lBBNctUv5wGYh

What I find the most confusing, is that with the same ghc coming from nixpkgs, I was able to build this package with cabal imperatively (read: outside of nix) just fine. Cabal picked process-1.6.30.0, and there was no “ghc uses such version so aborting” error message like above.
Also, I have built ghc from scratch with a boot package set where process is set to the version I need. I do not understand the cause of this error.

Is this due to some internal limitation of how nixpkgs is written, or am I using the overrides wrong some how? I appreciate greatly any help here :slight_smile:

The package I try to build (in the .package abstraction for callPackage) can be found below. I used nixpkgs at https://releases.nixos.org/nixos/26.05/nixos-26.05.3250.4062d36ebeae/nixexprs.tar.xz for my tests.

{
  haskell,
  haskellPackages,
  fetchFromGitHub,
}:
let
  bootPkgsOverride = final: prev: {
    process = prev.process_1_6_28_0;
  };

  haskellPackages' = haskellPackages.override {
    overrides =
      final: prev:
      bootPkgsOverride final prev
      // {
        ghc = prev.ghc.override { bootPkgs = haskellPackages // bootPkgsOverride final prev; };
      };
  };
in
let
  inherit (haskell.lib.compose) justStaticExecutables doJailbreak;

  drv = haskellPackages'.callCabal2nix "vibecode-scanner" (fetchFromGitHub {
    owner = "hasufell";
    repo = "vibecode-scanner";
    rev = "77270a2547fd9646b37c0ecbbe5d70a1e44af163";
    hash = "sha256-tIpNiEOyxr37Jk+H/pWiYqZFwm77808lDeKo+wv031I=";
  }) { };
in
# doJailbreak
(justStaticExecutables drv)