Skip to content

Commit

Permalink
Mark "install --lib" as provisional
Browse files Browse the repository at this point in the history
And don't encourage its use as much as before. Adding packages to
build-depends is more often what the user wants.
  • Loading branch information
fgaz committed Apr 9, 2021
1 parent 00a2351 commit b0e88b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
17 changes: 12 additions & 5 deletions cabal-install/src/Distribution/Client/CmdInstall.hs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ installCommand = CommandUI
++ "If you want the installed executables to be available globally, "
++ "make sure that the PATH environment variable contains that directory. "
++ "\n\n"
++ "If TARGET is a library, it will be added to the global environment. "
++ "If TARGET is a library and --lib (provisional) is used, "
++ "it will be added to the global environment. "
++ "When doing this, cabal will try to build a plan that includes all "
++ "the previously installed libraries. This is currently not implemented."
, commandNotes = Just $ \pname ->
Expand Down Expand Up @@ -681,10 +682,16 @@ warnIfNoExes verbosity buildCtx =
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\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) <> "\". "
"The command \"cabal install [TARGETS]\" doesn't expose libraries.\n" <>
"* You might have wanted to add them as dependencies to your package." <>
" In this case add \"" <>
intercalate ", " (showTargetSelector <$> selectors) <>
"\" to the build-depends field(s) of your package's .cabal file.\n" <>
"* You might have wanted to add them to a GHC environment. In this case" <>
" use \"cabal install --lib " <>
unwords (showTargetSelector <$> selectors) <> "\". " <>
" The \"--lib\" flag is provisional: see" <>
" https://github.com/haskell/cabal/issues/6481 for more information."
where
targets = concat $ Map.elems $ targetsMap buildCtx
components = fst <$> targets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ defaultClientInstallFlags = ClientInstallFlags
clientInstallOptions :: ShowOrParseArgs -> [OptionField ClientInstallFlags]
clientInstallOptions _ =
[ option [] ["lib"]
"Install libraries rather than executables from the target package."
( "Install libraries rather than executables from the target package " <>
"(provisional, see https://github.com/haskell/cabal/issues/6481 for more information)." )
cinstInstallLibs (\v flags -> flags { cinstInstallLibs = v })
trueArg
, option [] ["package-env", "env"]
Expand Down

0 comments on commit b0e88b1

Please sign in to comment.