diff --git a/Cabal/src/Distribution/Simple/Errors.hs b/Cabal/src/Distribution/Simple/Errors.hs index 45029565e99..ebe7c232dae 100644 --- a/Cabal/src/Distribution/Simple/Errors.hs +++ b/Cabal/src/Distribution/Simple/Errors.hs @@ -47,7 +47,8 @@ data CabalException | EnableBenchMark | BenchMarkNameDisabled String | NoBenchMark String - | NoLibraryFound + | -- | @NoLibraryFound@ has been downgraded to a warning, and is therefore no longer emitted. + NoLibraryFound | CompilerNotInstalled CompilerFlavor | CantFindIncludeFile String | UnsupportedTestSuite String diff --git a/Cabal/src/Distribution/Simple/Install.hs b/Cabal/src/Distribution/Simple/Install.hs index c1134e2b355..c46f28b3529 100644 --- a/Cabal/src/Distribution/Simple/Install.hs +++ b/Cabal/src/Distribution/Simple/Install.hs @@ -147,7 +147,7 @@ install_setupHooks checkHasLibsOrExes = unless (hasLibs pkg_descr || hasForeignLibs pkg_descr || hasExes pkg_descr) $ - dieWithException verbosity NoLibraryFound + warn verbosity "No executables and no library found. Nothing to do." -- | Copy package global files. copyPackage diff --git a/changelog.d/issue-6750 b/changelog.d/issue-6750 new file mode 100644 index 00000000000..3d89e198427 --- /dev/null +++ b/changelog.d/issue-6750 @@ -0,0 +1,13 @@ +synopsis: Make Setup copy/install succeed when there's no executable or library +packages: Cabal +prs: TODO +issues: #750 + +description: { + Historically the Setup copy and install steps would fail if the package didn't + contain an executable or library component. In this case there's nothing to do. + + This required workarounds for downstream users of Cabal to handle this edge case. + Now that this error has been downgraded to a warning, Cabal will succeed if + there's nothing to do. +}