Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,320
    • Issues 4,320
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 359
    • Merge Requests 359
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #13829

Closed
Open
Opened Jun 15, 2017 by Niklas Hambüchen@nh2Reporter

ghc --make should not relink when we know the binary doesn't change

I would expect GHC not to relink after touching a file, since no actual program code was changed. But it does:

$ echo "main = return ()" > Main.hs

$ ghc --make Main.hs 
[1 of 1] Compiling Main             ( Main.hs, Main.o )
Linking Main ...

$ touch Main.hs 

$ ghc --make Main.hs 
[1 of 1] Compiling Main             ( Main.hs, Main.o )
Linking Main ...

I would expect that the recompilation avoidance makes GHC stop continuing as soon as it has noticed that the same object code (.o file) was generated as in the first build.

Perhaps even earlier (e.g. after parsing) in this specific case; but certainly after code gen, which I'd expect also to avoid the recompilation if e.g. a comment was added to the file, as the comment won't make it into the program code (unless something like TH location or HasCallStack is used, which can change the line numbers those generate if a comment pushes them down).

Edited Mar 10, 2019 by Niklas Hambüchen
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#13829