Skip to content

Commit 07c1a43

Browse files
authored
Merge pull request #6857 from TomMD/fix/make-warning-red-so-people-read-and-i-do-not-start-seeing-red
Fix #6856 Make `--lib` warning louder and clearer
2 parents 48a8dfa + 2071398 commit 07c1a43

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

cabal-install/Distribution/Client/CmdInstall.hs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -678,10 +678,14 @@ warnIfNoExes :: Verbosity -> ProjectBuildContext -> IO ()
678678
warnIfNoExes verbosity buildCtx =
679679
when noExes $
680680
warn verbosity $
681-
"You asked to install executables, but there are no executables in "
682-
<> plural (listPlural selectors) "target" "targets" <> ": "
683-
<> intercalate ", " (showTargetSelector <$> selectors) <> ". "
684-
<> "Perhaps you want to use --lib to install libraries instead."
681+
"\n" <>
682+
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n" <>
683+
"@ WARNING: Installation might not be completed as desired! @\n" <>
684+
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n" <>
685+
"Without flags, the command \"cabal install\" doesn't expose" <>
686+
" libraries in a usable manner. You might have wanted to run" <>
687+
" \"cabal install --lib " <>
688+
unwords (showTargetSelector <$> selectors) <> "\". "
685689
where
686690
targets = concat $ Map.elems $ targetsMap buildCtx
687691
components = fst <$> targets

changelog.d/issue-6856

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
synopsis: Adjust message indicating `--lib` is likely desired
2+
packages: cabal-install
3+
issues: #6856
4+
prs: #6857

0 commit comments

Comments
 (0)