From 2071398d727e6d7e83ff83c354fbb89e7151a95e Mon Sep 17 00:00:00 2001 From: "Thomas M. DuBuisson" Date: Thu, 28 May 2020 16:18:39 -0700 Subject: [PATCH] Fix #6856 Make `--lib` warning louder and clearer --- cabal-install/Distribution/Client/CmdInstall.hs | 12 ++++++++---- changelog.d/issue-6856 | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 changelog.d/issue-6856 diff --git a/cabal-install/Distribution/Client/CmdInstall.hs b/cabal-install/Distribution/Client/CmdInstall.hs index 04920147861..a82d6ac233c 100644 --- a/cabal-install/Distribution/Client/CmdInstall.hs +++ b/cabal-install/Distribution/Client/CmdInstall.hs @@ -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 diff --git a/changelog.d/issue-6856 b/changelog.d/issue-6856 new file mode 100644 index 00000000000..46ca470f156 --- /dev/null +++ b/changelog.d/issue-6856 @@ -0,0 +1,4 @@ +synopsis: Adjust message indicating `--lib` is likely desired +packages: cabal-install +issues: #6856 +prs: #6857