Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
e2c04f03
Commit
e2c04f03
authored
Jan 21, 2017
by
Yuras
Committed by
Edward Z. Yang
Jan 22, 2017
Browse files
Enable -Wmissing-home modules when building a library
parent
60ca0937
Changes
5
Hide whitespace changes
Inline
Side-by-side
Cabal/Distribution/Simple/GHC.hs
View file @
e2c04f03
...
...
@@ -1450,7 +1450,11 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do
componentGhcOptions
::
Verbosity
->
LocalBuildInfo
->
BuildInfo
->
ComponentLocalBuildInfo
->
FilePath
->
GhcOptions
componentGhcOptions
=
Internal
.
componentGhcOptions
componentGhcOptions
verbosity
lbi
=
Internal
.
componentGhcOptions
verbosity
implInfo
lbi
where
comp
=
compiler
lbi
implInfo
=
getImplInfo
comp
componentCcGhcOptions
::
Verbosity
->
LocalBuildInfo
->
BuildInfo
->
ComponentLocalBuildInfo
...
...
Cabal/Distribution/Simple/GHC/ImplInfo.hs
View file @
e2c04f03
...
...
@@ -42,6 +42,7 @@ data GhcImplInfo = GhcImplInfo
,
flagPackageConf
::
Bool
-- ^ use package-conf instead of package-db
,
flagDebugInfo
::
Bool
-- ^ -g flag supported
,
supportsPkgEnvFiles
::
Bool
-- ^ picks up @.ghc.environment@ files
,
flagWarnMissingHomeModules
::
Bool
-- ^ -Wmissing-home-modules is supported
}
getImplInfo
::
Compiler
->
GhcImplInfo
...
...
@@ -67,6 +68,7 @@ ghcVersionImplInfo ver = GhcImplInfo
,
flagPackageConf
=
v
<
[
7
,
5
]
,
flagDebugInfo
=
v
>=
[
7
,
10
]
,
supportsPkgEnvFiles
=
v
>=
[
8
,
0
,
1
,
20160901
]
-- broken in 8.0.1, fixed in 8.0.2
,
flagWarnMissingHomeModules
=
v
>=
[
8
,
2
,
1
]
}
where
v
=
versionNumbers
ver
...
...
@@ -83,6 +85,7 @@ ghcjsVersionImplInfo _ghcjsver ghcver = GhcImplInfo
,
flagPackageConf
=
False
,
flagDebugInfo
=
False
,
supportsPkgEnvFiles
=
ghcv
>=
[
8
,
0
,
2
]
--TODO: check this works in ghcjs
,
flagWarnMissingHomeModules
=
False
}
where
ghcv
=
versionNumbers
ghcver
...
...
Cabal/Distribution/Simple/GHC/Internal.hs
View file @
e2c04f03
...
...
@@ -290,10 +290,10 @@ componentCcGhcOptions verbosity _implInfo lbi bi clbi odir filename =
ghcOptObjDir
=
toFlag
odir
}
componentGhcOptions
::
Verbosity
->
LocalBuildInfo
componentGhcOptions
::
Verbosity
->
GhcImplInfo
->
LocalBuildInfo
->
BuildInfo
->
ComponentLocalBuildInfo
->
FilePath
->
GhcOptions
componentGhcOptions
verbosity
lbi
bi
clbi
odir
=
componentGhcOptions
verbosity
implInfo
lbi
bi
clbi
odir
=
mempty
{
-- Respect -v0, but don't crank up verbosity on GHC if
-- Cabal verbosity is requested. For that, use --ghc-option=-v instead!
...
...
@@ -316,6 +316,12 @@ componentGhcOptions verbosity lbi bi clbi odir =
_
->
[]
,
ghcOptNoCode
=
toFlag
$
componentIsIndefinite
clbi
,
ghcOptHideAllPackages
=
toFlag
True
,
ghcOptWarnMissingHomeModules
=
case
clbi
of
LibComponentLocalBuildInfo
{}
->
if
flagWarnMissingHomeModules
implInfo
then
toFlag
True
else
mempty
_
->
mempty
,
ghcOptPackageDBs
=
withPackageDB
lbi
,
ghcOptPackages
=
toNubListR
$
mkGhcOptPackages
clbi
,
ghcOptSplitObjs
=
toFlag
(
splitObjs
lbi
),
...
...
Cabal/Distribution/Simple/GHCJS.hs
View file @
e2c04f03
...
...
@@ -823,7 +823,9 @@ componentGhcOptions :: Verbosity -> LocalBuildInfo
->
BuildInfo
->
ComponentLocalBuildInfo
->
FilePath
->
GhcOptions
componentGhcOptions
verbosity
lbi
bi
clbi
odir
=
let
opts
=
Internal
.
componentGhcOptions
verbosity
lbi
bi
clbi
odir
let
opts
=
Internal
.
componentGhcOptions
verbosity
implInfo
lbi
bi
clbi
odir
comp
=
compiler
lbi
implInfo
=
getImplInfo
comp
in
opts
{
ghcOptExtra
=
ghcOptExtra
opts
`
mappend
`
toNubListR
(
hcOptions
GHCJS
bi
)
}
...
...
Cabal/Distribution/Simple/Program/GHC.hs
View file @
e2c04f03
...
...
@@ -110,6 +110,9 @@ data GhcOptions = GhcOptions {
-- | Start with a clean package set; the @ghc -hide-all-packages@ flag
ghcOptHideAllPackages
::
Flag
Bool
,
-- | Warn about modules, not listed in command line
ghcOptWarnMissingHomeModules
::
Flag
Bool
,
-- | Don't automatically link in Haskell98 etc; the @ghc
-- -no-auto-link-packages@ flag.
ghcOptNoAutoLinkPackages
::
Flag
Bool
,
...
...
@@ -434,6 +437,7 @@ renderGhcOptions comp _platform@(Platform _arch os) opts
,
concat
[
[
"-fno-code"
,
"-fwrite-interface"
]
|
flagBool
ghcOptNoCode
]
,
[
"-hide-all-packages"
|
flagBool
ghcOptHideAllPackages
]
,
[
"-Wmissing-home-modules"
|
flagBool
ghcOptWarnMissingHomeModules
]
,
[
"-no-auto-link-packages"
|
flagBool
ghcOptNoAutoLinkPackages
]
,
packageDbArgs
implInfo
(
ghcOptPackageDBs
opts
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment