| 25 Sep 2025 |
bglgwyng | The package overrides other than random works well | 08:53:22 |
bglgwyng | * 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 | I 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 | 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 |
sterni | 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 |
sterni | 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 |
sterni | 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 |
sterni | or do you mean something else by "not affected by"? | 11:01:07 |
bglgwyng | No. your understanding is correct | 11:02:43 |