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,251
    • Issues 4,251
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 394
    • Merge Requests 394
  • 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
  • #11256

Closed
Open
Opened Dec 19, 2015 by Edward Z. Yang@ezyangDeveloper

ghc --make reports bad import errors too eagerly

Consider this A.hs file, with a valid header (no B.hs file) and a syntax error:

module A where
import B

= as7df89a235r a23jk @A#$(&#$A 

We get different behavior when one-shot compiling and make compiling:

ezyang@sabre:~$ ghc -c A.hs

A.hs:4:1: parse error on input `='
ezyang@sabre:~$ ghc --make A.hs

A.hs:2:8:
    Could not find module `B'
    Use -v to see a list of the files searched for.

I feel like the --make error is wrong, and we shouldn't actually complain that an import is missing until we build it. But it cuts both ways; if you have a big module graph and you try to --make, currently --make will report instantaneously if any import is wrong; if we changed this behavior, --make would chug along until it actually tried to compile the offending file.

It's easy to fix and I can easily submit a patch for it, if people think we should defer the error. Doing this will also let me remove a grievous hack from my fix to #11244 (closed).

Trac metadata
Trac field Value
Version 7.11
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
8.0.1
Milestone
8.0.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#11256