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

Fix #6856 Make --lib warning louder and clearer #6857

Merged
merged 1 commit into from
Jun 4, 2020
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
12 changes: 8 additions & 4 deletions cabal-install/Distribution/Client/CmdInstall.hs
Original file line number Diff line number Diff line change
Expand Up @@ -678,10 +678,14 @@ warnIfNoExes :: Verbosity -> ProjectBuildContext -> IO ()
warnIfNoExes verbosity buildCtx =
when noExes $
warn verbosity $
"You asked to install executables, but there are no executables in "
<> plural (listPlural selectors) "target" "targets" <> ": "
<> intercalate ", " (showTargetSelector <$> selectors) <> ". "
<> "Perhaps you want to use --lib to install libraries instead."
"\n" <>
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n" <>
"@ WARNING: Installation might not be completed as desired! @\n" <>
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n" <>
"Without flags, the command \"cabal install\" doesn't expose" <>
" libraries in a usable manner. You might have wanted to run" <>
" \"cabal install --lib " <>
unwords (showTargetSelector <$> selectors) <> "\". "
where
targets = concat $ Map.elems $ targetsMap buildCtx
components = fst <$> targets
Expand Down
4 changes: 4 additions & 0 deletions changelog.d/issue-6856
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
synopsis: Adjust message indicating `--lib` is likely desired
packages: cabal-install
issues: #6856
prs: #6857