Skip to content

Commit be062a7

Browse files
committed
Notify the user that an executable got symlinked
Before there wasn't much feedback. Most times the only thing that got printed was "Up to date".
1 parent 450ee85 commit be062a7

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

cabal-install/Distribution/Client/CmdInstall.hs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ import Distribution.Types.UnqualComponentName
5858
import Distribution.Verbosity
5959
( Verbosity, normal )
6060
import Distribution.Simple.Utils
61-
( wrapText, die', withTempDirectory, createDirectoryIfMissingVerbose )
61+
( wrapText, die', notice
62+
, withTempDirectory, createDirectoryIfMissingVerbose )
6263

6364
import qualified Data.Map as Map
6465
import System.Directory ( getTemporaryDirectory, makeAbsolute )
@@ -195,7 +196,7 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags)
195196
$ projectConfigBuildOnly
196197
$ projectConfig $ baseCtx
197198
createDirectoryIfMissingVerbose verbosity False symlinkBindir
198-
traverse_ (symlinkBuiltPackage mkPkgBinDir symlinkBindir)
199+
traverse_ (symlinkBuiltPackage verbosity mkPkgBinDir symlinkBindir)
199200
$ Map.toList $ targetsMap buildCtx
200201
runProjectPostBuildPhase verbosity baseCtx buildCtx buildOutcomes
201202
where
@@ -213,22 +214,24 @@ disableTestsBenchsByDefault configFlags =
213214
, configBenchmarks = Flag False <> configBenchmarks configFlags }
214215

215216
-- | Symlink every exe from a package from the store to a given location
216-
symlinkBuiltPackage :: (UnitId -> FilePath) -- ^ A function to get an UnitId's
217+
symlinkBuiltPackage :: Verbosity
218+
-> (UnitId -> FilePath) -- ^ A function to get an UnitId's
217219
-- store directory
218220
-> FilePath -- ^ Where to put the symlink
219221
-> ( UnitId
220222
, [(ComponentTarget, [TargetSelector])] )
221223
-> IO ()
222-
symlinkBuiltPackage mkSourceBinDir destDir (pkg, components) =
223-
traverse_ (symlinkBuiltExe (mkSourceBinDir pkg) destDir) exes
224+
symlinkBuiltPackage verbosity mkSourceBinDir destDir (pkg, components) =
225+
traverse_ (symlinkBuiltExe verbosity (mkSourceBinDir pkg) destDir) exes
224226
where
225227
exes = catMaybes $ (exeMaybe . fst) <$> components
226228
exeMaybe (ComponentTarget (CExeName exe) _) = Just exe
227229
exeMaybe _ = Nothing
228230

229231
-- | Symlink a specific exe.
230-
symlinkBuiltExe :: FilePath -> FilePath -> UnqualComponentName -> IO Bool
231-
symlinkBuiltExe sourceDir destDir exe =
232+
symlinkBuiltExe :: Verbosity -> FilePath -> FilePath -> UnqualComponentName -> IO Bool
233+
symlinkBuiltExe verbosity sourceDir destDir exe = do
234+
notice verbosity $ "Symlinking " ++ unUnqualComponentName exe
232235
symlinkBinary
233236
destDir
234237
sourceDir

0 commit comments

Comments
 (0)