!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

677 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://nixos.org/manual/nixpkgs/unstable/#haskell | Current PR: https://github.com/nixos/nixpkgs/pulls?q=is%3Apr+is%3Aopen+head%3Ahaskell-updates | Maintainer Docs: https://github.com/NixOS/nixpkgs/blob/haskell-updates/pkgs/development/haskell-modules/HACKING.md | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org | Merger Schedule: https://cloud.maralorn.de/apps/calendar/p/H6migHmKX7xHoTFa/dayGridMonth/now | Join #haskell.nix:libera.chat for question about the alternative haskell.nix infrastructure134 Servers

Load older messages


SenderMessageTime
25 Sep 2025
@bglgwyng:matrix.orgbglgwyng * If a package is not affected by foo-package.override { random = ... }, which means random is not overridden but remains as the one in haskellPackages, what are some things I can try to investigate further? 09:00:44
@maralorn:maralorn.demaralornI can’t think of anything straightforward. Best ideas is a) there is a second override which negates your first override b) you are mistakingly not actually passing a different random. I can think of wilder theories, but they will be even more likely to be wrong.09:30:59
@bglgwyng:matrix.orgbglgwyng

I tried overriding it at the last place like,

{ packages.hip = config.cabal-projects.default.packages.hip.override { random = config.cabal-projects.default.packages.random; }; }

but still same

09:32:13
@sternenseemann:systemli.orgsterni bglgwyng: Haskell dependencies need to be propagated, so any given package sees its transitive Haskell dependency closure. random is pretty common, so probably somewhere the non overridden random is visible. Cabal is free to pick any version within bounds. 10:58:17
@sternenseemann:systemli.orgsterni hip doesn't have bounds on random at all, so maybe it picks another version? You can force it a specific version via the --constraint configure flag, but you'll likely run into trouble with this since Haskell isn't designed for multiple versions of the same package being linked into the same end product. 10:59:55
@sternenseemann:systemli.orgsterni The only robust way of overridding a package that occurs multiple times in the dependency closure of a give package is to use overrideScope and recompiling (a large portion of) the dependency closure. 11:00:42
@sternenseemann:systemli.orgsternior do you mean something else by "not affected by"?11:01:07
@bglgwyng:matrix.orgbglgwyngNo. your understanding is correct11:02:43
@bglgwyng:matrix.orgbglgwyng I should check for it now, but I'm so sure that I override every package depends on random with the same version of random 11:03:14
@bglgwyng:matrix.orgbglgwyng So transitively depended random should be the same 11:03:37
@bglgwyng:matrix.orgbglgwyngEven if I did so, does the problem you describe can occur for some reasons?11:04:05
@bglgwyng:matrix.orgbglgwyng
Warning:
    This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure.
      package hip (hip-1.5.6.0) requires random-1.2.1.3-37JdwX1MChN5J4YOL6CRA5
      package temporary (temporary-1.3-D9AnthCRrFGJbyvBi0CXlS) requires random-1.2.1.3-wWDAMRL8k9YVWnjsPAPC
      package linear (linear-1.23.2-3JDfk2hoPGIIa6oUPVB0FE) requires random-1.2.1.3-wWDAMRL8k9YVWnjsPAPC
      package QuickCheck (QuickCheck-2.15.0.1-LDCjebZP9NmJJekAZt2vVq) requires random-1.2.1.3-wWDAMRL8k9YVWnjsPAPC
      package random (random-1.2.1.3-37JdwX1MChN5J4YOL6CRA5) requires splitmix-0.1.1-JnFxtR8Qwyw2CyoVPkB8hj
      package random (random-1.2.1.3-wWDAMRL8k9YVWnjsPAPC) requires splitmix-0.1.3.1-1AXCbj2oPlfCvSRlfGtm8v
      package QuickCheck (QuickCheck-2.15.0.1-LDCjebZP9NmJJekAZt2vVq) requires splitmix-0.1.3.1-1AXCbj2oPlfCvSRlfGtm8v

I got this message, and I override random for every package depending on it

11:11:43
@bglgwyng:matrix.orgbglgwyng Hmm... I'm reading generic-builder.nix and found ${setupCommand} register --gen-pkg-config=$packageConfFile this code 11:27:10
@bglgwyng:matrix.orgbglgwyngMaybe generic-builder doesn't explicitly passing overrided packages, but just putting them in package-db and letting cabal resolve it?11:27:36
@toonn:matrix.orgtoonn The different hashes do seem to indicate that they're different instances of the package, no? 11:37:01
@bglgwyng:matrix.orgbglgwyngYes they are different11:40:57
@bglgwyng:matrix.orgbglgwyngI wonder if generic-builder can distinguish them during build11:41:25
@maralorn:maralorn.demaralorn

bglgwyng: I am not 100% sure but from my experience: Cabal will prefer the overriden one over the default except in the following situations:

  1. Some dependency is already using the default and none the override. (i.e. the only way to get a coherent build plan.)
  2. There is a constraint which prevents usage of the overriden one.

But this is really murky and I could be wrong.

11:54:31
@sternenseemann:systemli.orgsterni bglgwyng: the issue appears to be that you are building random with different versions of splitmix in these cases 11:58:24
@sternenseemann:systemli.orgsterniso you need to make sure that the splitmix version is consistent as well11:58:33
@bglgwyng:matrix.orgbglgwyngah, I'll figure out why 2 random packages are built, but in my case, build with duplicated packages should work well since I explicitly override them by plan.json result11:59:48
@bglgwyng:matrix.orgbglgwyngI suppose that we don't have force generic-builder to use a specific package with id12:00:43
@bglgwyng:matrix.orgbglgwyng* I suppose that we don't have a way to force generic-builder to use a specific package with id12:01:26
@maralorn:maralorn.demaralornI think Setup.hs has a mode to do that. But we currently don’t use it in the generic-builder and it might be non trivial.12:02:16
@bglgwyng:matrix.orgbglgwyngThanks! but, wht does 'non trivial' mean here?12:03:04
@maralorn:maralorn.demaralornIt means, that it could be that a) if you do this you need to specify the hashes of all dependencies (and I think in that mode you disable bound checking completely) and b) it might be hard to figure out the correct hashes to inject there. Basically we would be reimplementing logic which we currently rely on from Setup.hs.12:12:26
@maralorn:maralorn.demaralornDoes not sound insurmantable.12:12:47
@maralorn:maralorn.demaralornIt might even be feasible do improve the generic-builder to enforce the usage of passed in overrides more reliably in general. That could be cool.12:13:28
@maralorn:maralorn.demaralorn* Does not sound insurmountable.12:13:43
@sternenseemann:systemli.orgsternihttps://cabal.readthedocs.io/en/stable/setup-commands.html#cmdoption-runhaskell-Setup.hs-configure-dependency15:26:31

Show newer messages


Back to Room ListRoom Version: 6