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,322
    • Issues 4,322
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 362
    • Merge Requests 362
  • 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
  • #13727

Closed
Open
Opened May 19, 2017 by Herbert Valerio Riedel@hvr🕺Maintainer

`-Wmissing-home-modules` doesn't properly recognize filepath-qualified modules

The -Wmissing-home-modules feature was implemented in order to be used by Cabal (see also #13129 (closed)), however it turns out that it currently has a minor bug which makes it much less useful for cabal as we can't enable it for executables this way, as Cabal needs to provide the path to the Main module directly.

Consider the following two files:

  • src-lib/M1.hs
module M1 where
  • src-exe/Main.hs
import M1

main = return ()

And now consider the following inconsistent results:

Expected good behaviour:

ghc-8.2.1 -fforce-recomp -Wmissing-home-modules -isrc-lib -isrc-exe Main

<no location info>: warning: [-Wmissing-home-modules]
    Modules are not listed in command line: M1
[1 of 2] Compiling M1               ( src-lib/M1.hs, src-lib/M1.o )
[2 of 2] Compiling Main             ( src-exe/Main.hs, src-exe/Main.o )
Linking src-exe/Main ...
ghc-8.2.1 -fforce-recomp -Wmissing-home-modules -isrc-lib -isrc-exe M1 Main
[1 of 2] Compiling M1               ( src-lib/M1.hs, src-lib/M1.o )
[2 of 2] Compiling Main             ( src-exe/Main.hs, src-exe/Main.o )
Linking src-exe/Main ...

Unexpected bad behaviour:

ghc-8.2.1 -fforce-recomp -Wmissing-home-modules src-lib/M1.hs src-exe/Main.hs 

<no location info>: warning: [-Wmissing-home-modules]
    Modules are not listed in command line: M1 Main
[1 of 2] Compiling M1               ( src-lib/M1.hs, src-lib/M1.o )
[2 of 2] Compiling Main             ( src-exe/Main.hs, src-exe/Main.o )
Linking src-exe/Main ...
ghc-8.2.1 -fforce-recomp -Wmissing-home-modules -isrc-lib M1 src-exe/Main

<no location info>: warning: [-Wmissing-home-modules]
    Modules are not listed in command line: Main
[1 of 2] Compiling M1               ( src-lib/M1.hs, src-lib/M1.o )
[2 of 2] Compiling Main             ( src-exe/Main.hs, src-exe/Main.o )
Linking src-exe/Main ...
Trac metadata
Trac field Value
Version 8.2.1-rc1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC Yuras
Operating system
Architecture
Assignee
Assign to
8.2.1
Milestone
8.2.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#13727