
#13727: `-Wmissing-home-modules` doesn't properly recognize filepath-qualified modules -------------------------------------+------------------------------------- Reporter: hvr | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.2.1-rc1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Incorrect Unknown/Multiple | error/warning at compile-time Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The `-Wmissing-home-modules` feature was implemented in order to be used by Cabal (see also #13129), 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` {{{#!hs module M1 where }}} - `src-exe/Main.hs` {{{#!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 ... }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13727 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler