Description
Describe the bug
When index-state
or cabalProjectFile
is passed to haskell-nix.project or haskell-nix.tool, bumping the hackageSrc pin causes rebuilds because of new revisions in the new updated index.
Steps To Reproduce
I have created a repo to reproduce the issue at https://github.com/pranaysashank/haskell-nix-index-state-bug-repro . fOld
uses hackageNix with index-state 2023-12-15T23:46:08Z
and fNew
uses a newer index state which contains the revisions
- Clone the repo
nix-build -A fOld --dry-run
nix-build -A fNew --dry-run
nix-diff
the.drv
forfourmolu
in both the runs, this shows the difference is because of the presence of new revisions
nix-diff /nix/store/g5z6w89qh54lagzhnxfsmdz5hccrldvh-fourmolu-exe-fourmolu-0.14.1.0.drv /nix/store/168bjqffj01sbn2rvihbvh147ya00gcg-fourmolu-exe-fourmolu-0.14.1.0.drv
- /nix/store/g5z6w89qh54lagzhnxfsmdz5hccrldvh-fourmolu-exe-fourmolu-0.14.1.0.drv:{out}
+ /nix/store/168bjqffj01sbn2rvihbvh147ya00gcg-fourmolu-exe-fourmolu-0.14.1.0.drv:{out}
• The set of input derivation names do not match:
- fourmolu-0.14.1.0-src
+ fourmolu-0.14.1.0-r1-src
• The input derivation named `fourmolu-lib-fourmolu-0.14.1.0` differs
- /nix/store/qd04ny3s0vlahlmcgc26jmqp6whflxkl-fourmolu-lib-fourmolu-0.14.1.0.drv:{out}
+ /nix/store/707ikcvyxrw2i6c5ihjlwn9xicqn4dab-fourmolu-lib-fourmolu-0.14.1.0.drv:{out}
• The set of input derivation names do not match:
- fourmolu-0.14.1.0-src
+ fourmolu-0.14.1.0-r1-src
• The input derivation named `ghc-lib-parser-lib-ghc-lib-parser-9.8.1.20231121` differs
- /nix/store/pnsp2alwyw3va5hkbypchc2khm79pn0m-ghc-lib-parser-lib-ghc-lib-parser-9.8.1.20231121.drv:{out}
+ /nix/store/8xs9bl4qaxnr4qz2x9xw95gg93s08cll-ghc-lib-parser-lib-ghc-lib-parser-9.8.1.20231121.drv:{out}
• The input derivation named `process-lib-process-1.6.18.0` differs
- /nix/store/826ih8qw631a3xbsbvxcm5i0mcfnj4vs-process-lib-process-1.6.18.0.drv:{out}
+ /nix/store/ijh4zdk7ijys0d7hvg2hqgf6jchs87g6-process-lib-process-1.6.18.0.drv:{out}
• The environments do not match:
+ cabalFile=name: process
version: 1.6.18.0
x-revision: 1
...
Expected behavior
Providing cabalProjectFreeze
or index-state
shouldn't cause rebuilds even in presence of revisions, this reduces the number of rebuilds we have to make when we want to update a dependency by bumping hackageSrc in the project.
Additional context
it looks like @andreabedini has made recent changes w.r.t revisions and index-state (#1775) , perhaps you know more about the issue ?
- Build system (eg.
x86_64-linux
oraarch64-darwin
): x86_64-linux - GHC version: 9.8.1
- Haskell.nix version (or commit) used: Available in the provided repo