Fix recomp bug by invalidating cache on build exception
commita9f2c3b20cf6f42b6efe23d31b5d1d7ced6786d8
authorRodrigo Mesquita <rodrigo.m.mesquita@gmail.com>
Wed, 12 Jun 2024 10:51:12 +0000 (12 11:51 +0100)
committerMikolaj <281893+Mikolaj@users.noreply.github.com>
Sat, 15 Jun 2024 07:22:04 +0000 (15 07:22 +0000)
tree5b80a48dae8e8608022d6055306faae11ea6cff0
parent0b0a31a032660492836cf959c10e4c3f518add45
Fix recomp bug by invalidating cache on build exception

Be sure to invalidate the cache if building throws an exception!
If not, we'll abort execution with a stale recompilation cache.
See ghc#24926 for an example of how this can go wrong.
cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs
cabal-testsuite/PackageTests/Recompilation/GHC24926/Repro.hs [new file with mode: 0644]
cabal-testsuite/PackageTests/Recompilation/GHC24926/cabal.test.hs [new file with mode: 0644]
cabal-testsuite/PackageTests/Recompilation/GHC24926/repro.cabal [new file with mode: 0644]
cabal-testsuite/PackageTests/Recompilation/GHC24926/src/Process.hs [new file with mode: 0644]