Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress ghc-pkg warnings emitted when an empty packages is being registered #9997

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cabal/src/Distribution/Simple/Register.hs
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,8 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi
, IPI.ldOptions = ldOptions bi
, IPI.frameworks = map getSymbolicPath $ frameworks bi
, IPI.frameworkDirs = map getSymbolicPath $ extraFrameworkDirs bi
, IPI.haddockInterfaces = [haddockdir installDirs </> haddockLibraryPath pkg lib]
, IPI.haddockHTMLs = [htmldir installDirs]
, IPI.haddockInterfaces = [haddockdir installDirs </> haddockLibraryPath pkg lib | hasModules]
, IPI.haddockHTMLs = [htmldir installDirs | hasModules]
, IPI.pkgRoot = Nothing
, IPI.libVisibility = libVisibility lib
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: emptyLib
Cabal-version: >= 1.2
version: 1.0
build-type: Simple

Library
13 changes: 13 additions & 0 deletions cabal-testsuite/PackageTests/HaddockEmptyLib/setup.cabal.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Setup configure
Configuring emptyLib-1.0...
# Setup build
Preprocessing library for emptyLib-1.0...
Building library for emptyLib-1.0...
# Setup haddock
Preprocessing library for emptyLib-1.0...
Running Haddock on library for emptyLib-1.0...
Warning: Haddocks are being requested, but there aren't any modules given to create documentation for.
# Setup copy
Installing library in <PATH>
# Setup register
Registering library for emptyLib-1.0...
13 changes: 13 additions & 0 deletions cabal-testsuite/PackageTests/HaddockEmptyLib/setup.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Setup configure
Configuring emptyLib-1.0...
# Setup build
Preprocessing library for emptyLib-1.0...
Building library for emptyLib-1.0...
# Setup haddock
Preprocessing library for emptyLib-1.0...
Running Haddock on library for emptyLib-1.0...
Warning: Haddocks are being requested, but there aren't any modules given to create documentation for.
# Setup copy
Installing library in <PATH>
# Setup register
Registering library for emptyLib-1.0...
6 changes: 6 additions & 0 deletions cabal-testsuite/PackageTests/HaddockEmptyLib/setup.test.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Test.Cabal.Prelude
-- Test install when the library is empty, for #9997
main = setupAndCabalTest $
withPackageDb $
withDirectory "empty" $
setup_install_with_docs []
15 changes: 15 additions & 0 deletions changelog.d/pr-9997
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
synopsis: Suppress ghc-pkg warnings emitted when an empty packages is being registered
packages: Cabal
prs: #9997

description: {

When a package contains a library that has no modules, `./Setup register`
tries to register the library with fields `haddock-interfaces:` and
`haddock-html:` pointing at non-existent files or directories, and `ghc-pkg
register` warns about them.

To suppress the warnings prevent these fields from being generated when
there are no modules.

}
Loading