haskell / haskell/cabal

[nix-local-build] Recompilation avoidance ABA problem

Open
#3,179 11 comments 1 reaction 0 assignees View on GitHub
cabal-install: v2-build system old-milestone: ⊥ type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

Steps to reproduce:
1. Build a project with new-build
2. Modify a file in the project
3. Trigger a recompilation, but before GHC is done executing, C^C it
4. Revert the modified file to its old version
5. Trigger a recompilation

Expected result: Cabal recompiles

Actual result: Cabal reports that there is nothing to do.

Ostensibly, the problem is that before we start a recompile, we need to invalidate the old cached entry until the recompile finishes, so that we can handle an interrupt.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the five-step sequence with nix-local-build and trace how recompilation state is cached around an interrupted GHC run. Done means that after cancelling recompilation and reverting the file, the next build detects the change and recompiles instead of reporting nothing to do.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.