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,393
    • Issues 4,393
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 381
    • Merge Requests 381
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #14923

Closed
Open
Opened Mar 15, 2018 by takano-akio@takano-akioReporter

Recompilation avoidance fails after a LANGUAGE change

It looks like the recompilation checker can be confused when a LANGUAGE pragma is added or removed.

The following shell script demonstrates the issue:

#!/bin/sh
cat >Foo.hs <<END
{-# LANGUAGE UndecidableInstances #-}
module Foo where
END
rm -f Foo.hi Foo.o

ghc -c Foo.hs; ghc --show-iface Foo.hi | grep flag

sed -i 's/\^{-\#/--&/' Foo.hs # comment out the pragma

ghc -c Foo.hs; ghc --show-iface Foo.hi | grep flag
ghc -c Foo.hs; ghc --show-iface Foo.hi | grep flag
ghc -c Foo.hs; ghc --show-iface Foo.hi | grep flag

I get this output:

% ./bug.sh
  flag hash: b1ada48735eec2ef16d5070887aa7f10
  flag hash: b1ada48735eec2ef16d5070887aa7f10
  flag hash: e7b294090e04f1a84f0bfc9b8cc49322
compilation IS NOT required
  flag hash: e7b294090e04f1a84f0bfc9b8cc49322

In the third invocation to GHC, I expect the recompilation checker to detect that compilation is not required, because nothing has changed since the second invocation. Also it seems suspicious that the flag hash changes beteen the second run and the third run.

Trac metadata
Trac field Value
Version 8.4.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Edited Mar 18, 2019 by Ben Gamari
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#14923