Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,866
    • Issues 4,866
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 456
    • Merge requests 456
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #9841
Closed
Open
Created Nov 27, 2014 by Niklas Hambüchen@nh2Reporter

Touching a file that uses TH triggers TH recompilation flood

Check out this test case:

https://github.com/nh2/ghc-th-recomp-touch-test

I have 2 modules, A and B, both using TH (using aeson) with B importing A.

After the first compilation, touch A.hs && ghc --make B.hs causes B to be recompiled.

Why should this be the case? If we see that the A.hi file is completely identical with what it was before, why should we recompile B?

This problem actually hits pretty hard when working in projects with > 200 modules.

(This all is under the assumption that TH doesn't do any IO with observably different result; we do already have this assumption if I understand it correctly, since otherwise we would always recompile all TH code, which we don't.)


Another problem is that the process is not very repeatable:

If you do touch A.hs && ghc --make All.hs and hit Ctrl-C before everything is done (e.g. after the 3rd modules), and then run just ghc --make All.hs, then GHC will decide to compile nothing at all, even though it had determined just before that everything needs to be recompiled. Is this expected?

Trac metadata
Trac field Value
Version 7.8.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Build System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC nh2
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking